C++ main module for emicrom Package  1.0
EMM_CanonicalMassMatrix.h
Go to the documentation of this file.
1 #ifndef EMM_CanonicalMassMatrix_H
2 #define EMM_CanonicalMassMatrix_H
3 
4 //interface class
5 #include "EMM_MassMatrix.h"
6 
7 //enable the mask vector product
8 #include "MATH_MaskMatrix.h"
9 #include "MATH_ArrayVector.h"
10 
11 
24 class EMM_CanonicalMassMatrix : public EMM_MassMatrix, public virtual MATH_MaskMatrix {
25 
27  // ATTRIBUTES
28 public:
29 
30 
31 
32 
33 private:
34 
35  //for solving A.Y=B with work array of W
36  SP::MATH_MaskVector mY;
37  SP::MATH_MaskVector mB;
38  SP::MATH_MaskVector mW;
39 
40 
41 
42 protected:
43  // METHODS
44 
45  // CONSTRUCTORS
46 
50 
51 
52 
53  // DESTRUCTORS
54 
55 
58  virtual ~EMM_CanonicalMassMatrix(void);
59 
60 public:
61 
65  virtual SP::MATH_Matrix NewInstance() const {
66  return New();
67  }
68 
72  inline static SP::EMM_CanonicalMassMatrix New() {
73  SP::EMM_CanonicalMassMatrix p(new EMM_CanonicalMassMatrix(),
75  p->setThis(p);
76  return p;
77  };
78 
79  // SET methods
80 
81 public:
82 
83  // GET methods
87  virtual tUIndex getRowsNumber() const {
89  }
93  virtual tUIndex getColumnsNumber() const {
95  }
96 public:
105  virtual tULLInt getMemorySize() const {
106  return MATH_MaskMatrix::getMemorySize()+mW->getMemorySize()+mB->getMemorySize()+mY->getMemorySize();
107  }
108 
113  virtual void setSize(const tUIndex& nRows,const tUIndex& nCols) {
114  EMM_MassMatrix::setSize(nRows,nCols);
115  }
116 
117 public:
118  // OTHERS methods
121  virtual tBoolean isSymmetric() const {
122  SP::MATH_ArrayVector W=MATH_ArrayVector::New();
123  return MATH_Matrix::isSymmetric(1.e-12,*W.get());
124  }
125 
126 protected:
136  virtual void product(const tUIndex& n,
137  const tReal& alpha,
138  const tUSInt& incX,const tReal* x,
139  const tReal& beta,
140  const tUSInt& incY,tReal* y) const;
141 
142 
143 protected:
152  virtual tReal symmetricDot(const tUSInt& incX,const tReal* x,
153  const tUSInt& incY,const tReal* y) const;
163  virtual tReal symmetricDot(const tReal *D,
164  const tUSInt& incX,const tReal* X,
165  const tUSInt& incY,const tReal* Y) const;
166 
167 
168 public:
169 
178  virtual tBoolean solve(MATH_Solver& solver,EMM_RealField& B);
179 
186  virtual void product(const tReal& alpha,const EMM_RealField& X,
187  const tReal& beta,EMM_RealField& Y) const;
188 
189 
193  virtual tReal symmetricDot(const EMM_RealField& X) const;
198  virtual tReal symmetricDot(const EMM_RealArray& W,const EMM_RealField& X) const;
199 
203  virtual tString toString() const;
204 
205 
206 
207 
208 };
209 
210 #endif
virtual tUIndex getRowsNumber() const
get the rows number of the matrix
Definition: EMM_CanonicalMassMatrix.h:87
static const tDimension Y
Definition: EMM_Object.h:34
static const tDimension X
Definition: EMM_Object.h:33
virtual tString toString() const
return the string representatio of the class
Definition: EMM_CanonicalMassMatrix.cpp:967
SP::MATH_MaskVector mB
Definition: EMM_CanonicalMassMatrix.h:37
DEFINE_SVPTR(EMM_CanonicalMassMatrix)
virtual tBoolean solve(MATH_Solver &solver, EMM_RealField &B)
sole AX=B thanks to the solver
Definition: EMM_CanonicalMassMatrix.cpp:914
virtual ~EMM_CanonicalMassMatrix(void)
destroy
Definition: EMM_CanonicalMassMatrix.cpp:45
#define tUSInt
Definition: types.h:28
#define tBoolean
Definition: types.h:139
SP::MATH_MaskVector mW
Definition: EMM_CanonicalMassMatrix.h:38
virtual void setSize(const tUIndex &nRows, const tUIndex &nCols)
set the size of the matrix
Definition: EMM_MassMatrix.h:110
virtual SP::MATH_Matrix NewInstance() const
return a share pointer to a new instance of this
Definition: EMM_CanonicalMassMatrix.h:65
virtual tReal symmetricDot(const tUSInt &incX, const tReal *x, const tUSInt &incY, const tReal *y) const
Definition: EMM_CanonicalMassMatrix.cpp:98
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: EMM_CanonicalMassMatrix.h:105
virtual tUIndex getColumnsNumber() const
get the columns number of the matrix
Definition: EMM_MassMatrix.h:204
static SP::EMM_CanonicalMassMatrix New()
create a mass matrix
Definition: EMM_CanonicalMassMatrix.h:72
This class impements the MATH_MaskMatrix whci deals with mask vector.
Definition: MATH_MaskMatrix.h:19
DEFINE_SPTR(EMM_CanonicalMassMatrix)
This interface class describes the mass matrix where is the Q1 function with is 1 on the point i an...
Definition: EMM_MassMatrix.h:23
SP::MATH_MaskVector mY
Definition: EMM_CanonicalMassMatrix.h:36
EMM_CanonicalMassMatrix(void)
create
Definition: EMM_CanonicalMassMatrix.cpp:12
tBoolean isSymmetric(const tReal &eps, const MATH_Vector &w) const
return true if the matrix is symmetric
Definition: MATH_Matrix.cpp:5
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: MATH_Matrix.h:68
virtual void setSize(const tUIndex &nRows, const tUIndex &nCols)
set the size of the matrix
Definition: EMM_CanonicalMassMatrix.h:113
#define tUIndex
Definition: types.h:126
This class describes a real array.
Definition: EMM_RealArray.h:16
This class describes a solver of Ax=b.
Definition: MATH_Solver.h:18
static SP::MATH_ArrayVector New()
return a share pointer of a vector based on CORE_RealArray
Definition: MATH_ArrayVector.h:45
#define tString
Definition: types.h:135
This class describes the mass matrix where is the P1 function with is 1 on the point i and 0 otherw...
Definition: EMM_CanonicalMassMatrix.h:24
SP_OBJECT(EMM_CanonicalMassMatrix)
virtual tUIndex getColumnsNumber() const
get the columns number of the matrix
Definition: EMM_CanonicalMassMatrix.h:93
#define tULLInt
Definition: types.h:45
virtual tBoolean isSymmetric() const
return true if the matrix is symmetric
Definition: EMM_CanonicalMassMatrix.h:121
This class describes a real field.
Definition: EMM_RealField.h:21
#define tReal
Definition: types.h:118
virtual void product(const tUIndex &n, const tReal &alpha, const tUSInt &incX, const tReal *x, const tReal &beta, const tUSInt &incY, tReal *y) const
y:=alpha. T . x + beta y where T is this
Definition: EMM_CanonicalMassMatrix.cpp:634
virtual tUIndex getRowsNumber() const
get the rows number of the matrix
Definition: EMM_MassMatrix.h:198
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141