C++ main module for emicrom Package  1.0
MATH_LeafBlockMatrixPackedStorage.h
Go to the documentation of this file.
1 #ifndef MATH_LeafBlockMatrixPackedStorage_H
2 #define MATH_LeafBlockMatrixPackedStorage_H
3 
18 
21 
22 public:
23 
24 
25 
26 private:
27  // ATTRIBUTES
28 
29 
30 protected:
31 
32  // METHOD
33 
34  // CONSTRUCTORS
35 
39 
40  }
41 
42 
43 
44  // DESTRUCTORS
45 
46 
50  }
51 
52 
53 public:
54  // NEW
59  inline static SP::MATH_LeafBlockMatrixPackedStorage New() {
60  SP::MATH_LeafBlockMatrixPackedStorage ret(new MATH_LeafBlockMatrixPackedStorage(),
62  ret->setThis(ret);
63  return ret;
64  };
65 
66 
67 public:
71  virtual SP::MATH_LeafBlockMatrixStorage NewInstance() const {
72  return New();
73  };
74 
80  virtual tUIndex getIndex(const tUIndex& i,const tUIndex& j) const {
81  //packed
82 
83  if (j<i) return getIndex(j,i);
84  return i+(j*(j+1)/2);
85  //return getSize()*(i+1)+i-(i*(i+1)/2)-(j+1);
86  }
90  virtual tUIndex getSize() const {
91  //packed
92  return (getDimension()*(getDimension()+1))/2;
93  }
94 
95 
96 
97 
98 
99  // OTHERS Methods
100 
101 };
102 #endif
virtual tUIndex getSize() const
get the number of values of the leaf matrix
Definition: MATH_LeafBlockMatrixPackedStorage.h:90
SP_OBJECT(MATH_LeafBlockMatrixPackedStorage)
static SP::MATH_LeafBlockMatrixPackedStorage New()
build a new instance of class
Definition: MATH_LeafBlockMatrixPackedStorage.h:59
virtual ~MATH_LeafBlockMatrixPackedStorage(void)
destroy a multi level toeplitz matrix
Definition: MATH_LeafBlockMatrixPackedStorage.h:49
virtual tUIndex getIndex(const tUIndex &i, const tUIndex &j) const
get the index of the row i & column j at the matrix at level 0
Definition: MATH_LeafBlockMatrixPackedStorage.h:80
MATH_LeafBlockMatrixPackedStorage(void)
create a multi level toeplitz matrix
Definition: MATH_LeafBlockMatrixPackedStorage.h:38
Definition: MATH_LeafBlockMatrixPackedStorage.h:19
Definition: MATH_LeafBlockMatrixStorage.h:22
const tUIndex & getDimension() const
get the dimension (number of rows or columns) of the leaf matrix
Definition: MATH_LeafBlockMatrixStorage.h:93
virtual SP::MATH_LeafBlockMatrixStorage NewInstance() const
return a share poinetr to a copy instance of this
Definition: MATH_LeafBlockMatrixPackedStorage.h:71
#define tUIndex
Definition: types.h:126
DEFINE_SPTR(MATH_LeafBlockMatrixPackedStorage)
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141