26 #ifndef __Tensor3D3x3x3_hh__
27 #define __Tensor3D3x3x3_hh__
29 #include "Tensor3D.hh"
30 #include "Matrix3x3.hh"
39 template <
class T=
double>
46 void NewSize(
const int i,
const int j,
const int k,
48 void newsize(
const int i,
const int j,
const int k,
54 inline void LeftContravariantContraction1(
Vector3<T>& v,
56 inline void LeftContravariantContraction2(
Vector3<T>& v,
58 inline void LeftContravariantContraction3(
Vector3<T>& v,
63 LeftContravariantContraction1(v,M);
70 LeftContravariantContraction2(v,M);
77 LeftContravariantContraction3(v,M);
133 size_t size=9*
sizeof(T);
134 memcpy((
void *)this->_Data, (
void *)T1.
GetData(), size);
135 memcpy((
void *)(this->_Data+9), (
void *)T2.
GetData(), size);
136 memcpy((
void *)(this->_Data+18), (
void *)T3.
GetData(), size);
143 size_t size=9*
sizeof(T);
144 memcpy((
void *)T1.
GetData(), (
void *)this->_Data, size);
145 memcpy((
void *)T2.
GetData(), (
void *)(this->_Data+9), size);
146 memcpy((
void *)T3.
GetData(), (
void *)(this->_Data+18), size);
159 GetMatrices(res, T2, T3);
172 for(
int i=0; i<3; i++)
173 for(
int j=0; j<3; j++)
174 for(
int k=0; k<3; k++)
175 res[i][k] += v[j] * this->_DataArray[i][j][k];
183 for(
int i=0; i<3; i++)
184 for(
int j=0; j<3; j++)
185 for(
int k=0; k<3; k++)
186 res[i][j] += v[k] * this->_DataArray[i][j][k];
194 #endif // __Tensor3D3x3x3_hh__
Tensor3D< T > & operator=(const Tensor3D< T > &t)
Tensor3D3x3x3< T > & operator=(const Tensor3D3x3x3< T > &t)
void LeftContravariantContraction1(Vector3< T > &v, Matrix3x3< T > &res)
computes the contraction of index 1 from left with contravariant vector , i.e.
void LeftContravariantContraction3(Vector3< T > &v, Matrix3x3< T > &res)
Matrix3x3< T > LeftContravariantContraction2(Vector3< T > &v)
Matrix3x3< T > LeftContravariantContraction3(Vector3< T > &v)
is a 'fixed size' quadratic matrix of dim.
class Vector3 contains a Vector of fixed dim.
void LeftContravariantContraction2(Vector3< T > &v, Matrix3x3< T > &res)
void GetMatrices(Matrix3x3< T > &T1, Matrix3x3< T > &T2, Matrix3x3< T > &T3) const
void SetFromMatrices(const Matrix3x3< T > &T1, const Matrix3x3< T > &T2, const Matrix3x3< T > &T3)
implementation
Matrix3x3< T > LeftContravariantContraction1(Vector3< T > &v)