C++ main module for mmsd Package  1.0
MMSD_IntegerFullMatrix.h
Go to the documentation of this file.
1 #ifndef MMSD_IntegerFullMatrix_H
2 #define MMSD_IntegerFullMatrix_H
3 
4 #include "LAP_Matrix.h"
5 
6 #include "LAP_IntVector.h"
7 
16 
18  SP_OBJECT(MMSD_IntegerFullMatrix);
19  // ATTRIBUTES
20 
21 private:
22  static tBoolean IS_RANDOMIZED_ENABLED;
23 
24  // ASSOCIATIONS
25  LAP_IntVector mValues;
26 
27 
28 
29 public:
30  // METHODS
31 
32  // CONSTRUCTORS
33 
37  MMSD_IntegerFullMatrix(const size_t& n,const size_t& p);
38 
39 
40  // DESTRUCTORS
41 
42 
45  virtual ~MMSD_IntegerFullMatrix(void);
46 
47 
48 public:
49  //----------------
50  // NEW constructors
51  // ---------------
52 
55  static inline SP::MMSD_IntegerFullMatrix New() {
56  SP::MMSD_IntegerFullMatrix p(new MMSD_IntegerFullMatrix(),
58  p->setThis(p);
59  return p;
60  };
63  static inline SP::MMSD_IntegerFullMatrix New(const int& n,const int& p) {
64  SP::MMSD_IntegerFullMatrix ptr=New();
65  ptr->setSize(n,p);
66  return ptr;
67  }
68 
69  // OPERATORS
70  // ----------
76  virtual const int& operator()(const tLVectorIndex& i,
77  const tLVectorIndex& j) const {
78  return mValues[getRowsNumber()*j+i];
79  }
80 
86  virtual int& operator()(const tLVectorIndex& i,
87  const tLVectorIndex& j) {
88  return mValues[getRowsNumber()*j+i];
89  }
93  mValues.init(s);
94  return (*this);
95  };
96 
97 
98  // Combinations computations
99  // --------------------------
104  int computeCombinations(const int& p,const int& n);
105 
106 
107  // randomized columns
108  // ------------------
113  static void setIsRandomizedEnabled(const tBoolean& v) {
114  IS_RANDOMIZED_ENABLED=v;
115  };
118  void randomizeColumns();
119 
120 
121 
122 
123 };
124 
125 #endif
virtual int & operator()(const tLVectorIndex &i, const tLVectorIndex &j)
get the element at row i & column j
Definition: MMSD_IntegerFullMatrix.h:86
void randomizeColumns()
randomize the order of the column
Definition: MMSD_IntegerFullMatrix.cpp:29
static SP::MMSD_IntegerFullMatrix New()
create a full matrix
Definition: MMSD_IntegerFullMatrix.h:55
static SP::MMSD_IntegerFullMatrix New(const int &n, const int &p)
create a full matrix
Definition: MMSD_IntegerFullMatrix.h:63
#define tBoolean
Definition: types.h:48
int computeCombinations(const int &p, const int &n)
compute the combinaison of P elements among N It creates a matrix of size (C_N^P x P) the column i is...
Definition: MMSD_IntegerFullMatrix.cpp:20
MMSD_IntegerFullMatrix(void)
create an object
Definition: MMSD_IntegerFullMatrix.cpp:7
DEFINE_SVPTR(MMSD_IntegerFullMatrix)
MMSD_IntegerFullMatrix & operator=(const int &s)
init all the matrix to s
Definition: MMSD_IntegerFullMatrix.h:92
DEFINE_SPTR(MMSD_IntegerFullMatrix)
virtual ~MMSD_IntegerFullMatrix(void)
destroy an object.
Definition: MMSD_IntegerFullMatrix.cpp:16
This class describes the FullMatrix class.
Definition: MMSD_IntegerFullMatrix.h:17
#define tLVectorIndex
Definition: lapack_types.h:13
static void setIsRandomizedEnabled(const tBoolean &v)
set if the randomized is enabled
Definition: MMSD_IntegerFullMatrix.h:113
this class describes a general matrix for lapack used : the matrix is stored in column mValues={T_{0...
Definition: LAP_Matrix.h:15
virtual tLVectorIndex getRowsNumber() const
get the lines number of the matrix from view
Definition: LAP_Matrix.h:116
virtual const int & operator()(const tLVectorIndex &i, const tLVectorIndex &j) const
get the element at row i & column j
Definition: MMSD_IntegerFullMatrix.h:76
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106