76 return mValues[index];
83 return mValues[index];
178 tReal *vs=mValues[index];
180 if (v==0.) memset(vs,0,n*
sizeof(
tReal));
182 for (
tUSInt i=0;i<n;i++) {
195 const vector<tReal>& v) {
196 tReal *vs=mValues[index];
200 vector<tReal>::const_iterator iv=v.begin();
206 if (m<n) memset(vs,0,(n-m)*
sizeof(
tReal));
220 tReal *vs=mValues[index];
229 if (m<n) memset(vs,0,(n-m)*
sizeof(
tReal));
292 return (mValues.
getSize(i)==0);
298 return (mValues.
getSize(i)!=0);
CORE_RealMorseArray mValues
Definition: EMM_Tensors.h:34
EMM_Tensors()
create a tendor
Definition: EMM_Tensors.h:44
const CORE_UIndexArray & getIndices() const
get the indices of the morse array for reading
Definition: CORE_MorseArray.h:449
void copy(const CORE_MorseArray< Q > &c)
copy the morse array param c: the morse array to copy
Definition: CORE_MorseArray.h:308
CORE_RealMorseArray & getValues()
get the values as a morse array of the tensors
Definition: EMM_Tensors.h:276
void setUniformSize(const tUIndex &n, const tUIndex &ld)
set the morse array to be uniform of size n x ld
Definition: CORE_MorseArray.h:328
tBoolean saveToFile(const tString &fn) const
save the tensor into file
Definition: EMM_Tensors.h:314
#define tUInteger
Definition: types.h:91
virtual SP::EMM_Tensors NewInstance() const =0
create a new instance
virtual void setDimension(const tUSInt &dim)
set the dimension of the tensor
Definition: EMM_Tensors.h:120
SP::EMM_Tensors NewCopyInstance() const
create a new copy instance
Definition: EMM_Tensors.h:95
tBoolean loadFromFile(const tString &fn)
load the morse array from file
Definition: CORE_MorseArray.hpp:74
void init(const tUIndex &index, const vector< tReal > &v)
init the tensor at index to uniform value
Definition: EMM_Tensors.h:194
tBoolean loadFromFile(const tString &fn)
load the tensor from file
Definition: EMM_Tensors.h:331
tBoolean isNotNull(const tUIndex &i) const
Definition: EMM_Tensors.h:297
void reset()
init the array to 0
Definition: CORE_MorseArray.h:381
virtual void copy(const EMM_Tensors &tensors)
copy
Definition: EMM_Tensors.h:111
#define tUSInt
Definition: types.h:28
#define tBoolean
Definition: types.h:139
void setTensorsNumber(const tUIndex &n)
set the tensors number
Definition: EMM_Tensors.h:139
virtual tString toString() const
return the string representation of the class
Definition: EMM_Tensors.h:343
const tReal * operator[](const tUIndex &index) const
get the first tensor values at index in [0,getTensorsNumber()[ for reading only
Definition: EMM_Tensors.h:75
tBoolean saveToFile(const tString &fn) const
save the morse array into file
Definition: CORE_MorseArray.hpp:16
const tUSInt & getDimension() const
get the dimension of the tensor
Definition: EMM_Tensors.h:252
void setUniformTensorsNumber(const tUIndex &n)
set the tensors number : all the tensor are the same
Definition: EMM_Tensors.h:156
tString getIdentityString() const
return the identity string of the object of the form className_at_address
Definition: CORE_Object.h:241
tBoolean isUniform() const
return true if the morse array is unifom
Definition: CORE_MorseArray.h:518
void init(const tUIndex &index, const tUSInt &nv, const tReal *v)
init the tensor at index to uniform value
Definition: EMM_Tensors.h:217
virtual tString toString() const
return the string reprensetaion of the morse array
Definition: CORE_MorseArray.hpp:5
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: EMM_Tensors.h:246
const tUIndex & getSize() const
get the number of elements of the array
Definition: CORE_MorseArray.h:404
tUSInt mDimension
Definition: EMM_Tensors.h:33
tBoolean isUniform() const
Definition: EMM_Tensors.h:284
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: CORE_MorseArray.h:396
void init(const tUIndex &index, const tReal &v)
init the tensor at index to uniform value
Definition: EMM_Tensors.h:175
#define tUIndex
Definition: types.h:126
tBoolean isNull(const tUIndex &i) const
Definition: EMM_Tensors.h:291
virtual ~EMM_Tensors(void)
destroy
Definition: EMM_Tensors.h:58
virtual tUSInt getTensorSize() const =0
get the memory size of the storage of each tensor
abstract base class for most classes.
Definition: CORE_Object.h:53
#define tString
Definition: types.h:135
const tUIndex & getTensorsNumber() const
get the number of tensors
Definition: EMM_Tensors.h:263
const CORE_RealMorseArray & getValues() const
get the values as a morse array of the tensors
Definition: EMM_Tensors.h:270
void reset()
reset the values
Definition: EMM_Tensors.h:166
void setTensorsNumber(const tUIndex &n, const tUInteger &nPacks)
set the tensors number
Definition: EMM_Tensors.h:128
tReal * operator[](const tUIndex &index)
get the first tensor values at index in [0,getTensorsNumber()[ for reading only
Definition: EMM_Tensors.h:82
#define tULLInt
Definition: types.h:45
#define tReal
Definition: types.h:118
This class describes a morse array of tensors.
Definition: EMM_Tensors.h:20
void setSize(const tUIndex &n, const tUIndex &m, const tUInteger &p)
set the size of the morse array
Definition: CORE_MorseArray.h:342