C++ main module for emicrom Package  1.0
EMM_2PackedSymmetricTensors.h
Go to the documentation of this file.
1 #ifndef EMM_2PackedSymmetricTensors_H
2 #define EMM_2PackedSymmetricTensors_H
3 
4 #include "EMM_2Tensors.h"
5 
21 
22 
24 
25  // ATTRIBUTES
26 
27 
28 public:
29 
30 
31 private:
32 
33 
34 
35 public:
36  // METHODS
37 
38  // CONSTRUCTORS
39 
43 
44 
45 
46 
47 
48 
49  // DESTRUCTORS
50 
51 
54  virtual ~EMM_2PackedSymmetricTensors(void);
55 
56 public:
57 
58  // CONSTRUCTORS
59 
60 
61 
62 
63 public:
64 
65 
66  // CONSTRUCTORS
70  inline static SP::EMM_2PackedSymmetricTensors New() {
71  SP::EMM_2PackedSymmetricTensors ret(new EMM_2PackedSymmetricTensors(),
73  ret->setThis(ret);
74  return ret;
75  };
76 
80  virtual SP::EMM_Tensors NewInstance() const {
81  return New();
82  }
83 
84 public:
85  //OPERATORS
93  virtual const tReal& operator()(const tUIndex& index,const tUSInt& i,const tUSInt& j) const {
94  return (i>=j)?(*this)[index][j+i*(i+1)/2]:(*this)[index][i+j*(j+1)/2];
95  }
96 
104  virtual tReal& operator()(const tUIndex& index,const tUSInt& i,const tUSInt& j) {
105  return (i>=j)?(*this)[index][j+i*(i+1)/2]:(*this)[index][i+j*(j+1)/2];
106  }
107 
108  //SET methods
109 
110 protected:
111 
112 
113 public:
114 
115  /* \brief vector product H= sigma T . M
116  * compute the product of the tensor with a field
117  * @param ncells: number of cells
118  * @param dim: dim of the vector at each point of the field
119  * @param incS : increment of cell's weight sigma
120  * @param sigma: weight per cell
121  * @param M : value of the dim-vector per cell
122  * @param H: value of the return vector
123  */
124  void product(const tUIndex& nCells,const tUSInt& dim,
125  const tBoolean& incS,const tReal* sigmas,
126  const tReal *M,
127  tReal *H) const;
128 
129 
130 
131  // GET methods
132 public:
133 
134 
135 
136 
140  virtual tUSInt getTensorSize() const {
141  const tUSInt& dim=getDimension();
142  return (dim*(dim+1)/2);
143  }
144 
145 
146 
147 
148 
149 };
150 
151 #endif
virtual const tReal & operator()(const tUIndex &index, const tUSInt &i, const tUSInt &j) const
get the values at index i,j of the tensor at index
Definition: EMM_2PackedSymmetricTensors.h:93
virtual tUSInt getTensorSize() const
get thememory size of the storage of each tensor
Definition: EMM_2PackedSymmetricTensors.h:140
#define tUSInt
Definition: types.h:28
#define tBoolean
Definition: types.h:139
virtual SP::EMM_Tensors NewInstance() const
create a new instance
Definition: EMM_2PackedSymmetricTensors.h:80
static SP::EMM_2PackedSymmetricTensors New()
builds a full tensor
Definition: EMM_2PackedSymmetricTensors.h:70
virtual ~EMM_2PackedSymmetricTensors(void)
destroy
Definition: EMM_2PackedSymmetricTensors.cpp:13
const tUSInt & getDimension() const
get the dimension of the tensor
Definition: EMM_Tensors.h:252
This class describes a morse array of symmetric tensors of 2 order in packed form.
Definition: EMM_2PackedSymmetricTensors.h:20
EMM_2PackedSymmetricTensors()
create a 2 order tensor
Definition: EMM_2PackedSymmetricTensors.cpp:7
virtual tReal & operator()(const tUIndex &index, const tUSInt &i, const tUSInt &j)
get the values at index i,j of the tensor at index
Definition: EMM_2PackedSymmetricTensors.h:104
#define tUIndex
Definition: types.h:126
DEFINE_SPTR(EMM_2PackedSymmetricTensors)
This class describes a morse array of tensors of 2 order.
Definition: EMM_2Tensors.h:17
void product(const tUIndex &nCells, const tUSInt &dim, const tBoolean &incS, const tReal *sigmas, const tReal *M, tReal *H) const
Definition: EMM_2PackedSymmetricTensors.cpp:17
#define tReal
Definition: types.h:118
SP_OBJECT(EMM_2PackedSymmetricTensors)
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141