C++ mpi module for stochmagnet_main Package
Public Member Functions | Protected Member Functions | List of all members
CORE_Field< T, K, D, S, I > Class Template Reference

this class describes an field. A field is composed by More...

#include <CORE_Field.h>

Inheritance diagram for CORE_Field< T, K, D, S, I >:
Inheritance graph
[legend]
Collaboration diagram for CORE_Field< T, K, D, S, I >:
Collaboration graph
[legend]

Public Member Functions

virtual tMemSize getMemorySize () const override
 return the memory size of the class and the memory size of all its attributes/associations More...
 
virtual tMemSize getContentsMemorySize () const override
 return the memory size of the included associations More...
 
void setElementsNumber (const tInteger &n)
 set the number of element of the container More...
 
void fitToElementsNumber (const tInteger &n)
 set the number of element of the container without erasing values More...
 
tIndex getElementsNumber () const
 return the number values of the container More...
 
void setSize (const tIndex &n)
 set the number of values of the container More...
 
void resize (const tIndex &n)
 set the number of values of the container More...
 
tIndex getSize () const
 return the number values of the container More...
 
getDimension () const
 get the dimension of the field More...
 
const T & operator[] (const tIndex &i) const
 get the i-th value for reading. More...
 
T & operator[] (const tIndex &i)
 get the i-th value for writting. More...
 
const T & operator() (const tInteger &i, const K &d) const
 get the i-th element for reading. Do not verify the bounds More...
 
T & operator() (const tInteger &i, const K d)
 get the i-th element for writting. Do not verify the bounds More...
 
const T * operator() (const tInteger &i) const
 get the i-th element for reading. Do not verify the bounds More...
 
T * operator() (const tInteger &i)
 get the i-th element for writting. Do not verify the bounds More...
 
constexpr auto cbegin () const
 return begin iterator for reading More...
 
constexpr auto cend () const
 return end iterator for reading More...
 
auto begin ()
 return begin iterator for writing More...
 
auto end ()
 return end iterator for writing More...
 
auto rbegin ()
 return reverse begin iterator for writing More...
 
auto rend ()
 return reverse end iterator for writing More...
 
constexpr auto crbegin () const
 return reverse begin iterator for reading More...
 
constexpr auto crend () const
 return reverse end iterator for reading More...
 
auto sbegin ()
 return begin stride iterator for writing More...
 
auto send ()
 return end N-stride iterator for writing More...
 
constexpr auto csbegin () const
 return begin N-stride const iterator for writing More...
 
constexpr auto csend () const
 return end N-stride const iterator for writing More...
 
const T & get (const tIndex &i, const K &d) const
 get the d-th coordinate of the i-th element for reading More...
 
T & get (const tIndex &i, const K &d)
 get the d-th coordinate of the i-th element for writting More...
 
const T * getValues () const
 get the values of the array for reading More...
 
T * getValues ()
 get the values of the array More...
 
const S & getStorage () const
 get the storage More...
 
S & getStorage ()
 get the storage More...
 
Selfoperator= (const T &v)
 fill the values of the field with v More...
 
Selfoperator= (const std::initializer_list< T > &values)
 build an field by a copy of c More...
 
Selfoperator= (std::initializer_list< T > &&values)
 build an field by a copy of c More...
 
template<size_t N, typename Q >
Selfoperator= (const std::array< Q, N > &values)
 build an field by a copy of c More...
 
template<typename Q >
Selfoperator= (const std::array< Q, D > &values)
 build an field by a copy of c More...
 
template<typename Q >
Selfoperator= (const std::valarray< Q > &values)
 build an field by a copy of c More...
 
template<typename Q >
Selfoperator= (const std::vector< Q > &values)
 build an field by a copy of c More...
 
Selfoperator= (const Self &cpy)
 build a field by a copy of cpy More...
 
Selfoperator= (Self &&cpy)
 build an field by a copy of cpy More...
 
template<typename Q , class S1 , class I1 >
Selfoperator= (const CORE_Field< Q, K, D, S1, I1 > &cpy)
 build a field by a copy of cpy More...
 
template<typename Q , class S1 , class I1 >
Selfoperator= (CORE_Field< Q, K, D, S1, I1 > &&cpy)
 build an field by a copy of cpy More...
 
template<typename Q >
void copy (const tIndex &n, const Q *vs)
 initialize the field to the values of pointer of size n More...
 
template<typename Q , size_t N>
void copy (const std::array< Q, N > &vs)
 initialize the field at eche element with Vs More...
 
template<typename Q >
void copy (const std::array< Q, D > &vs)
 initialize the field to the values of array of size D More...
 
template<typename Q >
void copy (const std::valarray< Q > &vs)
 initialize the field to the values of val array More...
 
template<typename Q >
void copy (std::valarray< Q > &&vs)
 initialize the field to the values of val array More...
 
template<typename Q >
void copy (const std::vector< Q > &vs)
 initialize the field to the values of vector More...
 
void copy (const std::initializer_list< T > &vs)
 initialize the field to the values of list More...
 
void copy (std::initializer_list< T > &&vs)
 initialize the field to the values of list More...
 
template<typename Q , class S1 , class I1 >
void copy (const CORE_Field< Q, K, D, S1, I1 > &cpy)
 copy the the field More...
 
template<typename Q , class S1 , class I1 >
void copy (CORE_Field< Q, K, D, S1, I1 > &&cpy)
 copy the field : mv is destroyed after this More...
 
void initialize (const T &v)
 initialize the field to v More...
 
template<typename Q >
void initialize (const std::array< Q, D > &vs)
 initialize the field to the values of array of size D More...
 
void setUniformRandomizeSeed (const tULLInt &seed)
 set the uniform randomize seed More...
 
void setUniformRandomizeSeed ()
 set the uniform randomize seed
 
void uniformRandomize (const T &min, const T &max)
 randomize the field More...
 
Selfoperator+= (const T &v)
 add operator More...
 
Selfoperator-= (const T &v)
 sub operator More...
 
Selfoperator*= (const T &v)
 multiplicator operator More...
 
Selfoperator/= (const T &v)
 divisor operator More...
 
Selfoperator%= (const T &v) requires functions_type
 modulo operator More...
 
template<typename T1 , class S1 , class I1 >
Selfoperator-= (const CORE_Field< T1, K, D, S1, I1 > &v)
 array sub operator More...
 
template<typename T1 , class S1 , class I1 >
Selfoperator*= (const CORE_Field< T1, K, D, S1, I1 > &v)
 array multiply operator More...
 
template<typename T1 , class S1 , class I1 >
Selfoperator/= (const CORE_Field< T1, K, D, S1, I1 > &v)
 array divisor operator More...
 
template<typename LambdaFct >
void transform (LambdaFct &&F)
 transform the transform element with the lambda function Ti = F(Ti) More...
 
template<typename LambdaFct >
void transform (LambdaFct &&F, const Self &X)
 transform the transform element with the lambda function Ti = F(Xi) More...
 
template<typename LambdaFct >
void transform (LambdaFct &&F, const Self &X, const Self &Y)
 transform the transform element with the lambda function Ti = F(Xi,Yi) More...
 
template<typename LambdaFct >
void elementsTransform (LambdaFct &&F)
 apply the transform element with the lambda function Xid = F(Xid) More...
 
void swap (CORE_Array< T, I > &a)
 swap the contents of the array More...
 
void swap (CORE_Field< T, K, D, S, I > &a)
 swap the contents of the array More...
 
void normalize ()
 normalize all the elements of the field return false if the method is not compatible with the floating point type
 
template<typename Q , class S1 , class I1 >
void axpy (const Q &alpha, const CORE_Field< Q, K, D, S1, I1 > &X, const T &beta)
 compute This=beta.This+ alpha .X More...
 
tBoolean isNANContained () const
 return true if one value is Not A Number More...
 
template<class I1 >
void mod2 (CORE_Array< T, I1 > &X) const
 return the norm2 array per each element More...
 
tReal linfNorm (tIndex &i) const
 compute the L infinity norm More...
 
template<typename Q , class I1 >
tReal linfDistance (const CORE_Field< Q, K, D, S, I1 > &X, tIndex &i) const
 compute the Linfinitty norm More...
 
void sum (T &s) const
 return the sum of all the elements More...
 
void prod (T &p) const
 return the produc of all the elements More...
 
template<class Q , class S1 , class I1 >
T & scalarProduct (const CORE_Field< Q, K, D, S1, I1 > &X, T &s) const
 return the scalar product More...
 
template<class Q , class S1 , class I1 >
T & scalarProduct (const std::valarray< Q > &weights, const CORE_Field< Q, K, D, S1, I1 > &X, T &s) const
 return the scalar product More...
 
void min (T &m) const requires functions_type
 return the min value of all the elements More...
 
tBoolean loadFromFile (const tString &filename, tString &comment, tInt &retCode)
 load the field from a txt file with the format : More...
 
virtual tString toString () const override
 return the string representation of the object node More...
 
- Public Member Functions inherited from CORE_Collection< T, I >
void setSize (const tIndex &n)
 set the size of the container More...
 
tIndex getSize () const
 return the size of the container More...
 
void resize (const tIndex &n)
 modify the size of the array and keep its old values
 
const T & operator[] (const tIndex &i) const
 get the i-th element for reading. Do not verify the bounds More...
 
T & operator[] (const tIndex &i)
 get the i-th element for writting. Do not verify the bounds More...
 
constexpr auto cbegin () const
 return begin iterator for reading More...
 
constexpr auto cend () const
 return end iterator for reading More...
 
auto begin ()
 return begin iterator for writing More...
 
auto end ()
 return end iterator for writing More...
 
auto rbegin ()
 return reverse begin iterator for writing More...
 
auto rend ()
 return reverse end iterator for writing More...
 
constexpr auto crbegin () const
 return reverse begin iterator for reading More...
 
constexpr auto crend () const
 return reverse end iterator for reading More...
 
template<typename LambdaFct >
void transform (LambdaFct &&F)
 transform the transform element with the lambda function Ti = F(Ti) More...
 
tString getDataTypeName () const
 get the type of data More...
 
- Public Member Functions inherited from CORE_Object
template<class T >
std::shared_ptr< T > getSharedPointer ()
 return the shared pointer for this More...
 
template<class T >
std::shared_ptr< const T > getConstSharedPointer () const
 return a const shared pointer for this More...
 
template<class T >
tBoolean isInstanceOf () const
 test if the clas T is an instance of this class More...
 
tString getClassName () const
 return the name of the class More...
 
tString getPointerString () const
 retrun the pointer of the class as a string More...
 
tString getIdentityString () const
 retrun the string identification of the class More...
 

Protected Member Functions

 CORE_Field ()
 instanciation method of a class
 
virtual ~CORE_Field ()
 destroy an instance of class
 
- Protected Member Functions inherited from CORE_Collection< T, I >
 CORE_Collection ()
 build an array of T*
 
virtual ~CORE_Collection ()
 destroy an array of T*
 
- Protected Member Functions inherited from CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Additional Inherited Members

- Static Public Member Functions inherited from CORE_Object
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack
 
static void DisableMemoryStack ()
 disable the memory stack
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Detailed Description

template<typename T, typename K, K D, class S, class I>
class CORE_Field< T, K, D, S, I >

this class describes an field. A field is composed by

Template Parameters
T: type of element of this
K: type of dimension
D: dimension of each element of the array
S: implemented storage class
I: implemented class of this

I is an implemented class which implements the following polymorphic methods:

Member Function Documentation

◆ axpy()

template<typename T , typename K , K D, class S , class I >
template<typename Q , class S1 , class I1 >
void CORE_Field< T, K, D, S, I >::axpy ( const Q &  alpha,
const CORE_Field< Q, K, D, S1, I1 > &  X,
const T &  beta 
)
inline

compute This=beta.This+ alpha .X

Parameters
[in]alphaalpha parameter
[in]XX array
[in]beta: beta parameter

◆ begin()

template<typename T , typename K , K D, class S , class I >
auto CORE_Field< T, K, D, S, I >::begin ( )
inline

return begin iterator for writing

Returns
begin iterator

◆ cbegin()

template<typename T , typename K , K D, class S , class I >
constexpr auto CORE_Field< T, K, D, S, I >::cbegin ( ) const
inlineconstexpr

return begin iterator for reading

Returns
begin iterator

◆ cend()

template<typename T , typename K , K D, class S , class I >
constexpr auto CORE_Field< T, K, D, S, I >::cend ( ) const
inlineconstexpr

return end iterator for reading

Returns
end iterator

◆ copy() [1/10]

template<typename T , typename K , K D, class S , class I >
template<typename Q , class S1 , class I1 >
void CORE_Field< T, K, D, S, I >::copy ( const CORE_Field< Q, K, D, S1, I1 > &  cpy)
inline

copy the the field

Parameters
[in]cpy: field to copy

◆ copy() [2/10]

template<typename T , typename K , K D, class S , class I >
template<typename Q >
void CORE_Field< T, K, D, S, I >::copy ( const std::array< Q, D > &  vs)
inline

initialize the field to the values of array of size D

Parameters
[in]vs: values to copy

◆ copy() [3/10]

template<typename T , typename K , K D, class S , class I >
template<typename Q , size_t N>
void CORE_Field< T, K, D, S, I >::copy ( const std::array< Q, N > &  vs)
inline

initialize the field at eche element with Vs

Parameters
[in]vs: values to copy

◆ copy() [4/10]

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::copy ( const std::initializer_list< T > &  vs)
inline

initialize the field to the values of list

Parameters
[in]vs: values of the field

◆ copy() [5/10]

template<typename T , typename K , K D, class S , class I >
template<typename Q >
void CORE_Field< T, K, D, S, I >::copy ( const std::valarray< Q > &  vs)
inline

initialize the field to the values of val array

Parameters
[in]vs: values of the field

◆ copy() [6/10]

template<typename T , typename K , K D, class S , class I >
template<typename Q >
void CORE_Field< T, K, D, S, I >::copy ( const std::vector< Q > &  vs)
inline

initialize the field to the values of vector

Parameters
[in]vs: values of the field

◆ copy() [7/10]

template<typename T , typename K , K D, class S , class I >
template<typename Q >
void CORE_Field< T, K, D, S, I >::copy ( const tIndex &  n,
const Q *  vs 
)
inline

initialize the field to the values of pointer of size n

Parameters
[in]n: size of vs
[in]vs: values of the field

◆ copy() [8/10]

template<typename T , typename K , K D, class S , class I >
template<typename Q , class S1 , class I1 >
void CORE_Field< T, K, D, S, I >::copy ( CORE_Field< Q, K, D, S1, I1 > &&  cpy)
inline

copy the field : mv is destroyed after this

Parameters
[in]cpy:field to move

◆ copy() [9/10]

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::copy ( std::initializer_list< T > &&  vs)
inline

initialize the field to the values of list

Parameters
[in]vs: values of the field

◆ copy() [10/10]

template<typename T , typename K , K D, class S , class I >
template<typename Q >
void CORE_Field< T, K, D, S, I >::copy ( std::valarray< Q > &&  vs)
inline

initialize the field to the values of val array

Parameters
[in]vs: values of the field

◆ crbegin()

template<typename T , typename K , K D, class S , class I >
constexpr auto CORE_Field< T, K, D, S, I >::crbegin ( ) const
inlineconstexpr

return reverse begin iterator for reading

Returns
begin iterator

◆ crend()

template<typename T , typename K , K D, class S , class I >
constexpr auto CORE_Field< T, K, D, S, I >::crend ( ) const
inlineconstexpr

return reverse end iterator for reading

Returns
end iterator

◆ csbegin()

template<typename T , typename K , K D, class S , class I >
constexpr auto CORE_Field< T, K, D, S, I >::csbegin ( ) const
inlineconstexpr

return begin N-stride const iterator for writing

Returns
begin stride const iterator

◆ csend()

template<typename T , typename K , K D, class S , class I >
constexpr auto CORE_Field< T, K, D, S, I >::csend ( ) const
inlineconstexpr

return end N-stride const iterator for writing

Returns
end stride const iterator

◆ elementsTransform()

template<typename T , typename K , K D, class S , class I >
template<typename LambdaFct >
void CORE_Field< T, K, D, S, I >::elementsTransform ( LambdaFct &&  F)
inline

apply the transform element with the lambda function Xid = F(Xid)

Parameters
[in]F: lambda function with one variable

◆ end()

template<typename T , typename K , K D, class S , class I >
auto CORE_Field< T, K, D, S, I >::end ( )
inline

return end iterator for writing

Returns
end iterator

◆ fitToElementsNumber()

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::fitToElementsNumber ( const tInteger &  n)
inline

set the number of element of the container without erasing values

Parameters
[in]n: number of new elements of the container

◆ get() [1/2]

template<typename T , typename K , K D, class S , class I >
T& CORE_Field< T, K, D, S, I >::get ( const tIndex &  i,
const K &  d 
)
inline

get the d-th coordinate of the i-th element for writting

Parameters
[in]iindex of the element
[in]dd-coordinate of the element

◆ get() [2/2]

template<typename T , typename K , K D, class S , class I >
const T& CORE_Field< T, K, D, S, I >::get ( const tIndex &  i,
const K &  d 
) const
inline

get the d-th coordinate of the i-th element for reading

Parameters
[in]iindex of the element
[in]dd-coordinate of the element

◆ getContentsMemorySize()

template<typename T , typename K , K D, class S , class I >
virtual tMemSize CORE_Field< T, K, D, S, I >::getContentsMemorySize ( ) const
inlineoverridevirtual

return the memory size of the included associations

Returns
the memory size of the storage in bytes 1 Kb = 1024 bytes 1 Mb = 1024 Kb 1 Gb = 1024 Mb 1 Tb = 1024 Gb 1 Hb = 1024 Tb

Reimplemented from CORE_Object.

◆ getDimension()

template<typename T , typename K , K D, class S , class I >
K CORE_Field< T, K, D, S, I >::getDimension ( ) const
inline

get the dimension of the field

Returns
the diemension of the field

◆ getElementsNumber()

template<typename T , typename K , K D, class S , class I >
tIndex CORE_Field< T, K, D, S, I >::getElementsNumber ( ) const
inline

return the number values of the container

Returns
the number of values of the conatiner

◆ getMemorySize()

template<typename T , typename K , K D, class S , class I >
virtual tMemSize CORE_Field< T, K, D, S, I >::getMemorySize ( ) const
inlineoverridevirtual

return the memory size of the class and the memory size of all its attributes/associations

Returns
the memory size of the class and the memory size of its attributes/associations in bytes 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from CORE_Collection< T, I >.

Reimplemented in OMP_ValField< T, K, D >, OMP_PtrField< T, K, D >, CORE_StdValField< T, K, D >, CORE_StdPtrField< T, K, D >, SM_Field< T, K, D >, and SM_Field< tReal, tDimension, SM_Constants::DIM >.

◆ getSize()

template<typename T , typename K , K D, class S , class I >
tIndex CORE_Field< T, K, D, S, I >::getSize ( ) const
inline

return the number values of the container

Returns
the number of values of the conatiner

◆ getStorage() [1/2]

template<typename T , typename K , K D, class S , class I >
S& CORE_Field< T, K, D, S, I >::getStorage ( )
inline

get the storage

Returns
the storage of the field

◆ getStorage() [2/2]

template<typename T , typename K , K D, class S , class I >
const S& CORE_Field< T, K, D, S, I >::getStorage ( ) const
inline

get the storage

Returns
the storage of the field

◆ getValues() [1/2]

template<typename T , typename K , K D, class S , class I >
T* CORE_Field< T, K, D, S, I >::getValues ( )
inline

get the values of the array

Returns
the values of the array

◆ getValues() [2/2]

template<typename T , typename K , K D, class S , class I >
const T* CORE_Field< T, K, D, S, I >::getValues ( ) const
inline

get the values of the array for reading

Returns
the values of the array

◆ initialize() [1/2]

template<typename T , typename K , K D, class S , class I >
template<typename Q >
void CORE_Field< T, K, D, S, I >::initialize ( const std::array< Q, D > &  vs)
inline

initialize the field to the values of array of size D

Parameters
[in]vs: values to copy

◆ initialize() [2/2]

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::initialize ( const T &  v)
inline

initialize the field to v

Parameters
[in]v: constant value of the field

◆ isNANContained()

template<typename T , typename K , K D, class S , class I >
tBoolean CORE_Field< T, K, D, S, I >::isNANContained ( ) const
inline

return true if one value is Not A Number

Returns
false if all the values is a Number

◆ linfDistance()

template<typename T , typename K , K D, class S , class I >
template<typename Q , class I1 >
tReal CORE_Field< T, K, D, S, I >::linfDistance ( const CORE_Field< Q, K, D, S, I1 > &  X,
tIndex &  i 
) const
inline

compute the Linfinitty norm

Returns
the max of |T_i-X_i| and i

◆ linfNorm()

template<typename T , typename K , K D, class S , class I >
tReal CORE_Field< T, K, D, S, I >::linfNorm ( tIndex &  i) const
inline

compute the L infinity norm

Returns
the max of |T_i| and i

◆ loadFromFile()

template<typename T , typename K , K D, class S , class I >
tBoolean CORE_Field< T, K, D, S, I >::loadFromFile ( const tString &  filename,
tString &  comment,
tInt &  retCode 
)
inline

load the field from a txt file with the format :

comment 1

comment 2

N dim v[0] v[1].... V[dim*N-1]

Parameters
[in]filename: the file name to load the data
[out]comment: return the comment
[out]retCode: return code : 1 : the loading has succeeded 0 : the file is not big enough -1 : no size given -2 : bad size or dimension -3 : file does not exist
Returns
true of retCode = 1

◆ min()

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::min ( T &  m) const
inline

return the min value of all the elements

Parameters
[out]m: the returned min values of all the elements

return the max value of all the elements

Parameters
[out]m: the returned max values of all the elements

sort the element

Parameters
[in]order'i' or 'd'

sort the element

Parameters
[in]order'i' or 'd'
[in]kthe coordinates to sort

save the field into a txt file

Parameters
[in]fileNamethe file name to save the data
Returns
true if the file exists

The file format is as follow:

comments

N dim v[0] v[1] ..V[dim-1] v[dim].... ....V[dim*N-1]

save the field into a txt file

Parameters
[in]comments: without #
[in]filenamethe file name to save the data
[in]nDigits: precision for writing the data
Returns
true if the file exists

The file format is as follow:

comments

N dim v[0] v[1] ..V[dim-1] v[dim].... ....V[dim*N-1]

load the field from a txt file with the format :

comment 1

comment 2

N dim v[0] v[1].... V[dim*N-1]

Parameters
[in]fileName: the file name to load the data 0 : the file is not big enough -1 : no size given -2 : bad size or dimension -3 : file does not exist
Returns
true of retCode = 1

◆ mod2()

template<typename T , typename K , K D, class S , class I >
template<class I1 >
void CORE_Field< T, K, D, S, I >::mod2 ( CORE_Array< T, I1 > &  X) const
inline

return the norm2 array per each element

Parameters
[out]X: the vector to make the product X[i]=|Ti|^2

◆ operator%=()

template<typename T , typename K , K D, class S , class I >
Self& CORE_Field< T, K, D, S, I >::operator%= ( const T &  v)
inline

modulo operator

Parameters
[in]vmodulo value

and operator

Parameters
[in]vand value

or operator

Parameters
[in]vand value

complementary operator

Parameters
[in]vcomplementary value

left shift operator

Parameters
[in]vleft shift value

right shift operator

Parameters
[in]vleft shift value

array add operator

Parameters
[in]varray to multiply

◆ operator()() [1/4]

template<typename T , typename K , K D, class S , class I >
T* CORE_Field< T, K, D, S, I >::operator() ( const tInteger &  i)
inline

get the i-th element for writting. Do not verify the bounds

Parameters
[in]iindex of the element

◆ operator()() [2/4]

template<typename T , typename K , K D, class S , class I >
const T* CORE_Field< T, K, D, S, I >::operator() ( const tInteger &  i) const
inline

get the i-th element for reading. Do not verify the bounds

Parameters
[in]iindex of the element

◆ operator()() [3/4]

template<typename T , typename K , K D, class S , class I >
const T& CORE_Field< T, K, D, S, I >::operator() ( const tInteger &  i,
const K &  d 
) const
inline

get the i-th element for reading. Do not verify the bounds

Parameters
[in]iindex of the element
[in]d: index of the coordinate of the element

◆ operator()() [4/4]

template<typename T , typename K , K D, class S , class I >
T& CORE_Field< T, K, D, S, I >::operator() ( const tInteger &  i,
const K  d 
)
inline

get the i-th element for writting. Do not verify the bounds

Parameters
[in]iindex of the element
[in]d: index of the coordinate of the element

◆ operator*=() [1/2]

template<typename T , typename K , K D, class S , class I >
template<typename T1 , class S1 , class I1 >
Self& CORE_Field< T, K, D, S, I >::operator*= ( const CORE_Field< T1, K, D, S1, I1 > &  v)
inline

array multiply operator

Parameters
[in]varray to multiply

◆ operator*=() [2/2]

template<typename T , typename K , K D, class S , class I >
Self& CORE_Field< T, K, D, S, I >::operator*= ( const T &  v)
inline

multiplicator operator

Parameters
[in]vmultiplicator value

◆ operator+=()

template<typename T , typename K , K D, class S , class I >
Self& CORE_Field< T, K, D, S, I >::operator+= ( const T &  v)
inline

add operator

Parameters
[in]v: add value

◆ operator-=() [1/2]

template<typename T , typename K , K D, class S , class I >
template<typename T1 , class S1 , class I1 >
Self& CORE_Field< T, K, D, S, I >::operator-= ( const CORE_Field< T1, K, D, S1, I1 > &  v)
inline

array sub operator

Parameters
[in]varray to multiply

◆ operator-=() [2/2]

template<typename T , typename K , K D, class S , class I >
Self& CORE_Field< T, K, D, S, I >::operator-= ( const T &  v)
inline

sub operator

Parameters
[in]v: sub value

◆ operator/=() [1/2]

template<typename T , typename K , K D, class S , class I >
template<typename T1 , class S1 , class I1 >
Self& CORE_Field< T, K, D, S, I >::operator/= ( const CORE_Field< T1, K, D, S1, I1 > &  v)
inline

array divisor operator

Parameters
[in]varray to multiply

◆ operator/=() [2/2]

template<typename T , typename K , K D, class S , class I >
Self& CORE_Field< T, K, D, S, I >::operator/= ( const T &  v)
inline

divisor operator

Parameters
[in]vdivisor value

◆ operator=() [1/11]

template<typename T , typename K , K D, class S , class I >
template<typename Q , class S1 , class I1 >
Self& CORE_Field< T, K, D, S, I >::operator= ( const CORE_Field< Q, K, D, S1, I1 > &  cpy)
inline

build a field by a copy of cpy

Parameters
[in]cpy: field to copy

◆ operator=() [2/11]

template<typename T , typename K , K D, class S , class I >
Self& CORE_Field< T, K, D, S, I >::operator= ( const Self cpy)
inline

build a field by a copy of cpy

Parameters
[in]cpy: field to copy

◆ operator=() [3/11]

template<typename T , typename K , K D, class S , class I >
template<typename Q >
Self& CORE_Field< T, K, D, S, I >::operator= ( const std::array< Q, D > &  values)
inline

build an field by a copy of c

Parameters
[in]valuesvalues to copy

◆ operator=() [4/11]

template<typename T , typename K , K D, class S , class I >
template<size_t N, typename Q >
Self& CORE_Field< T, K, D, S, I >::operator= ( const std::array< Q, N > &  values)
inline

build an field by a copy of c

Parameters
[in]valuesvalues to copy

◆ operator=() [5/11]

template<typename T , typename K , K D, class S , class I >
Self& CORE_Field< T, K, D, S, I >::operator= ( const std::initializer_list< T > &  values)
inline

build an field by a copy of c

Parameters
[in]valuesvalues to copy

◆ operator=() [6/11]

template<typename T , typename K , K D, class S , class I >
template<typename Q >
Self& CORE_Field< T, K, D, S, I >::operator= ( const std::valarray< Q > &  values)
inline

build an field by a copy of c

Parameters
[in]valuesvalues to copy

◆ operator=() [7/11]

template<typename T , typename K , K D, class S , class I >
template<typename Q >
Self& CORE_Field< T, K, D, S, I >::operator= ( const std::vector< Q > &  values)
inline

build an field by a copy of c

Parameters
[in]valuesvalues to copy

◆ operator=() [8/11]

template<typename T , typename K , K D, class S , class I >
Self& CORE_Field< T, K, D, S, I >::operator= ( const T &  v)
inline

fill the values of the field with v

Parameters
[in]v: value to fill

◆ operator=() [9/11]

template<typename T , typename K , K D, class S , class I >
template<typename Q , class S1 , class I1 >
Self& CORE_Field< T, K, D, S, I >::operator= ( CORE_Field< Q, K, D, S1, I1 > &&  cpy)
inline

build an field by a copy of cpy

Parameters
[in]cpy: field to copy

◆ operator=() [10/11]

template<typename T , typename K , K D, class S , class I >
Self& CORE_Field< T, K, D, S, I >::operator= ( Self &&  cpy)
inline

build an field by a copy of cpy

Parameters
[in]cpy: field to copy

◆ operator=() [11/11]

template<typename T , typename K , K D, class S , class I >
Self& CORE_Field< T, K, D, S, I >::operator= ( std::initializer_list< T > &&  values)
inline

build an field by a copy of c

Parameters
[in]valuesvalues to copy

◆ operator[]() [1/2]

template<typename T , typename K , K D, class S , class I >
T& CORE_Field< T, K, D, S, I >::operator[] ( const tIndex &  i)
inline

get the i-th value for writting.

Parameters
[in]iindex of the value

◆ operator[]() [2/2]

template<typename T , typename K , K D, class S , class I >
const T& CORE_Field< T, K, D, S, I >::operator[] ( const tIndex &  i) const
inline

get the i-th value for reading.

Parameters
[in]iindex of the value

◆ prod()

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::prod ( T &  p) const
inline

return the produc of all the elements

Parameters
[out]pthe returned values of the product of all the elements

◆ rbegin()

template<typename T , typename K , K D, class S , class I >
auto CORE_Field< T, K, D, S, I >::rbegin ( )
inline

return reverse begin iterator for writing

Returns
begin iterator

◆ rend()

template<typename T , typename K , K D, class S , class I >
auto CORE_Field< T, K, D, S, I >::rend ( )
inline

return reverse end iterator for writing

Returns
end iterator

◆ resize()

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::resize ( const tIndex &  n)
inline

set the number of values of the container

Parameters
[in]n: number of values of the container

◆ sbegin()

template<typename T , typename K , K D, class S , class I >
auto CORE_Field< T, K, D, S, I >::sbegin ( )
inline

return begin stride iterator for writing

Returns
begin stride iterator

◆ scalarProduct() [1/2]

template<typename T , typename K , K D, class S , class I >
template<class Q , class S1 , class I1 >
T& CORE_Field< T, K, D, S, I >::scalarProduct ( const CORE_Field< Q, K, D, S1, I1 > &  X,
T &  s 
) const
inline

return the scalar product

Parameters
[in]X: argument vector
[out]s: the scalar product
Returns
the value of \( s=<T,X>=\sum_{i=0}^{N-1} T_i.A_i \)

◆ scalarProduct() [2/2]

template<typename T , typename K , K D, class S , class I >
template<class Q , class S1 , class I1 >
T& CORE_Field< T, K, D, S, I >::scalarProduct ( const std::valarray< Q > &  weights,
const CORE_Field< Q, K, D, S1, I1 > &  X,
T &  s 
) const
inline

return the scalar product

Parameters
[in]weights: weight of each element
[in]X: argument field
[out]s: the scalar product
Returns
the value of \( <s=T,X>=\sum_{i=0}^{N-1} w_i \sum_{d=0}^{d=D-1} T^i_d.A^i_d \)

◆ send()

template<typename T , typename K , K D, class S , class I >
auto CORE_Field< T, K, D, S, I >::send ( )
inline

return end N-stride iterator for writing

Returns
end stride iterator

◆ setElementsNumber()

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::setElementsNumber ( const tInteger &  n)
inline

set the number of element of the container

Parameters
[in]n: number of elements of the container

◆ setSize()

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::setSize ( const tIndex &  n)
inline

set the number of values of the container

Parameters
[in]n: number of values of the container

◆ setUniformRandomizeSeed()

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::setUniformRandomizeSeed ( const tULLInt &  seed)
inline

set the uniform randomize seed

Parameters
[in]seed: seed;

◆ sum()

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::sum ( T &  s) const
inline

return the sum of all the elements

Parameters
[out]sthe returned values of the sum of all the elements

◆ swap() [1/2]

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::swap ( CORE_Array< T, I > &  a)
inline

swap the contents of the array

Parameters
[in]athe array with witch the contents is swap

◆ swap() [2/2]

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::swap ( CORE_Field< T, K, D, S, I > &  a)
inline

swap the contents of the array

Parameters
[in]athe array with witch the contents is swap

◆ toString()

template<typename T , typename K , K D, class S , class I >
virtual tString CORE_Field< T, K, D, S, I >::toString ( ) const
inlineoverridevirtual

return the string representation of the object node

Returns
the string representation of the object node

Reimplemented from CORE_Collection< T, I >.

◆ transform() [1/3]

template<typename T , typename K , K D, class S , class I >
template<typename LambdaFct >
void CORE_Field< T, K, D, S, I >::transform ( LambdaFct &&  F)
inline

transform the transform element with the lambda function Ti = F(Ti)

Parameters
[in]F: lambda function with one variable

◆ transform() [2/3]

template<typename T , typename K , K D, class S , class I >
template<typename LambdaFct >
void CORE_Field< T, K, D, S, I >::transform ( LambdaFct &&  F,
const Self X 
)
inline

transform the transform element with the lambda function Ti = F(Xi)

Parameters
[in]F: lambda function with one variable
[in]X: argument of F

◆ transform() [3/3]

template<typename T , typename K , K D, class S , class I >
template<typename LambdaFct >
void CORE_Field< T, K, D, S, I >::transform ( LambdaFct &&  F,
const Self X,
const Self Y 
)
inline

transform the transform element with the lambda function Ti = F(Xi,Yi)

Parameters
[in]F: lambda function with one variable
[in]X: first argument of F
[in]Y: second argument of F

◆ uniformRandomize()

template<typename T , typename K , K D, class S , class I >
void CORE_Field< T, K, D, S, I >::uniformRandomize ( const T &  min,
const T &  max 
)
inline

randomize the field

Parameters
[in]min: min value of the random generation
[in]max: max value of the random generation

The documentation for this class was generated from the following file: