C++ main module for emicrom Package  1.0
MATH_MorseMatrix.h
Go to the documentation of this file.
1 #ifndef MATH_MorseMatrix_H
2 #define MATH_MorseMatrix_H
3 
4 #include "MATH_MaskMatrix.h"
5 
6 #include "CORE_MorseArray.h"
7 
8 
16 
19 
20 private:
21 
22  //index of column by row
24  //index of values by row
26 
27 
28 
29 protected:
33  //share the index array for both morse arrays
34  mValues.setIndicesByReference(mColumns.getIndicesByReference());
35  }
36 
37 
38 
39  // DESTRUCTORS
40 
41 
44  virtual ~MATH_MorseMatrix(void) {
45  }
46 
47 public:
51  inline static SP::MATH_MorseMatrix New() {
52  SP::MATH_MorseMatrix p(new MATH_MorseMatrix(),MATH_MorseMatrix::Delete());
53  p->setThis(p);
54  return p;
55  }
59  virtual SP::MATH_Matrix NewInstance() const {
60  return New();
61  }
62 
63 
64  //SET Methods
65  //===========
66 
71  virtual void setSize(const tUIndex& r,const tUIndex& c) {
72  mValues.setSize(r,c);
73  mColumns.setSize(r,c);
74 
75  }
76 
79  inline void fitToSize() {
80  mValues.fitToSize();
81  mColumns.fitToSize();
82  }
83 
84  //GET Methods
85  //===========
86 
90  virtual tUIndex getRowsNumber() const {
91  return mColumns.getSize();
92  }
96  virtual tUIndex getColumnsNumber() const {
97  return mColumns.getMaxValuesNumberPerElement();
98  }
99 
106  return mColumns.getIndices();
107  }
114  inline const CORE_UIndexArray& getRowsIndices() const {
115  return mColumns.getIndices();
116  }
122  return mColumns.getValues();
123  }
128  inline const CORE_UIndexArray& getColumnsIndices() const {
129  return mColumns.getValues();
130  }
136  return mValues.getValues();
137  }
142  inline const CORE_RealArray& getValues() const {
143  return mValues.getValues();
144  }
153  virtual tULLInt getMemorySize() const {
155  mValues.getMemorySize()+
156  mColumns.getMemorySize();
157  }
158  //arithmetic methods
159  //==================
160 
161 
162 
163 
164 protected:
174  virtual void product(const tUIndex& n,
175  const tReal& beta,
176  const tUSInt& incX,const tReal* x,
177  const tReal& alpha,
178  const tUSInt& incY,tReal* y) const;
186  virtual void product(const tReal& alpha,
187  const tUSInt& incX,const tReal* x,
188  const tUSInt& incY,tReal* y) const;
189 
196  virtual void product(const tUSInt& incX,const tReal* x,
197  const tUSInt& incY,tReal* y) const;
198 
199 
200 
201 
202 };
203 #endif
SP_OBJECT(MATH_MorseMatrix)
const CORE_UIndexArray & getIndices() const
get the indices of the morse array for reading
Definition: CORE_MorseArray.h:449
virtual tUIndex getColumnsNumber() const
return the number of columns of the matrix
Definition: MATH_MorseMatrix.h:96
DEFINE_SPTR(MATH_MorseMatrix)
CORE_RealArray & getValues()
get the values of the matrix
Definition: MATH_MorseMatrix.h:135
MATH_MorseMatrix(void)
create a vector
Definition: MATH_MorseMatrix.h:32
virtual void product(const tUIndex &n, const tReal &beta, const tUSInt &incX, const tReal *x, const tReal &alpha, const tUSInt &incY, tReal *y) const
y:=alpha.y+beta. T . x where T is this
Definition: MATH_MorseMatrix.cpp:8
const CORE_RealArray & getValues() const
get the values of the matrix
Definition: MATH_MorseMatrix.h:142
void setIndicesByReference(SP::CORE_UIndexArray indices)
set the indices by reference
Definition: CORE_MorseArray.h:367
void fitToSize()
fit to size
Definition: CORE_MorseArray.h:536
#define tUSInt
Definition: types.h:28
const tUIndex & getMaxValuesNumberPerElement() const
get the max number of values per element
Definition: CORE_MorseArray.h:424
virtual tUIndex getRowsNumber() const
return the number of rows of the matrix
Definition: MATH_MorseMatrix.h:90
This class impements the MATH_Matrix class thanks to CORE_RealMorseArray data.
Definition: MATH_MorseMatrix.h:17
void fitToSize()
fit the memory size to useful size
Definition: MATH_MorseMatrix.h:79
const CORE_Array< T > & getValues() const
get the values of the morse array
Definition: CORE_MorseArray.h:437
CORE_RealMorseArray mValues
Definition: MATH_MorseMatrix.h:25
This class impements the MATH_MaskMatrix whci deals with mask vector.
Definition: MATH_MaskMatrix.h:19
CORE_UIndexMorseArray mColumns
Definition: MATH_MorseMatrix.h:23
virtual SP::MATH_Matrix NewInstance() const
return a share pointer to a new instance of this
Definition: MATH_MorseMatrix.h:59
const tUIndex & getSize() const
get the number of elements of the array
Definition: CORE_MorseArray.h:404
SP::CORE_UIndexArray getIndicesByReference() const
get the indices of the morse array for reading/writing
Definition: CORE_MorseArray.h:443
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: CORE_MorseArray.h:396
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: MATH_Matrix.h:68
#define tUIndex
Definition: types.h:126
CORE_UIndexArray & getRowsIndices()
get the index of all data correspoding to each row
Definition: MATH_MorseMatrix.h:105
virtual void setSize(const tUIndex &r, const tUIndex &c)
set the size of the matrix
Definition: MATH_MorseMatrix.h:71
const CORE_UIndexArray & getColumnsIndices() const
get the index of all columns
Definition: MATH_MorseMatrix.h:128
static SP::MATH_MorseMatrix New()
return a share pointer of a vector based on CORE_RealArray
Definition: MATH_MorseMatrix.h:51
const CORE_UIndexArray & getRowsIndices() const
get the index of all data correspoding to each row
Definition: MATH_MorseMatrix.h:114
virtual ~MATH_MorseMatrix(void)
destroy a vector
Definition: MATH_MorseMatrix.h:44
CORE_UIndexArray & getColumnsIndices()
get the index of all columns
Definition: MATH_MorseMatrix.h:121
#define tULLInt
Definition: types.h:45
#define tReal
Definition: types.h:118
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: MATH_MorseMatrix.h:153
void setSize(const tUIndex &n, const tUIndex &m, const tUInteger &p)
set the size of the morse array
Definition: CORE_MorseArray.h:342
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141