C++ main module for stochmagnet Package  1.0
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
SM_Field< T, K > Class Template Reference

This class describes a field with a floating point type. More...

#include <SM_Field.h>

Inheritance diagram for SM_Field< T, K >:
Inheritance graph
[legend]
Collaboration diagram for SM_Field< T, K >:
Collaboration graph
[legend]

Public Member Functions

 SM_Field ()
 create a field of dim 3 and size 1 More...
 
 SM_Field (std::initializer_list< T > &&values)
 create a field of dim 3 and size values.size()/3 initialized with values list values More...
 
virtual ~SM_Field (void)
 destroy the interface More...
 
virtual tMemSize getMemorySize () const
 return the memory size of the class and the memory size of all its attributes/associations More...
 
Selfoperator= (const T &v)
 copy operator More...
 
Selfoperator= (const std::initializer_list< T > &cpy)
 copy operator More...
 
Selfoperator= (std::initializer_list< T > &&cpy)
 copy operator More...
 
Selfoperator= (const std::valarray< T > &cpy)
 copy operator More...
 
Selfoperator= (const Self &cpy)
 copy operator More...
 
Selfoperator= (Self &&cpy)
 copy operator More...
 
template<class R >
requires core_functions::isRealType< R > void addStochasticNoise (const R &epsilon, SM_StochasticFunction &f)
 add a stochastic noise the the field More...
 
template<class R , class I >
void addTemplatedStochasticNoise (const R &epsilon, SM_TemplatedStochasticFunction< I > &f)
 add a stochastic noise the the field More...
 
void initialize (const Q &v)
 initailize all the values with v More...
 
void initialize (const std::array< Q, D > &a)
 copy at element element the array of size D More...
 
void initialize (const T &v)
 initialize the field to v More...
 
tBoolean setSharedValues (const tIndex &capacity, const tIndex &size, Q *values)
 set shared values with the capacity and size More...
 
tBoolean setSharedValues (const tIndex &capacity, Q *values)
 set shared values with the capacity and size More...
 
tBoolean setSharedValues (CORE_PtrArray< Q, I1 > &array)
 set shared values with the capacity and size More...
 
Selfoperator+= (const T &v)
 add operator More...
 
Selfoperator-= (const T &v)
 sub operator More...
 
Selfoperator-= (const CORE_Field< Q, K, D, S, I > &X)
 array sub operator More...
 
Selfoperator-= (const CORE_Field< T1, K, D, S1, I1 > &v)
 array sub operator More...
 
Selfoperator*= (const T &v)
 multiplicator operator More...
 
Selfoperator*= (const CORE_Field< Q, K, D, S, I > &X)
 array multiply operator More...
 
Selfoperator*= (const CORE_Field< T1, K, D, S1, I1 > &v)
 array multiply operator More...
 
Selfoperator/= (const T &v)
 divisor operator More...
 
Selfoperator/= (const CORE_Field< Q, K, D, S, I > &X)
 array divisor operator More...
 
Selfoperator/= (const CORE_Field< T1, K, D, S1, I1 > &v)
 array divisor operator More...
 
Selfoperator%= (const T &v) requires core_functions
 modulo operator More...
 
void elementsTransform (LambdaFct &&F)
 apply the transform element with the lambda function Xid = F(Xid) More...
 
void normalize ()
 normalize all the elements of the field return false if the method is not compatible with the floating point type More...
 
void mod2 (CORE_Array< T, I > &X) const
 return the norm2 array per each element More...
 
void mod2 (CORE_Array< T, I1 > &X) const
 return the norm2 array per exch element More...
 
T & scalarProduct (const std::valarray< Q > &weights, const CORE_Field< Q, K, D, S1, I1 > &X, T &s) const
 return the scalar product More...
 
T & scalarProduct (const CORE_Field< Q, K, D, S1, I1 > &X, T &s) const
 return the scalar product 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...
 
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...
 
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 CORE_StdPtrArray< T > & getStorage () const
 get the storage More...
 
CORE_StdPtrArray< T > & getStorage ()
 get the storage More...
 
void copy (const tIndex &n, const Q *vs)
 initialize the field to the values of pointer of size n More...
 
void copy (const std::array< Q, N > &vs)
 initialize the field at eche element with Vs More...
 
void copy (const std::array< Q, D > &vs)
 initialize the field to the values of array of size D More...
 
void copy (const std::valarray< Q > &vs)
 initialize the field to the values of val array More...
 
void copy (std::valarray< Q > &&vs)
 initialize the field to the values of val array More...
 
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...
 
void copy (const CORE_Field< Q, K, D, S1, I1 > &cpy)
 copy the the field More...
 
void copy (CORE_Field< Q, K, D, S1, I1 > &&cpy)
 copy the field : mv is destroyed after this More...
 
void uniformRandomize (const T &min, const T &max)
 randomize the field More...
 
void transform (LambdaFct &&F)
 transform the transform element with the lambda function Ti = F(Ti) More...
 
void transform (LambdaFct &&F, const Self &X)
 transform the transform element with the lambda function Ti = F(Xi) More...
 
void transform (LambdaFct &&F, const Self &X, const Self &Y)
 transform the transform element with the lambda function Ti = F(Xi,Yi) More...
 
void swap (CORE_Array< T, CORE_StdPtrField< T, K, D > > &a)
 swap the contents of the array More...
 
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...
 
tReal linfNorm (tIndex &i) const
 compute the L infinity norm More...
 
tReal linfDistance (const CORE_Field< Q, K, D, CORE_StdPtrArray< T >, 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...
 
void min (T &m) const requires core_functions
 return the min value of all the elements More...
 
virtual tString toString () const override
 return the string representation of the object node More...
 
void resize (const tIndex &n)
 modify the size of the array and keep its old values More...
 
tString getDataTypeName () const
 get the type of data More...
 
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...
 

Static Public Member Functions

static CORE_UniquePointer< SelfNew ()
 build a new instance of a SM_Field More...
 
static void ElementsTransform (LambdaFct &&F, Self &X)
 apply the transform element with the lambda function Ri = F(Xi) More...
 
static void Normalize (const tIndex &n, T *values)
 normalize all the elements of the field More...
 
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack More...
 
static void DisableMemoryStack ()
 disable the memory stack More...
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled More...
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Private Types

typedef SM_Field< T, K > Self
 

Private Member Functions

template<class T >
std::shared_ptr< T > setThis (std::unique_ptr< T, CORE_Object::Delete > &up)
 set the shared pointer from an unique pointer More...
 

Private Attributes

CORE_StdPtrArray< T > mStorage
 
std::weak_ptr< CORE_ObjectmThis
 

Detailed Description

template<typename T, typename K>
class SM_Field< T, K >

This class describes a field with a floating point type.

A real field as a size of N (SM_Field::setSize()) and a dimension dim (SM_Field::setDimension()). So the size of the allocated array is N x dim.

Author
Stephane Despreaux
Version
1.0

Member Typedef Documentation

◆ Self

template<typename T , typename K >
typedef SM_Field<T,K> SM_Field< T, K >::Self
private

Constructor & Destructor Documentation

◆ SM_Field() [1/2]

template<typename T , typename K >
SM_Field< T, K >::SM_Field ( )
inline

create a field of dim 3 and size 1

◆ SM_Field() [2/2]

template<typename T , typename K >
SM_Field< T, K >::SM_Field ( std::initializer_list< T > &&  values)
inline

create a field of dim 3 and size values.size()/3 initialized with values list values

Parameters
[in]values:values of the field

References CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >::copy().

Here is the call graph for this function:

◆ ~SM_Field()

template<typename T , typename K >
virtual SM_Field< T, K >::~SM_Field ( void  )
inlinevirtual

destroy the interface

Member Function Documentation

◆ addStochasticNoise()

template<typename T , typename K >
template<class R >
requires core_functions::isRealType<R> void SM_Field< T, K >::addStochasticNoise ( const R &  epsilon,
SM_StochasticFunction f 
)
inline

add a stochastic noise the the field

Parameters
[in]epsilon: the amplitude of the noise
[in]fthe stochastic noise simulator This+=epsilon * f.random()

References CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >::getSize(), CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >::getValues(), and SM_StochasticFunction::random().

Here is the call graph for this function:

◆ addTemplatedStochasticNoise()

template<typename T , typename K >
template<class R , class I >
void SM_Field< T, K >::addTemplatedStochasticNoise ( const R &  epsilon,
SM_TemplatedStochasticFunction< I > &  f 
)
inline

add a stochastic noise the the field

Parameters
[in]epsilon: the amplitude of the noise
[in]fthe stochastic noise simulator This+=epsilon * f.random()

References CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >::getSize(), CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >::getValues(), and SM_TemplatedStochasticFunction< I >::templatedRandom().

Here is the call graph for this function:

◆ axpy()

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::axpy ( const Q &  alpha,
const CORE_Field< Q, K, D, S1, I1 > &  X,
const T &  beta 
)
inlineinherited

compute This=beta.This+ alpha .X

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

◆ begin()

auto CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::begin ( )
inlineinherited

return begin iterator for writing

Returns
begin iterator

◆ cbegin()

constexpr auto CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::cbegin ( ) const
inlineconstexprinherited

return begin iterator for reading

Returns
begin iterator

◆ cend()

constexpr auto CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::cend ( ) const
inlineconstexprinherited

return end iterator for reading

Returns
end iterator

◆ copy() [1/10]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::copy ( const CORE_Field< Q, K, D, S1, I1 > &  cpy)
inlineinherited

copy the the field

Parameters
[in]cpy: field to copy

◆ copy() [2/10]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::copy ( const std::array< Q, D > &  vs)
inlineinherited

initialize the field to the values of array of size D

Parameters
[in]vs: values to copy

◆ copy() [3/10]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::copy ( const std::array< Q, N > &  vs)
inlineinherited

initialize the field at eche element with Vs

Parameters
[in]vs: values to copy

◆ copy() [4/10]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::copy ( const std::initializer_list< T > &  vs)
inlineinherited

initialize the field to the values of list

Parameters
[in]vs: values of the field

◆ copy() [5/10]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::copy ( const std::valarray< Q > &  vs)
inlineinherited

initialize the field to the values of val array

Parameters
[in]vs: values of the field

◆ copy() [6/10]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::copy ( const std::vector< Q > &  vs)
inlineinherited

initialize the field to the values of vector

Parameters
[in]vs: values of the field

◆ copy() [7/10]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::copy ( const tIndex n,
const Q *  vs 
)
inlineinherited

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]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::copy ( CORE_Field< Q, K, D, S1, I1 > &&  cpy)
inlineinherited

copy the field : mv is destroyed after this

Parameters
[in]cpy:field to move

◆ copy() [9/10]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::copy ( std::initializer_list< T > &&  vs)
inlineinherited

initialize the field to the values of list

Parameters
[in]vs: values of the field

◆ copy() [10/10]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::copy ( std::valarray< Q > &&  vs)
inlineinherited

initialize the field to the values of val array

Parameters
[in]vs: values of the field

◆ crbegin()

constexpr auto CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::crbegin ( ) const
inlineconstexprinherited

return reverse begin iterator for reading

Returns
begin iterator

◆ crend()

constexpr auto CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::crend ( ) const
inlineconstexprinherited

return reverse end iterator for reading

Returns
end iterator

◆ csbegin()

constexpr auto CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::csbegin ( ) const
inlineconstexprinherited

return begin N-stride const iterator for writing

Returns
begin stride const iterator

◆ csend()

constexpr auto CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::csend ( ) const
inlineconstexprinherited

return end N-stride const iterator for writing

Returns
end stride const iterator

◆ DisableMemoryStack()

static void CORE_Object::DisableMemoryStack ( )
inlinestaticinherited

disable the memory stack

Referenced by CORE_Object::EnableMemoryStack().

Here is the caller graph for this function:

◆ elementsTransform()

void CORE_StdPtrField< T, K, D >::elementsTransform ( LambdaFct &&  F)
inlineinherited

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

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

◆ ElementsTransform()

static void CORE_StdPtrField< T, K, D >::ElementsTransform ( LambdaFct &&  F,
Self X 
)
inlinestaticinherited

apply the transform element with the lambda function Ri = F(Xi)

Parameters
[in]F: lambda function with one variable
[in]X: argument of F
[out]R: result value

◆ EnableMemoryStack() [1/2]

static void CORE_Object::EnableMemoryStack ( )
inlinestaticinherited

enable the memory stack

Referenced by CORE_Object::EnableMemoryStack(), and CORE_Run::SetDebugOptions().

Here is the caller graph for this function:

◆ EnableMemoryStack() [2/2]

static tBoolean CORE_Object::EnableMemoryStack ( const tBoolean isMemoryChecked)
inlinestaticinherited

enable the memory stack

Parameters
[in]isMemoryChecked: true to verify memory allocation of CORE_Object classes
Returns
true if the memroy is checked

References CORE_Object::DisableMemoryStack(), CORE_Object::EnableMemoryStack(), and CORE_Object::IsMemoryStackEnabled().

Here is the call graph for this function:

◆ end()

auto CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::end ( )
inlineinherited

return end iterator for writing

Returns
end iterator

◆ get() [1/2]

T& CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::get ( const tIndex i,
const K &  d 
)
inlineinherited

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]

const T& CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::get ( const tIndex i,
const K &  d 
) const
inlineinherited

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

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

◆ getClassName()

tString CORE_Object::getClassName ( ) const
inlineinherited

return the name of the class

Returns
the string name of the class

Referenced by CORE_Object::getIdentityString(), and CORE_Test::testTypes().

Here is the caller graph for this function:

◆ getConstSharedPointer()

template<class T >
std::shared_ptr<const T> CORE_Object::getConstSharedPointer ( ) const
inlineinherited

return a const shared pointer for this

Returns
the shared pointer as a type T

References CORE_Object::mThis.

◆ getContentsMemorySize()

virtual tMemSize CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::getContentsMemorySize ( ) const
inlineoverridevirtualinherited

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.

◆ getDataTypeName()

template<typename T , class I >
tString CORE_Collection< T, I >::getDataTypeName ( ) const
inlineinherited

get the type of data

Returns
the type of data as string

Referenced by SM_XDMF::writeVertices().

Here is the caller graph for this function:

◆ getDimension()

K CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::getDimension ( ) const
inlineinherited

get the dimension of the field

Returns
the diemension of the field

◆ getElementsNumber()

tIndex CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::getElementsNumber ( ) const
inlineinherited

return the number values of the container

Returns
the number of values of the conatiner

◆ getIdentityString()

tString CORE_Object::getIdentityString ( ) const
inlineinherited

retrun the string identification of the class

Returns
the string identity of the class

References CORE_Object::getClassName(), and core_functions::pointerToString().

Referenced by CORE_Test::testArray(), CORE_Test::testField(), CORE_Test::testTypes(), CORE_Object::toString(), CORE_ClassFactory::toString(), and CORE_Field< T, K, D, S, I >::toString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMemorySize()

template<typename T , typename K >
virtual tMemSize SM_Field< T, K >::getMemorySize ( ) const
inlinevirtual

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 The mamory size is :
  • the added size of the base classes which contains:
    • the primary attributes size depends on the order: (first delare the smallest attributes size
    • all virtual functions costs <pointer-size> (4 32xor 8 64x) bytes by virtual function
    • virtual inherihtance will increase of (4 or 8) bytes
  • we add the size of the contains values of the attributes : for example the size of a string is the length of the string 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from CORE_StdPtrField< T, K, 3 >.

References CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >::getContentsMemorySize().

Here is the call graph for this function:

◆ getPointerString()

tString CORE_Object::getPointerString ( ) const
inlineinherited

retrun the pointer of the class as a string

Returns
the pointer of the calss as a string

References core_functions::pointerToString().

Here is the call graph for this function:

◆ GetRegisteredClassesNumber()

static tIndex CORE_Object::GetRegisteredClassesNumber ( )
inlinestaticinherited

get the memory stack in string

Returns
the string representation of the memory stack

◆ getSharedPointer()

template<class T >
std::shared_ptr<T> CORE_Object::getSharedPointer ( )
inlineinherited

return the shared pointer for this

Returns
the shared pointer as a type T

References CORE_Object::mThis.

◆ getSize()

tIndex CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::getSize ( ) const
inlineinherited

return the number values of the container

Returns
the number of values of the conatiner

◆ getStorage() [1/2]

CORE_StdPtrArray< T > & CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::getStorage ( )
inlineinherited

get the storage

Returns
the storage of the field

◆ getStorage() [2/2]

const CORE_StdPtrArray< T > & CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::getStorage ( ) const
inlineinherited

get the storage

Returns
the storage of the field

◆ getValues() [1/2]

T* CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::getValues ( )
inlineinherited

get the values of the array

Returns
the values of the array

◆ getValues() [2/2]

const T* CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::getValues ( ) const
inlineinherited

get the values of the array for reading

Returns
the values of the array

◆ initialize() [1/3]

void CORE_StdPtrField< T, K, D >::initialize ( const Q &  v)
inlineinherited

initailize all the values with v

Parameters
[in]v: initialize value

◆ initialize() [2/3]

void CORE_StdPtrField< T, K, D >::initialize ( const std::array< Q, D > &  a)
inlineinherited

copy at element element the array of size D

Parameters
[in]a: values of the element

◆ initialize() [3/3]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::initialize ( const T &  v)
inlineinherited

initialize the field to v

Parameters
[in]vs: constant value of the field

◆ isInstanceOf()

template<class T >
tBoolean CORE_Object::isInstanceOf ( ) const
inlineinherited

test if the clas T is an instance of this class

Returns
true if the object is an instance of T

Referenced by SM_Beam::templatedSimulate().

Here is the caller graph for this function:

◆ IsMemoryStackEnabled()

static tBoolean CORE_Object::IsMemoryStackEnabled ( )
inlinestaticinherited

return trur if the memory stack is enabled

Referenced by CORE_Object::EnableMemoryStack(), and main().

Here is the caller graph for this function:

◆ isNANContained()

tBoolean CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::isNANContained ( ) const
inlineinherited

return true if one value is Not A Number

Returns
false if all the values is a Number

◆ linfDistance()

tReal CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::linfDistance ( const CORE_Field< Q, K, D, S, I1 > &  X,
tIndex i 
) const
inlineinherited

compute the Linfinitty norm

Returns
the max of |T_i-X_i| and i

◆ linfNorm()

tReal CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::linfNorm ( tIndex i) const
inlineinherited

compute the L infinity norm

Returns
the max of |T_i| and i

◆ MemoryStackToString()

static tString CORE_Object::MemoryStackToString ( )
inlinestaticinherited

get the memory stack in string

Returns
the string representation of the memory stack

Referenced by main().

Here is the caller graph for this function:

◆ min()

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::min ( T &  m) const
inlineinherited

return the min value of all the elements

Returns
the min values of all the elements

return the max value of all the elements

Returns
the 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 with the format : #coments N dim v[0] v[1] ..V[dim-1] v[dim].... ....V[dim*N-1]

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

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

◆ mod2() [1/2]

void CORE_StdPtrField< T, K, D >::mod2 ( CORE_Array< T, I > &  X) const
inlineinherited

return the norm2 array per each element

Parameters
[out]X: X[i]=|Ti|^2

◆ mod2() [2/2]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::mod2 ( CORE_Array< T, I1 > &  X) const
inlineinherited

return the norm2 array per exch element

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

◆ New()

template<typename T , typename K >
static CORE_UniquePointer<Self> SM_Field< T, K >::New ( )
inlinestatic

build a new instance of a SM_Field

Returns
an unique pointer of SM_Field

◆ normalize()

void CORE_StdPtrField< T, K, D >::normalize ( )
inlineinherited

normalize all the elements of the field return false if the method is not compatible with the floating point type

◆ Normalize()

static void CORE_StdPtrField< T, K, D >::Normalize ( const tIndex n,
T *  values 
)
inlinestaticinherited

normalize all the elements of the field

Parameters
[in]n: n is the size of values
[in,out]values: the values array to normalize return false if the method is not compatible with the floating point type

◆ operator%=()

Self& CORE_StdPtrField< T, K, D >::operator%= ( const T &  v)
inlineinherited

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]vfield to multiply

◆ operator()() [1/4]

T* CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::operator() ( const tInteger i)
inlineinherited

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()() [2/4]

const T* CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::operator() ( const tInteger i) const
inlineinherited

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()() [3/4]

const T& CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::operator() ( const tInteger i,
const K &  d 
) const
inlineinherited

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]

T& CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::operator() ( const tInteger i,
const K  d 
)
inlineinherited

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/3]

Self& CORE_StdPtrField< T, K, D >::operator*= ( const CORE_Field< Q, K, D, S, I > &  X)
inlineinherited

array multiply operator

Parameters
[in]Xfield to multiply

◆ operator*=() [2/3]

Self& CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::operator*= ( const CORE_Field< T1, K, D, S1, I1 > &  v)
inlineinherited

array multiply operator

Parameters
[in]varray to multiply

◆ operator*=() [3/3]

Self& CORE_StdPtrField< T, K, D >::operator*= ( const T &  v)
inlineinherited

multiplicator operator

Parameters
[in]vmultiplicator value

◆ operator+=()

Self& CORE_StdPtrField< T, K, D >::operator+= ( const T &  v)
inlineinherited

add operator

Parameters
[in]v:addvalue

◆ operator-=() [1/3]

Self& CORE_StdPtrField< T, K, D >::operator-= ( const CORE_Field< Q, K, D, S, I > &  X)
inlineinherited

array sub operator

Parameters
[in]Xfield to multiply

◆ operator-=() [2/3]

Self& CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::operator-= ( const CORE_Field< T1, K, D, S1, I1 > &  v)
inlineinherited

array sub operator

Parameters
[in]varray to multiply

◆ operator-=() [3/3]

Self& CORE_StdPtrField< T, K, D >::operator-= ( const T &  v)
inlineinherited

sub operator

Parameters
[in]v:subvalue

◆ operator/=() [1/3]

Self& CORE_StdPtrField< T, K, D >::operator/= ( const CORE_Field< Q, K, D, S, I > &  X)
inlineinherited

array divisor operator

Parameters
[in]Xfield to multiply

◆ operator/=() [2/3]

Self& CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::operator/= ( const CORE_Field< T1, K, D, S1, I1 > &  v)
inlineinherited

array divisor operator

Parameters
[in]varray to multiply

◆ operator/=() [3/3]

Self& CORE_StdPtrField< T, K, D >::operator/= ( const T &  v)
inlineinherited

divisor operator

Parameters
[in]vdivisor value

◆ operator=() [1/6]

template<typename T , typename K >
Self& SM_Field< T, K >::operator= ( const Self cpy)
inline

copy operator

Parameters
[in]cpy: field to copy @retrn this

References CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >::copy().

Here is the call graph for this function:

◆ operator=() [2/6]

template<typename T , typename K >
Self& SM_Field< T, K >::operator= ( const std::initializer_list< T > &  cpy)
inline

copy operator

Parameters
[in]cpy: initializer list @retrn this

References CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >::copy().

Here is the call graph for this function:

◆ operator=() [3/6]

template<typename T , typename K >
Self& SM_Field< T, K >::operator= ( const std::valarray< T > &  cpy)
inline

copy operator

Parameters
[in]cpy: initializer list
Returns
this

References CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >::copy().

Here is the call graph for this function:

◆ operator=() [4/6]

template<typename T , typename K >
Self& SM_Field< T, K >::operator= ( const T &  v)
inline

copy operator

Parameters
[in]v: initialize value @retrn this

References CORE_StdPtrField< T, K, 3 >::initialize().

Here is the call graph for this function:

◆ operator=() [5/6]

template<typename T , typename K >
Self& SM_Field< T, K >::operator= ( Self &&  cpy)
inline

copy operator

Parameters
[in]cpy: field to copy @retrn this

References CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >::copy().

Here is the call graph for this function:

◆ operator=() [6/6]

template<typename T , typename K >
Self& SM_Field< T, K >::operator= ( std::initializer_list< T > &&  cpy)
inline

copy operator

Parameters
[in]cpy: initializer list @retrn this

References CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >::copy().

Here is the call graph for this function:

◆ operator[]() [1/2]

T& CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::operator[] ( const tIndex i)
inlineinherited

get the i-th value for writting.

Parameters
[in]iindex of the value

◆ operator[]() [2/2]

const T& CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::operator[] ( const tIndex i) const
inlineinherited

get the i-th value for reading.

Parameters
[in]iindex of the value

◆ prod()

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::prod ( T &  p) const
inlineinherited

return the produc of all the elements

Returns
the product of all the elements

◆ rbegin()

auto CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::rbegin ( )
inlineinherited

return reverse begin iterator for writing

Returns
begin iterator

◆ rend()

auto CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::rend ( )
inlineinherited

return reverse end iterator for writing

Returns
end iterator

◆ resize()

template<typename T , class I >
void CORE_Collection< T, I >::resize ( const tIndex n)
inlineinherited

modify the size of the array and keep its old values

◆ sbegin()

auto CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::sbegin ( )
inlineinherited

return begin stride iterator for writing

Returns
begin stride iterator

◆ scalarProduct() [1/2]

T& CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::scalarProduct ( const CORE_Field< Q, K, D, S1, I1 > &  X,
T &  s 
) const
inlineinherited

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]

T& CORE_StdPtrField< T, K, D >::scalarProduct ( const std::valarray< Q > &  weights,
const CORE_Field< Q, K, D, S1, I1 > &  X,
T &  s 
) const
inlineinherited

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()

auto CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::send ( )
inlineinherited

return end N-stride iterator for writing

Returns
end stride iterator

◆ setElementsNumber()

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::setElementsNumber ( const tInteger n)
inlineinherited

set the number of element of the container

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

◆ setSharedValues() [1/3]

tBoolean CORE_StdPtrField< T, K, D >::setSharedValues ( const tIndex capacity,
const tIndex size,
Q *  values 
)
inlineinherited

set shared values with the capacity and size

Parameters
[in]capacity: memory size of the values
[in]sizesuzefull size of the values
[in,out]valuesthe sahred values
Returns
true is the sharing has succeeded (same memory size between type T & Q)

◆ setSharedValues() [2/3]

tBoolean CORE_StdPtrField< T, K, D >::setSharedValues ( const tIndex capacity,
Q *  values 
)
inlineinherited

set shared values with the capacity and size

Parameters
[in]capacity: memory size of the values
[in,out]valuesthe sahred values

size is set to min(0,mCapacity-2)

Returns
true is the sharing has succeeded (same memory size between type T & Q)

◆ setSharedValues() [3/3]

tBoolean CORE_StdPtrField< T, K, D >::setSharedValues ( CORE_PtrArray< Q, I1 > &  array)
inlineinherited

set shared values with the capacity and size

Parameters
[in]capacity: memory size of the values
[in,out]valuesthe sahred values

size is set to min(0,mCapacity-2)

Returns
true is the sharing has succeeded (same memory size between type T & Q)

◆ setSize()

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::setSize ( const tIndex n)
inlineinherited

set the number of values of the container

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

◆ setThis()

template<class T >
std::shared_ptr<T> CORE_Object::setThis ( std::unique_ptr< T, CORE_Object::Delete > &  up)
inlineprivateinherited

set the shared pointer from an unique pointer

Parameters
[in,out]upunique pointer of the class at input, points to null pointer at output
Returns
the shared pointer of the class

Method only calledby the friend class CORE_ClassFactory::NewSharedInstance()

References CORE_Object::mThis.

◆ sum()

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::sum ( T &  s) const
inlineinherited

return the sum of all the elements

Returns
the sum of all the elements

◆ swap()

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::swap ( CORE_Array< T, I > &  a)
inlineinherited

swap the contents of the array

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

◆ toString()

virtual tString CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::toString ( ) const
inlineoverridevirtualinherited

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]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::transform ( LambdaFct &&  F)
inlineinherited

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

Parameters
[in]F: lambda function with one variable

◆ transform() [2/3]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::transform ( LambdaFct &&  F,
const Self X 
)
inlineinherited

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]

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::transform ( LambdaFct &&  F,
const Self X,
const Self Y 
)
inlineinherited

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()

void CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::uniformRandomize ( const T &  min,
const T &  max 
)
inlineinherited

randomize the field

Member Data Documentation

◆ mStorage

CORE_StdPtrArray< T > CORE_Field< T, K, D, CORE_StdPtrArray< T > , CORE_StdPtrField< T, K, D > >::mStorage
privateinherited

◆ mThis

std::weak_ptr<CORE_Object> CORE_Object::mThis
privateinherited

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