C++ main module for emicrom Package  1.0
EMM_4Tensors.h
Go to the documentation of this file.
1 #ifndef EMM_4Tensors_H
2 #define EMM_4Tensors_H
3 
4 #include "EMM_Tensors.h"
5 
7 
19 class EMM_4Tensors : public EMM_Tensors {
20 
21 
23 
24  // ATTRIBUTES
25 
26 
27 public:
28 
29 
30 private:
31 
32 
33 
34 public:
35  // METHODS
36 
37  // CONSTRUCTORS
38 
41  EMM_4Tensors();
42 
43 
44 
45 
46 
47 
48  // DESTRUCTORS
49 
50 
53  virtual ~EMM_4Tensors(void);
54 
55 public:
56 
57  // CONSTRUCTORS
58 
59 
60 
61 
62 public:
63 
64 
65  // CONSTRUCTORS
69  inline static SP::EMM_4Tensors New() {
70  SP::EMM_4Tensors ret(new EMM_4Tensors(),
72  ret->setThis(ret);
73  return ret;
74  };
75 
79  virtual SP::EMM_Tensors NewInstance() const {
80  return New();
81  }
82 
83 public:
84  //OPERATORS
94  virtual const tReal& operator()(const tUIndex& index,const tUSInt& p,const tUSInt& q,const tUSInt& r,const tUSInt& s) const {
95  return (*this)[index][getIndex(p,q,r,s,getDimension())];
96  }
97 
107  virtual tReal& operator()(const tUIndex& index,const tUSInt& p,const tUSInt& q,const tUSInt& r,const tUSInt& s) {
108  return (*this)[index][getIndex(p,q,r,s,getDimension())];
109  }
110 
111  //SET methods
112 
113 protected:
114 
115 
116 public:
117 
126  inline void setValue(const tUIndex& index,
127  const tUSInt& i,
128  const tUSInt& j,
129  const tUSInt& k,
130  const tUSInt& l,
131  const tReal& v) {
132  (*this)(index,i,j,k,l)=v;
133  }
134 
135 
136  // GET methods
137 public:
145  inline const tReal& getValue(const tUIndex& index,
146  const tUSInt& i,
147  const tUSInt& j,
148  const tUSInt& k,
149  const tUSInt& l) const {
150  return (*this)(index,i,j,k,l);
151  }
152 
153 
154 
158  virtual tUSInt getTensorSize() const {
159  tUSInt n=1;
160  const tUSInt& dim=getDimension();
161  for (tUSInt k=0;k<4;k++) n*=dim;
162  return n;
163  }
164 
173  inline virtual tUSInt getIndex(const tUSInt& p,const tUSInt& q,const tUSInt& r,const tUSInt& s,const tUSInt& dim) const {
174  return s+dim*(r+dim*(q+dim*p));
175  }
176 
177  //ALGEBRIC Methods
178  //=================
179 
180 
181  //vector methods
182  //===============
183 
200  virtual void doubleDotCrossProduct(const tUIndex& n,
201  const tUSInt& dim,
202  const tReal& beta,
203  const tUSInt& m,
204  const tBoolean& incS,
205  const tReal* S,
206  const tBoolean& incU,
207  const tReal *U,
208  const tBoolean& incV,
209  const tReal *V,
210  const tBoolean& incW,
211  const tReal *W,
212  const tReal& alpha,
213  tReal *Z) const;
214 
228  virtual void doubleDotProduct(const tUIndex& n,
229  const tUSInt& dim,
230  const tReal& beta,
231  const tUSInt& m,
232  const tBoolean& incS,
233  const tReal* S,
234  const EMM_2PackedSymmetricTensors& phi,
235  const tBoolean& incU,
236  const tReal *U,
237  const tReal& alpha,
238  tReal *Z) const;
239 
240  //scalar methods
241  //==============
242 
249  const EMM_2PackedSymmetricTensors& phi) const;
250 
265  const tUSInt& dim,
266  const tUSInt& p,
267  const tBoolean& incS,
268  const tReal* S,
269  const tBoolean& incU,
270  const tReal *U,
271  const tBoolean& incV,
272  const tReal *V,
273  const EMM_2PackedSymmetricTensors& phi) const;
274 
288  virtual tReal squaredDoubleDotCrossScalar(const tUIndex& n,
289  const tUSInt& dim,
290  const tUSInt& p,
291  const tBoolean& incS,
292  const tReal* S,
293  const EMM_2PackedSymmetricTensors& phi,
294  const tBoolean& incU,
295  const tReal *U,
296  const tBoolean& incV,
297  const tReal *V) const;
298 
315  virtual tReal doubleDotCrossSquaredScalar(const tUIndex& n,
316  const tUSInt& dim,
317  const tUSInt& p,
318  const tBoolean& incS,
319  const tReal* S,
320  const tBoolean& incU,
321  const tReal *U,
322  const tBoolean& incV,
323  const tReal *V,
324  const tBoolean& incW,
325  const tReal *W,
326  const tBoolean& incZ,
327  const tReal *Z) const;
328 
329 
330 };
331 
332 #endif
virtual ~EMM_4Tensors(void)
destroy
Definition: EMM_4Tensors.cpp:14
SP_OBJECT(EMM_4Tensors)
virtual SP::EMM_Tensors NewInstance() const
create a new instance
Definition: EMM_4Tensors.h:79
virtual const tReal & operator()(const tUIndex &index, const tUSInt &p, const tUSInt &q, const tUSInt &r, const tUSInt &s) const
get the values at index p,q,r,s of the tensor at index
Definition: EMM_4Tensors.h:94
virtual void doubleDotProduct(const tUIndex &n, const tUSInt &dim, const tReal &beta, const tUSInt &m, const tBoolean &incS, const tReal *S, const EMM_2PackedSymmetricTensors &phi, const tBoolean &incU, const tReal *U, const tReal &alpha, tReal *Z) const
compute the vector Z=alpha.Z+beta. S^m (T:phi) U
Definition: EMM_4Tensors.cpp:197
virtual tReal doubleDotCrossSquaredScalar(const tUIndex &n, const tUSInt &dim, const tUSInt &p, const tBoolean &incS, const tReal *S, const tBoolean &incU, const tReal *U, const tBoolean &incV, const tReal *V, const tBoolean &incW, const tReal *W, const tBoolean &incZ, const tReal *Z) const
compute the scalar where T is this 4 tensor
Definition: EMM_4Tensors.cpp:1056
void setValue(const tUIndex &index, const tUSInt &i, const tUSInt &j, const tUSInt &k, const tUSInt &l, const tReal &v)
set the value of the tensor at index and at coordinates i,j,k,l to v
Definition: EMM_4Tensors.h:126
static SP::EMM_4Tensors New()
builds a full tensor
Definition: EMM_4Tensors.h:69
#define tUSInt
Definition: types.h:28
#define tBoolean
Definition: types.h:139
virtual tReal doubleDotCrossDoubleDotScalar(const tUIndex &n, const tUSInt &dim, const tUSInt &p, const tBoolean &incS, const tReal *S, const tBoolean &incU, const tReal *U, const tBoolean &incV, const tReal *V, const EMM_2PackedSymmetricTensors &phi) const
compute the scalar where T is this 4 tensor
Definition: EMM_4Tensors.cpp:641
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_4Tensors()
create a 4 order tensor
Definition: EMM_4Tensors.cpp:8
const tReal & getValue(const tUIndex &index, const tUSInt &i, const tUSInt &j, const tUSInt &k, const tUSInt &l) const
get the value of the tensor at index and at coordinates i,j,k,l
Definition: EMM_4Tensors.h:145
virtual tUSInt getIndex(const tUSInt &p, const tUSInt &q, const tUSInt &r, const tUSInt &s, const tUSInt &dim) const
get the index of element (p,q,r,s)
Definition: EMM_4Tensors.h:173
#define tUIndex
Definition: types.h:126
virtual tUSInt getTensorSize() const
get thememory size of the storage of each tensor
Definition: EMM_4Tensors.h:158
virtual void doubleDotCrossProduct(const tUIndex &n, const tUSInt &dim, const tReal &beta, const tUSInt &m, const tBoolean &incS, const tReal *S, const tBoolean &incU, const tReal *U, const tBoolean &incV, const tReal *V, const tBoolean &incW, const tReal *W, const tReal &alpha, tReal *Z) const
compute the vector Z=alpha.Z+beta. S^m . (T:UxV)W
Definition: EMM_4Tensors.cpp:21
virtual tReal squaredDoubleDotCrossScalar(const tUIndex &n, const tUSInt &dim, const tUSInt &p, const tBoolean &incS, const tReal *S, const EMM_2PackedSymmetricTensors &phi, const tBoolean &incU, const tReal *U, const tBoolean &incV, const tReal *V) const
compute the scalar where T is this 4 tensor
Definition: EMM_4Tensors.cpp:870
virtual tReal & operator()(const tUIndex &index, const tUSInt &p, const tUSInt &q, const tUSInt &r, const tUSInt &s)
get the values at index p,q,r,s of the tensor at index
Definition: EMM_4Tensors.h:107
virtual tReal squaredDoubleDotScalar(const EMM_2PackedSymmetricTensors &psi, const EMM_2PackedSymmetricTensors &phi) const
compute the scalar
Definition: EMM_4Tensors.cpp:390
This class describes a morse array of tensors of 4 order.
Definition: EMM_4Tensors.h:19
DEFINE_SPTR(EMM_4Tensors)
#define tReal
Definition: types.h:118
This class describes a morse array of tensors.
Definition: EMM_Tensors.h:20
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141