C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Member Functions | List of all members
CORE_StdValArray< T > Class Template Reference

this class describes a standart arithmetic array type implemented with a std::valarray object of type T _param T : type of the values of the array More...

#include <CORE_StdValArray.h>

Inheritance diagram for CORE_StdValArray< T >:
Inheritance graph
[legend]
Collaboration diagram for CORE_StdValArray< T >:
Collaboration graph
[legend]

Public Member Functions

 CORE_StdValArray ()
 build an instance of class
 
 CORE_StdValArray (const tIndex &n)
 build an instance of class of size n More...
 
virtual ~CORE_StdValArray ()
 destroy an instance of class
 
virtual tMemSize getMemorySize () const override
 return the memory size of the class More...
 
Selfoperator= (const T &v)
 fill the values of the array with v More...
 
Selfoperator= (const std::initializer_list< T > &values)
 build an array by a copy of c More...
 
Selfoperator= (std::initializer_list< T > &&values)
 build an array by a copy of c More...
 
template<size_t N, typename Q >
Selfoperator= (const std::array< Q, N > &values)
 build an array by a copy of c More...
 
template<typename Q >
Selfoperator= (const std::valarray< Q > &values)
 build an array by a copy of c More...
 
template<typename Q >
Selfoperator= (const std::vector< Q > &values)
 build an array by a copy of c More...
 
Selfoperator= (const Self &values)
 build an array by a copy of c More...
 
Selfoperator= (const Self &&values)
 build an array by a copy of c (in mirror with the copy operator) More...
 
template<typename Q , class I1 >
Selfoperator= (const CORE_Array< Q, I1 > &values)
 build an array by a copy of c More...
 
template<typename Q , class I1 >
Selfoperator= (const CORE_Array< Q, I1 > &&values)
 build an array by a copy of c (in mirror with the copy operator) More...
 
template<typename Q , class I >
void copy (const CORE_Array< Q, I > &X)
 copy the array More...
 
template<typename Q , class I >
void copy (CORE_Array< Q, I > &&X)
 copy the array More...
 
template<typename Q , class I >
void copy (const CORE_ValArray< Q, I > &cpy)
 copy the container More...
 
template<typename Q , class I >
void copy (CORE_ValArray< Q, I > &&cpy)
 copy the conatiner : mv is destroyed after this More...
 
void copy (const Self &cpy)
 copy the container More...
 
void copy (Self &&cpy)
 copy the conatiner : mv is destroyed after this More...
 
template<typename Q >
void copy (const tIndex &n, const Q *Vs)
 initialize the array to the values of pointer of size n More...
 
void copy (const tIndex &n, const std::initializer_list< T > &Vs)
 initialize the array to the values of list More...
 
void copy (const tIndex &n, std::initializer_list< T > &&Vs)
 initialize the array to the values of list More...
 
template<typename Q , size_t N>
void copy (const tIndex &n, const std::array< Q, N > &Vs)
 initialize the array to the values of array of size N More...
 
template<typename Q >
void copy (const tIndex &n, const std::valarray< Q > &Vs)
 initialize the array to the values of val array More...
 
template<typename Q >
void copy (const tIndex &n, const std::vector< Q > &Vs)
 initialize the array to the values of vector More...
 
void initialize (const T &x)
 initialize the array to the value x More...
 
void uniformRandomize (const T &min, const T &max)
 randomize the vector in [min,max] 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 Q , class I >
Selfoperator-= (const CORE_Array< Q, I > &X)
 array sub operator This -=X More...
 
template<typename Q , class I >
Selfoperator*= (const CORE_Array< Q, I > &X)
 array multiply operator This *=X More...
 
template<typename Q , class I >
Selfoperator/= (const CORE_Array< Q, I > &X)
 array divisor operator This /=X More...
 
Selfoperator+= (const Self &X)
 array add operator : This +=X More...
 
Selfoperator-= (const Self &X)
 array add operator : This -=X More...
 
Selfoperator*= (const Self &X)
 array add operator : This *=X More...
 
Selfoperator/= (const Self &X)
 array add operator : This /=X More...
 
template<typename LambdaFct >
void transform (LambdaFct &&F)
 transform the transform element with the lambda function Ti = F(const Ti) More...
 
template<typename LambdaFct >
void transform (LambdaFct &&F, const CORE_Array< T, Self > &X)
 transform the transform element with the lambda function Ti = F(const Xi) More...
 
template<typename LambdaFct >
void transform (LambdaFct &&F, const CORE_Array< T, Self > &X, const CORE_Array< T, Self > &Y)
 transform the transform element with the lambda function Ti = F(const Xi,const Yi) More...
 
void normalize ()
 normalize the array
 
template<typename Q , class I >
void axpy (const Q &alpha, const CORE_Array< Q, I > &X, const T &beta)
 compute This=beta.This+ alpha .X More...
 
template<typename Q , class I >
void AXPY (const Q &alpha, const CORE_Array< Q, I > &X, const T &beta, Self &Y)
 compute Y=beta.Y+ alpha .X More...
 
tBoolean isNANContained () const
 return true if one value is Not A Number More...
 
void sum (T &s) const
 return the sum of all the elements More...
 
void prod (T &p) const
 return the product of all the elements More...
 
template<typename Q , class I >
T & scalarProduct (const CORE_Array< Q, I > &X, T &s) const
 return the scalar product More...
 
tReal l2Norm2 () const
 computes the L2-Norm of this More...
 
template<typename Q , class I >
tReal l2Distance2 (const CORE_Array< Q, I > &X) const
 compute the square of distance of this to X More...
 
tReal linfDistance (tIndex &imax) const
 compute the L infinity norm of This More...
 
template<typename Q , class I >
tReal linfDistance (const CORE_Array< Q, I > &X, tIndex &imax) const
 compute the L infinity distance of this to X More...
 
- Public Member Functions inherited from CORE_ValArray< T, CORE_StdValArray< T > >
 CORE_ValArray ()
 build an array of T*
 
 CORE_ValArray (const tIndex &n)
 build an array of size n More...
 
virtual ~CORE_ValArray ()
 destroy an instance of this
 
virtual tMemSize getContentsMemorySize () const override
 return the memory size of the included associations More...
 
void setSize (const tIndex &n)
 set the number of values More...
 
tIndex getSize () const
 return the size of the array for writing 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...
 
std::valarray< T > & getArray ()
 get the array More...
 
const std::valarray< T > & getArray () const
 get the array for reading More...
 
const T * getValues () const
 get the values of the array for reading More...
 
T * getValues ()
 get the values of the array More...
 
void swap (CORE_ValArray< T, CORE_StdValArray< T > > &a)
 swap the contents of the array More...
 
void swap (const tIndex &i, const tIndex &j)
 swap the 2 elements of the array More...
 
- Public Member Functions inherited from CORE_Array< T, I >
template<int N>
auto sbegin ()
 return begin stride iterator for writing More...
 
template<int N>
auto send ()
 return end N-stride iterator for writing More...
 
template<int N>
constexpr auto csbegin () const
 return begin N-stride const iterator for writing More...
 
template<int N>
constexpr auto csend () const
 return end N-stride const iterator for writing More...
 
const T & get (const tIndex &i) const
 get the i-th element for reading More...
 
T & get (const tIndex &i)
 get 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...
 
Selfoperator= (const T &v)
 fill the values of the array with v More...
 
Selfoperator= (std::initializer_list< T > values)
 build an array by a copy of c More...
 
template<size_t N, typename Q >
Selfoperator= (const std::array< Q, N > &values)
 build an array by a copy of c More...
 
template<typename Q >
Selfoperator= (const std::valarray< Q > &values)
 build an array by a copy of c More...
 
template<typename Q >
Selfoperator= (const std::vector< Q > &values)
 build an array by a copy of c More...
 
template<typename Q , class I1 >
Selfoperator= (const CORE_Array< Q, I1 > &cpy)
 build an array by a copy of cpy More...
 
Selfoperator= (const Self &cpy)
 build an array by a copy of cpy More...
 
template<typename Q , class I1 >
Selfoperator= (CORE_Array< Q, I1 > &&cpy)
 build an array by a copy of cpy More...
 
Selfoperator= (Self &&cpy)
 build an array by a copy of cpy More...
 
template<typename Q >
void copy (const tIndex &n, const Q *vs)
 initialize the array to the values of pointer of size n More...
 
template<typename Q , size_t N>
void copy (const tIndex &n, const std::array< Q, N > &vs)
 initialize the array to the values of array of size N More...
 
template<typename Q >
void copy (const tIndex &n, const std::valarray< Q > &vs)
 initialize the array to the values of val array More...
 
template<typename Q >
void copy (const tIndex &n, const std::vector< Q > &vs)
 initialize the array to the values of vector More...
 
void copy (const tIndex &n, const std::initializer_list< T > &vs)
 initialize the array to the values of list More...
 
void copy (const tIndex &n, std::initializer_list< T > &&vs)
 initialize the array to the values of list More...
 
template<typename Q , class I1 >
void copy (const CORE_Array< Q, I1 > &cpy)
 copy the container More...
 
template<typename Q , class I1 >
void copy (CORE_Array< Q, I1 > &&cpy)
 copy the conatiner : mv is destroyed after this More...
 
void initialize (const T &v)
 randomize the field
 
virtual void setUniformRandomizeSeed (const tULLInt &seed)
 set the uniform randomize seed More...
 
void setUniformRandomizeSeed ()
 set the uniform randomize seed
 
void uniformRandomize ()
 randomize the field
 
void uniformRandomize (const T &min, const T &max)
 randomize the field
 
I & operator+= (const T &v)
 add operator More...
 
I & operator-= (const T &v)
 sub operator More...
 
I & operator*= (const T &v)
 multiplicator operator More...
 
I & operator/= (const T &v)
 divisor operator More...
 
I & operator%= (const T &v) requires functions_type
 modulo operator More...
 
template<typename Q , class I1 >
I & operator-= (const CORE_Array< Q, I1 > &v)
 array sub operator More...
 
template<typename Q , class I1 >
I & operator*= (const CORE_Array< Q, I1 > &v)
 array multiply operator More...
 
template<typename Q , class I1 >
I & operator/= (const CORE_Array< Q, 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...
 
void swap (Self &a)
 swap the contents of the array More...
 
void swap (const tIndex &i, const tIndex &j)
 swap the two elements of the array More...
 
void normalize ()
 normalize the array
 
template<typename Q , class I1 >
void axpy (const Q &alpha, const CORE_Array< Q, 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...
 
void sum (T &s) const
 Computes the sum of all the elements. More...
 
void prod (T &p) const
 return the produc of all the elements More...
 
template<typename Q , class I1 >
T & scalarProduct (const CORE_Array< Q, I1 > &X, T &s) const
 return the scalar product More...
 
tReal l2Norm2 () const
 compute the L2 norm squared More...
 
tReal l2Norm () const
 compute the L2 norm More...
 
template<typename Q , class I1 >
tReal l2Distance2 (const CORE_Array< Q, I1 > &X) const
 compute the L2 distance squared More...
 
template<typename Q , class I1 >
tReal l2Distance (const CORE_Array< Q, I1 > &X) const
 compute the L2 distance More...
 
tReal linfNorm (tIndex &i) const
 compute the L infinity norm More...
 
template<typename Q , class I1 >
tReal linfDistance (const CORE_Array< Q, I1 > &X, tIndex &i) const
 compute the Linfinitty norm 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...
 
virtual tString toString () const override
 return the string representation of the object node 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...
 

Static Public Member Functions

static CORE_UniquePointer< SelfNew ()
 return a new unique pointer of this More...
 
static void Copy (const std::valarray< T > &X, std::valarray< T > &R)
 copy 2 valarray with same type More...
 
template<typename Q , class I >
static void Copy (const CORE_Array< Q, I > &X, std::valarray< T > &R)
 copy 2 array More...
 
template<class Q >
static void Copy (const tIndex &n, const std::valarray< Q > &X, std::valarray< T > &R)
 copy the first n values of a std::valarray More...
 
static void Copy (const tIndex &n, std::initializer_list< T > &&X, std::valarray< T > &R)
 copy the array R=X More...
 
static void Copy (const tIndex &n, std::initializer_list< T > X, std::valarray< T > &R)
 copy the array R=X More...
 
template<class Q >
static void Copy (const tIndex &n, const std::vector< Q > &X, std::valarray< T > &R)
 copy the array R=X More...
 
template<typename Q >
static void Copy (const tIndex &n, const Q *X, std::valarray< T > &R)
 copy the array More...
 
static void UniformRandomize (const T &min, const T &max, std::vector< T > &values)
 generate a random val array More...
 
static void UniformRandomize (const T &min, const T &max, std::valarray< T > &values)
 generate a random val array More...
 
template<size_t N>
static void UniformRandomize (const T &min, const T &max, std::array< T, N > &values)
 generate a random val array More...
 
template<typename LambdaFct >
static void Transform (LambdaFct &&F, Self &R)
 apply the transform element with the lambda function Ri = F(const Ri) More...
 
template<typename LambdaFct >
static void Transform (LambdaFct &&F, const CORE_Array< T, Self > &X, Self &R)
 apply the transform element with the lambda function Ri = F(const Xi) More...
 
template<typename LambdaFct >
static void Transform (LambdaFct &&F, const CORE_Array< T, Self > &X, const CORE_Array< T, Self > &Y, Self &R)
 apply the transform element with the lambda function Ri = F(const Xi,const Yi) More...
 
static SelfSum (const Self &Ain, Self &Aout)
 sum the element of the 2 arrays More...
 
- 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...
 

Additional Inherited Members

- Protected Member Functions inherited from CORE_Array< T, I >
 CORE_Array ()
 instanciation method of a class
 
virtual ~CORE_Array ()
 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

 

Detailed Description

template<typename T>
class CORE_StdValArray< T >

this class describes a standart arithmetic array type implemented with a std::valarray object of type T _param T : type of the values of the array

Constructor & Destructor Documentation

◆ CORE_StdValArray()

template<typename T >
CORE_StdValArray< T >::CORE_StdValArray ( const tIndex &  n)
inlineexplicit

build an instance of class of size n

Parameters
[in]nsize of the array

Member Function Documentation

◆ axpy()

template<typename T >
template<typename Q , class I >
void CORE_StdValArray< T >::axpy ( const Q &  alpha,
const CORE_Array< Q, I > &  X,
const T &  beta 
)
inline

compute This=beta.This+ alpha .X

Template Parameters
Q: type of X and alpha
I: implemented class of X
Parameters
[in]alphaalpha parameter
[in]XX array
[in]beta: beta parameter

◆ AXPY()

template<typename T >
template<typename Q , class I >
void CORE_StdValArray< T >::AXPY ( const Q &  alpha,
const CORE_Array< Q, I > &  X,
const T &  beta,
Self Y 
)
inline

compute Y=beta.Y+ alpha .X

Template Parameters
Q: type of X and alpha
I: implemented class of X
Parameters
[in]alphaalpha parameter
[in]XX array
[in]beta: beta parameter
[in,out]Y: Y array

◆ copy() [1/12]

template<typename T >
template<typename Q , class I >
void CORE_StdValArray< T >::copy ( const CORE_Array< Q, I > &  X)
inline

copy the array

Template Parameters
Q: type of X
I: implemented class of X
Parameters
[in]X: array to copy

◆ Copy() [1/7]

template<typename T >
template<typename Q , class I >
static void CORE_StdValArray< T >::Copy ( const CORE_Array< Q, I > &  X,
std::valarray< T > &  R 
)
inlinestatic

copy 2 array

Template Parameters
Q: type of X
I: implemented class of X
Parameters
[in]X: val array to copy
[out]Rcopied val array

◆ copy() [2/12]

template<typename T >
template<typename Q , class I >
void CORE_StdValArray< T >::copy ( const CORE_ValArray< Q, I > &  cpy)
inline

copy the container

Template Parameters
Q: type of cpy
I: implemented class of cpy
Parameters
[in]cpy: container to copy

◆ copy() [3/12]

template<typename T >
void CORE_StdValArray< T >::copy ( const Self cpy)
inline

copy the container

Parameters
[in]cpy: container to copy

◆ Copy() [2/7]

template<typename T >
static void CORE_StdValArray< T >::Copy ( const std::valarray< T > &  X,
std::valarray< T > &  R 
)
inlinestatic

copy 2 valarray with same type

Parameters
[in]X: val array to copy
[out]Rcopied val array

Uses the std::valarray==()

◆ copy() [4/12]

template<typename T >
template<typename Q >
void CORE_StdValArray< T >::copy ( const tIndex &  n,
const Q *  Vs 
)
inline

initialize the array to the values of pointer of size n

Template Parameters
Q: type of cpy
Parameters
[in]n: number of elements to copy
[in]Vs: values of the array

◆ Copy() [3/7]

template<typename T >
template<typename Q >
static void CORE_StdValArray< T >::Copy ( const tIndex &  n,
const Q *  X,
std::valarray< T > &  R 
)
inlinestatic

copy the array

Template Parameters
Q: type of X
Parameters
[in]n: number of values to copy
[in]X: values to copy (size of X must be greater than n)
[out]Rcopied val array

Uses the pointers loop

◆ copy() [5/12]

template<typename T >
template<typename Q , size_t N>
void CORE_StdValArray< T >::copy ( const tIndex &  n,
const std::array< Q, N > &  Vs 
)
inline

initialize the array to the values of array of size N

Template Parameters
Q: type of Vs
Nnumber of elements of Vs
Parameters
[in]n: number of element to copy
[in]Vs: values of the array

◆ copy() [6/12]

template<typename T >
void CORE_StdValArray< T >::copy ( const tIndex &  n,
const std::initializer_list< T > &  Vs 
)
inline

initialize the array to the values of list

Parameters
[in]n: number of elements to copy
[in]Vs: values of the array

◆ copy() [7/12]

template<typename T >
template<typename Q >
void CORE_StdValArray< T >::copy ( const tIndex &  n,
const std::valarray< Q > &  Vs 
)
inline

initialize the array to the values of val array

Template Parameters
Q: type of Vs
Parameters
[in]n: number of element to copy
[in]Vs: values of the array

◆ Copy() [4/7]

template<typename T >
template<class Q >
static void CORE_StdValArray< T >::Copy ( const tIndex &  n,
const std::valarray< Q > &  X,
std::valarray< T > &  R 
)
inlinestatic

copy the first n values of a std::valarray

Template Parameters
Q: type of X
Parameters
[in]n: n values to copy
[in]X: val array to copy
[out]Rcopied val array

Uses the pointers loop

◆ copy() [8/12]

template<typename T >
template<typename Q >
void CORE_StdValArray< T >::copy ( const tIndex &  n,
const std::vector< Q > &  Vs 
)
inline

initialize the array to the values of vector

Template Parameters
Q: type of Vs
Parameters
[in]n: number of element to copy
[in]Vs: values of the array

◆ Copy() [5/7]

template<typename T >
template<class Q >
static void CORE_StdValArray< T >::Copy ( const tIndex &  n,
const std::vector< Q > &  X,
std::valarray< T > &  R 
)
inlinestatic

copy the array R=X

Template Parameters
Q: type of X
Parameters
[in]n: the n first values of th evector to copy
[in]X: vector to copy
[out]Rcopied val array

Uses the pointer loops methods

◆ copy() [9/12]

template<typename T >
void CORE_StdValArray< T >::copy ( const tIndex &  n,
std::initializer_list< T > &&  Vs 
)
inline

initialize the array to the values of list

Parameters
[in]n: number of elements to copy
[in]Vs: values of the array

◆ Copy() [6/7]

template<typename T >
static void CORE_StdValArray< T >::Copy ( const tIndex &  n,
std::initializer_list< T > &&  X,
std::valarray< T > &  R 
)
inlinestatic

copy the array R=X

Parameters
[in]n: the first n values of X to copy
[in]X: val array to copy
[out]Rcopied val array

using the for_each loop

◆ Copy() [7/7]

template<typename T >
static void CORE_StdValArray< T >::Copy ( const tIndex &  n,
std::initializer_list< T >  X,
std::valarray< T > &  R 
)
inlinestatic

copy the array R=X

Parameters
[in]n: the first n cvalues to copy
[in]X: val array to copy
[out]Rcopied val array

using the for_each loop

◆ copy() [10/12]

template<typename T >
template<typename Q , class I >
void CORE_StdValArray< T >::copy ( CORE_Array< Q, I > &&  X)
inline

copy the array

Template Parameters
Q: type of X
I: implemented class of X
Parameters
[in]X: array to copy

◆ copy() [11/12]

template<typename T >
template<typename Q , class I >
void CORE_StdValArray< T >::copy ( CORE_ValArray< Q, I > &&  cpy)
inline

copy the conatiner : mv is destroyed after this

Template Parameters
Q: type of cpy
I: implemented class of cpy
Parameters
[in]cpy:container to move

◆ copy() [12/12]

template<typename T >
void CORE_StdValArray< T >::copy ( Self &&  cpy)
inline

copy the conatiner : mv is destroyed after this

Parameters
[in]cpy:container to move

◆ getMemorySize()

template<typename T >
virtual tMemSize CORE_StdValArray< T >::getMemorySize ( ) const
inlineoverridevirtual

return the memory size of the class

Returns
the memory size of the class in bytes 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from CORE_ValArray< T, CORE_StdValArray< T > >.

◆ initialize()

template<typename T >
void CORE_StdValArray< T >::initialize ( const T &  x)
inline

initialize the array to the value x

Parameters
[in]xconstant value

using the for loop

◆ isNANContained()

template<typename T >
tBoolean CORE_StdValArray< T >::isNANContained ( ) const
inline

return true if one value is Not A Number

Returns
false if all the values is a Number

◆ l2Distance2()

template<typename T >
template<typename Q , class I >
tReal CORE_StdValArray< T >::l2Distance2 ( const CORE_Array< Q, I > &  X) const
inline

compute the square of distance of this to X

Template Parameters
Q: type of X and alpha
I: implemented class of X
Parameters
[in]Xthe array to compute the distance
Returns
the L2-norm \( \sum_i |T_i-X_i|^2 \)

◆ l2Norm2()

template<typename T >
tReal CORE_StdValArray< T >::l2Norm2 ( ) const
inline

computes the L2-Norm of this

Returns
the L2-norm \( \sum_i |T_i|^2 \)

◆ linfDistance() [1/2]

template<typename T >
template<typename Q , class I >
tReal CORE_StdValArray< T >::linfDistance ( const CORE_Array< Q, I > &  X,
tIndex &  imax 
) const
inline

compute the L infinity distance of this to X

Template Parameters
Q: type of X and alpha
I: implemented class of X
Parameters
[in]Xthe array to compute the distance
[out]imax: index where the norm is max
Returns
the Linf-norm \( i_{max}=argmax_i |T_i-X_i| \)

◆ linfDistance() [2/2]

template<typename T >
tReal CORE_StdValArray< T >::linfDistance ( tIndex &  imax) const
inline

compute the L infinity norm of This

Parameters
[out]imax: index where the norm is max
Returns
the Linf-norm \( i_{max}=argmax_i |T_i| \)

◆ New()

template<typename T >
static CORE_UniquePointer<Self> CORE_StdValArray< T >::New ( )
inlinestatic

return a new unique pointer of this

Returns
an unqie pointer of this class

◆ operator%=()

template<typename T >
Self& CORE_StdValArray< T >::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 : This +=X

Template Parameters
Q: type of X
I: implemented class of X
Parameters
[in]Xargument array use the transform method

◆ operator*=() [1/3]

template<typename T >
template<typename Q , class I >
Self& CORE_StdValArray< T >::operator*= ( const CORE_Array< Q, I > &  X)
inline

array multiply operator This *=X

Template Parameters
Q: type of X
I: implemented class of X
Parameters
[in]Xarray argument use a pointers loop

◆ operator*=() [2/3]

template<typename T >
Self& CORE_StdValArray< T >::operator*= ( const Self X)
inline

array add operator : This *=X

Parameters
[in]Xargument array use a pointer loop

◆ operator*=() [3/3]

template<typename T >
Self& CORE_StdValArray< T >::operator*= ( const T &  v)
inline

multiplicator operator

Parameters
[in]vmultiplicator value

◆ operator+=() [1/2]

template<typename T >
Self& CORE_StdValArray< T >::operator+= ( const Self X)
inline

array add operator : This +=X

Parameters
[in]Xargument array use a pointer loop

◆ operator+=() [2/2]

template<typename T >
Self& CORE_StdValArray< T >::operator+= ( const T &  v)
inline

add operator

Parameters
[in]vadd value

◆ operator-=() [1/3]

template<typename T >
template<typename Q , class I >
Self& CORE_StdValArray< T >::operator-= ( const CORE_Array< Q, I > &  X)
inline

array sub operator This -=X

Template Parameters
Q: type of X
I: implemented class of X
Parameters
[in]Xarray to multiply Use transform method

◆ operator-=() [2/3]

template<typename T >
Self& CORE_StdValArray< T >::operator-= ( const Self X)
inline

array add operator : This -=X

Parameters
[in]Xargument array use a pointer loop

◆ operator-=() [3/3]

template<typename T >
Self& CORE_StdValArray< T >::operator-= ( const T &  v)
inline

sub operator

Parameters
[in]vsub value

◆ operator/=() [1/3]

template<typename T >
template<typename Q , class I >
Self& CORE_StdValArray< T >::operator/= ( const CORE_Array< Q, I > &  X)
inline

array divisor operator This /=X

Template Parameters
Q: type of X
I: implemented class of X
Parameters
[in]Xarray to divise use a trsnform method

◆ operator/=() [2/3]

template<typename T >
Self& CORE_StdValArray< T >::operator/= ( const Self X)
inline

array add operator : This /=X

Parameters
[in]Xargument array use a pointer loop

◆ operator/=() [3/3]

template<typename T >
Self& CORE_StdValArray< T >::operator/= ( const T &  v)
inline

divisor operator

Parameters
[in]vdivisor value

◆ operator=() [1/10]

template<typename T >
template<typename Q , class I1 >
Self& CORE_StdValArray< T >::operator= ( const CORE_Array< Q, I1 > &&  values)
inline

build an array by a copy of c (in mirror with the copy operator)

Template Parameters
Q: type of values
I: implemented class of values
Parameters
[in]valuesvalues to copy

◆ operator=() [2/10]

template<typename T >
template<typename Q , class I1 >
Self& CORE_StdValArray< T >::operator= ( const CORE_Array< Q, I1 > &  values)
inline

build an array by a copy of c

Template Parameters
Q: type of values
I: implemented class of values
Parameters
[in]valuesvalues to copy

◆ operator=() [3/10]

template<typename T >
Self& CORE_StdValArray< T >::operator= ( const Self &&  values)
inline

build an array by a copy of c (in mirror with the copy operator)

Parameters
[in]valuesvalues to copy

◆ operator=() [4/10]

template<typename T >
Self& CORE_StdValArray< T >::operator= ( const Self values)
inline

build an array by a copy of c

Parameters
[in]valuesvalues to copy

◆ operator=() [5/10]

template<typename T >
template<size_t N, typename Q >
Self& CORE_StdValArray< T >::operator= ( const std::array< Q, N > &  values)
inline

build an array by a copy of c

Template Parameters
N: numer of values
Q: type of values
Parameters
[in]valuesvalues to copy

◆ operator=() [6/10]

template<typename T >
Self& CORE_StdValArray< T >::operator= ( const std::initializer_list< T > &  values)
inline

build an array by a copy of c

Parameters
[in]valuesvalues to copy

◆ operator=() [7/10]

template<typename T >
template<typename Q >
Self& CORE_StdValArray< T >::operator= ( const std::valarray< Q > &  values)
inline

build an array by a copy of c

Template Parameters
Q: type of values
Parameters
[in]valuesvalues to copy

◆ operator=() [8/10]

template<typename T >
template<typename Q >
Self& CORE_StdValArray< T >::operator= ( const std::vector< Q > &  values)
inline

build an array by a copy of c

Template Parameters
Q: type of values
Parameters
[in]valuesvalues to copy

◆ operator=() [9/10]

template<typename T >
Self& CORE_StdValArray< T >::operator= ( const T &  v)
inline

fill the values of the array with v

Parameters
[in]v: value to fill

◆ operator=() [10/10]

template<typename T >
Self& CORE_StdValArray< T >::operator= ( std::initializer_list< T > &&  values)
inline

build an array by a copy of c

Parameters
[in]valuesvalues to copy

◆ prod()

template<typename T >
void CORE_StdValArray< T >::prod ( T &  p) const
inline

return the product of all the elements

Parameters
[out]pelements product

◆ scalarProduct()

template<typename T >
template<typename Q , class I >
T& CORE_StdValArray< T >::scalarProduct ( const CORE_Array< Q, I > &  X,
T &  s 
) const
inline

return the scalar product

Template Parameters
Q: type of X and alpha
I: implemented class of X
Parameters
[in]X: argument vector
[out]sscalar product with the same value as return
Returns
the value of \( <T,X>=\sum_{i=0}^{N-1} T_i.A_i \)

◆ Sum()

template<typename T >
static Self& CORE_StdValArray< T >::Sum ( const Self Ain,
Self Aout 
)
inlinestatic

sum the element of the 2 arrays

Parameters
[in]Ain: array to add
[out]Aout: array to add and to store the results
Returns
Aout

◆ sum()

template<typename T >
void CORE_StdValArray< T >::sum ( T &  s) const
inline

return the sum of all the elements

Parameters
[out]sscalar product

◆ transform() [1/3]

template<typename T >
template<typename LambdaFct >
void CORE_StdValArray< T >::transform ( LambdaFct &&  F)
inline

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

Template Parameters
LambdaFct: lambda function signature
Parameters
[in]F: lambda function with one variable

◆ transform() [2/3]

template<typename T >
template<typename LambdaFct >
void CORE_StdValArray< T >::transform ( LambdaFct &&  F,
const CORE_Array< T, Self > &  X 
)
inline

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

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

◆ transform() [3/3]

template<typename T >
template<typename LambdaFct >
void CORE_StdValArray< T >::transform ( LambdaFct &&  F,
const CORE_Array< T, Self > &  X,
const CORE_Array< T, Self > &  Y 
)
inline

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

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

◆ Transform() [1/3]

template<typename T >
template<typename LambdaFct >
static void CORE_StdValArray< T >::Transform ( LambdaFct &&  F,
const CORE_Array< T, Self > &  X,
const CORE_Array< T, Self > &  Y,
Self R 
)
inlinestatic

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

Template Parameters
LambdaFct: lambda function signature
Parameters
[in]F: lambda function with one variable
[in]X: first argument of F
[in]Y: second argument of F
[out]R: result value

◆ Transform() [2/3]

template<typename T >
template<typename LambdaFct >
static void CORE_StdValArray< T >::Transform ( LambdaFct &&  F,
const CORE_Array< T, Self > &  X,
Self R 
)
inlinestatic

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

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

◆ Transform() [3/3]

template<typename T >
template<typename LambdaFct >
static void CORE_StdValArray< T >::Transform ( LambdaFct &&  F,
Self R 
)
inlinestatic

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

Template Parameters
LambdaFct: lambda function signature
Parameters
[in]F: lambda function with one variable
[in,out]R: argument of F

◆ uniformRandomize()

template<typename T >
void CORE_StdValArray< T >::uniformRandomize ( const T &  min,
const T &  max 
)
inline

randomize the vector in [min,max]

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

◆ UniformRandomize() [1/3]

template<typename T >
template<size_t N>
static void CORE_StdValArray< T >::UniformRandomize ( const T &  min,
const T &  max,
std::array< T, N > &  values 
)
inlinestatic

generate a random val array

Template Parameters
N: number of values
Parameters
[in]minmin value of the random
[in]max: max value of the random
[in,out]valuesthe randomized val array

◆ UniformRandomize() [2/3]

template<typename T >
static void CORE_StdValArray< T >::UniformRandomize ( const T &  min,
const T &  max,
std::valarray< T > &  values 
)
inlinestatic

generate a random val array

Parameters
[in]minmin value of the random
[in]max: max value of the random
[in,out]valuesthe randomized val array

◆ UniformRandomize() [3/3]

template<typename T >
static void CORE_StdValArray< T >::UniformRandomize ( const T &  min,
const T &  max,
std::vector< T > &  values 
)
inlinestatic

generate a random val array

Parameters
[in]minmin value of the random
[in]max: max value of the random
[in,out]valuesthe randomized val array

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