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

this class describes a standart arithmetic array type implemented with a std::valarray object of type T parallelize with openmp module More...

#include <OMP_ValArray.h>

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

Public Member Functions

 OMP_ValArray ()
 build an instance of class
 
 OMP_ValArray (const tIndex &n)
 build an instance of class of size n More...
 
virtual ~OMP_ValArray ()
 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>
Selfoperator= (const std::array< T, N > &values)
 build an array by a copy of c More...
 
Selfoperator= (const std::valarray< T > &values)
 build an array by a copy of c More...
 
Selfoperator= (const std::vector< T > &values)
 build an array by a copy of c More...
 
Selfoperator= (const Self &values)
 build an array by a copy of c More...
 
Selfoperator= (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 > &X)
 copy the container More...
 
template<typename Q , class I >
void copy (CORE_ValArray< Q, I > &&X)
 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 Initialize (const T &x, std::valarray< T > &values)
 initialize the array to the value x More...
 
void uniformRandomize (const T &min, const T &max)
 randomize the vector in [min,max] More...
 
OMP_ValArray< T > & operator+= (const T &v)
 add operator More...
 
OMP_ValArray< T > & operator-= (const T &v)
 sub operator More...
 
OMP_ValArray< T > & operator*= (const T &v)
 multiplicator operator More...
 
OMP_ValArray< T > & operator/= (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 More...
 
template<typename Q , class I >
Selfoperator*= (const CORE_Array< Q, I > &X)
 array multiply operator More...
 
template<typename Q , class I >
Selfoperator/= (const CORE_Array< Q, I > &X)
 array divisor operator More...
 
template<typename LambdaFct >
void transform (LambdaFct &&F)
 transform the transform element in parallel to 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 in parallel to 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...
 
norm2 () const
 compute the norm 2 of the array 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...
 
tBoolean isNANContained () const
 return true if one value is Not A Number More...
 
template<typename Q , class I >
T & scalarProduct (const CORE_Array< Q, I > &X, T &s) const
 return the scalar product 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...
 
tReal l2Norm2 () const
 compute the square of L2-norm of this More...
 
template<typename Q , class I >
tReal l2Distance2 (const CORE_Array< Q, I > &X) const
 compute the square of L2-distance of this to X More...
 
tReal linfNorm (tIndex &imax) const
 compute the Linf-norm of this More...
 
template<typename Q , class I >
tReal linfDistance (const CORE_Array< Q, I > &X, tIndex &imax) const
 compute the square of L2-distance of this to X More...
 
- Public Member Functions inherited from CORE_ValArray< T, OMP_ValArray< 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, OMP_ValArray< 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 unique pointer of the class More...
 
template<typename Q , class I >
static void Copy (const CORE_Array< Q, I > &X, std::valarray< T > &R)
 copy 2 std::valarray with different type More...
 
template<typename Q >
static void Copy (const std::valarray< Q > &X, std::valarray< T > &R)
 copy 2 std::valarray with different type More...
 
template<typename Q >
static void Copy (const std::valarray< T > &X, std::valarray< T > &R)
 copy 2 std::valarray with same type : no parallelization : faster with the intrinsect method More...
 
template<typename Q >
static void Copy (const tIndex &n, const std::valarray< Q > &X, std::valarray< T > &R)
 copy the the n first values of a valarray More...
 
template<typename Q >
static void Copy (const tIndex &n, const std::vector< Q > &X, std::valarray< T > &R)
 copy the the n first values of an initializer More...
 
static void Copy (const tIndex &n, const std::initializer_list< T > &X, std::valarray< T > &R)
 copy the the n first values of an initializer More...
 
static void Copy (const tIndex &n, std::initializer_list< T > &&X, std::valarray< T > &R)
 copy the the n first values of an initializer More...
 
template<typename Q >
requires static functions_type::isArithmeticType< Q > void Copy (const tIndex &n, const Q *X, std::valarray< T > &R)
 copy the n values of a pointers array More...
 
static void UniformRandomize (const T &min, const T &max, std::valarray< T > &values)
 generate a random val array More...
 
template<typename LambdaFct >
static void Transform (LambdaFct &&F, Self &X)
 transform the transform element with the lambda function Xi = F(const Xi) More...
 
template<typename LambdaFct >
static void Transform (LambdaFct &&F, const CORE_Array< T, Self > &X, Self &R)
 transform 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)
 transform the transform element with the lambda function Ri = F(const Xi,const Yi) More...
 
template<typename Q >
static tReal L2Distance2 (const tIndex &nX, const Q *Xs, const std::valarray< T > &Y)
 compute the square of L2 distance of X to Y More...
 
template<typename Q >
static tReal LinfDistance (const tIndex &nX, const Q *Xs, const std::valarray< T > &Y, tIndex &imax)
 compute the index of the array where the module of the difference between X & Y is max 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<class T>
class OMP_ValArray< T >

this class describes a standart arithmetic array type implemented with a std::valarray object of type T parallelize with openmp module

Template Parameters
T: type of elements of the array

Constructor & Destructor Documentation

◆ OMP_ValArray()

template<class T >
OMP_ValArray< T >::OMP_ValArray ( const tIndex &  n)
inlineexplicit

build an instance of class of size n

Parameters
[in]nsize of the array

Member Function Documentation

◆ axpy()

template<class T >
template<typename Q , class I >
void OMP_ValArray< 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
I: implemented class of X
Parameters
[in]alphaalpha parameter
[in]XX array
[in]beta: beta parameter

◆ copy() [1/12]

template<class T >
template<typename Q , class I >
void OMP_ValArray< 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/8]

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

copy 2 std::valarray with different type

Template Parameters
Q: type of X
I: implemented class of X
Parameters
[in]X: the values to copy
[out]R: the copied values

◆ copy() [2/12]

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

copy the container

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

◆ copy() [3/12]

template<class T >
void OMP_ValArray< T >::copy ( const Self cpy)
inline

copy the container

Parameters
[in]cpy: container to copy

◆ Copy() [2/8]

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

copy 2 std::valarray with different type

Template Parameters
Q: type of X
Parameters
[in]X: the values to copy
[out]R: the copied values

◆ Copy() [3/8]

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

copy 2 std::valarray with same type : no parallelization : faster with the intrinsect method

Template Parameters
Q: type of X
Parameters
[in]X: the values to copy
[out]R: the copied values

◆ copy() [4/12]

template<class T >
template<typename Q >
void OMP_ValArray< 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 Vs
Parameters
[in]n:number of elements to copy
[in]Vs: values of the array

◆ Copy() [4/8]

template<class T >
template<typename Q >
requires static functions_type::isArithmeticType<Q> void OMP_ValArray< T >::Copy ( const tIndex &  n,
const Q *  X,
std::valarray< T > &  R 
)
inlinestatic

copy the n values of a pointers array

Template Parameters
Q: type of X
Parameters
[in]n: number of values
[in]Xthe values to copy of size greater than n
[out]R: the copied values

◆ copy() [5/12]

template<class T >
template<typename Q , size_t N>
void OMP_ValArray< 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
N: number of elements of Vs
Parameters
[in]n:number of elements to copy
[in]Vs: values of the array

◆ copy() [6/12]

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

initialize the array to the values of list

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

◆ Copy() [5/8]

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

copy the the n first values of an initializer

Template Parameters
Q: type of X
Parameters
[in]n: values to copy
[in]X: the values to copy
[out]R: the copied values Using pointers loop

◆ copy() [7/12]

template<class T >
template<typename Q >
void OMP_ValArray< 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 elements to copy
[in]Vs: values of the array

◆ Copy() [6/8]

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

copy the the n first values of a valarray

Template Parameters
Q: type of X
Parameters
[in]n: values to copy
[in]X: the values to copy
[out]R: the copied values Using pointers loop

◆ copy() [8/12]

template<class T >
template<typename Q >
void OMP_ValArray< 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 elements to copy
[in]Vs: values of the array

◆ Copy() [7/8]

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

copy the the n first values of an initializer

Template Parameters
Q: type of X
Parameters
[in]n: values to copy
[in]X: the values to copy
[out]R: the copied values Using pointers loop

◆ copy() [9/12]

template<class T >
void OMP_ValArray< 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() [8/8]

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

copy the the n first values of an initializer

Template Parameters
Q: type of X
Parameters
[in]n: values to copy
[in]X: the values to copy
[out]R: the copied values Using pointers loop

◆ copy() [10/12]

template<class T >
template<typename Q , class I >
void OMP_ValArray< 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<class T >
template<typename Q , class I >
void OMP_ValArray< T >::copy ( CORE_ValArray< Q, I > &&  X)
inline

copy the conatiner : mv is destroyed after this

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

◆ copy() [12/12]

template<class T >
void OMP_ValArray< T >::copy ( Self &&  cpy)
inline

copy the conatiner : mv is destroyed after this

Parameters
[in]cpy:container to move

◆ getMemorySize()

template<class T >
virtual tMemSize OMP_ValArray< 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, OMP_ValArray< T > >.

◆ initialize()

template<class T >
void OMP_ValArray< T >::initialize ( const T &  x)
inline

initialize the array to the value x

Parameters
[in]xconstant value

using the for loop

◆ Initialize()

template<class T >
void OMP_ValArray< T >::Initialize ( const T &  x,
std::valarray< T > &  values 
)
inline

initialize the array to the value x

Parameters
[in]xconstant value
[out]valuesarray to initialize

using the for loop

◆ isNANContained()

template<class T >
tBoolean OMP_ValArray< T >::isNANContained ( ) const
inline

return true if one value is Not A Number

Returns
false if all the values is a Number

◆ l2Distance2()

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

compute the square of L2-distance of this to X

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

◆ L2Distance2()

template<class T >
template<typename Q >
static tReal OMP_ValArray< T >::L2Distance2 ( const tIndex &  nX,
const Q *  Xs,
const std::valarray< T > &  Y 
)
inlinestatic

compute the square of L2 distance of X to Y

Template Parameters
Q: type of X
Parameters
[in]nX: number of values of X
[in]Xsthe values of array X to compute the distance
[in]Ythe values of array Y to compute the distance
Returns
the L2-distance squared \( \sum_i |Y_i-X_i|^2 \)

◆ l2Norm2()

template<class T >
tReal OMP_ValArray< T >::l2Norm2 ( ) const
inline

compute the square of L2-norm of this

Returns
the L2-norm sqaured : \( s=\sum_i |T_i|^2 \)

◆ linfDistance()

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

compute the square of L2-distance of this to X

Template Parameters
Q: type of X
I: timplemented class of X
Parameters
[in]Xthe array to compute the distance
[out]imaxindex of the max element
Returns
the L2-Distance squared \( \sum_i |T_i-X_i|^2 \)

◆ LinfDistance()

template<class T >
template<typename Q >
static tReal OMP_ValArray< T >::LinfDistance ( const tIndex &  nX,
const Q *  Xs,
const std::valarray< T > &  Y,
tIndex &  imax 
)
inlinestatic

compute the index of the array where the module of the difference between X & Y is max

Template Parameters
Q: type of X
Parameters
[in]nX: number of values of X
[in]Xsvalues of array X
[in]Yvalues of array Y
[out]imaxthe index where the module is max
Returns
the max of the module

◆ linfNorm()

template<class T >
tReal OMP_ValArray< T >::linfNorm ( tIndex &  imax) const
inline

compute the Linf-norm of this

Parameters
[out]imax: indexof the maximum element
Returns
the Linf-norm \( imax=argmax(|T_i|) \)

◆ New()

template<class T >
static CORE_UniquePointer<Self> OMP_ValArray< T >::New ( )
inlinestatic

return a unique pointer of the class

Returns
an unique pointer of the class

◆ norm2()

template<class T >
T OMP_ValArray< T >::norm2 ( ) const
inline

compute the norm 2 of the array

Returns
the sum_i V_i^2

◆ operator%=()

template<class T >
Self& OMP_ValArray< 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]vright shift value

array add operator

Template Parameters
Q: type of X
I: implemented class of X
Parameters
[in]Xarray to add

◆ operator*=() [1/2]

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

array multiply operator

Template Parameters
Q: type of X
I: impleme,ted class of X
Parameters
[in]Xarray to multiply use a transform method

◆ operator*=() [2/2]

template<class T >
OMP_ValArray<T>& OMP_ValArray< T >::operator*= ( const T &  v)
inline

multiplicator operator

Parameters
[in]vmultiplicator value

◆ operator+=()

template<class T >
OMP_ValArray<T>& OMP_ValArray< T >::operator+= ( const T &  v)
inline

add operator

Parameters
[in]vadd value

◆ operator-=() [1/2]

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

array sub operator

Template Parameters
Q: type of X
I: impleme,ted class of X
Parameters
[in]Xarray to sub Use transform method

◆ operator-=() [2/2]

template<class T >
OMP_ValArray<T>& OMP_ValArray< T >::operator-= ( const T &  v)
inline

sub operator

Parameters
[in]vsub value

◆ operator/=() [1/2]

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

array divisor operator

Template Parameters
Q: type of X
I: impleme,ted class of X
Parameters
[in]Xarray to divide use a transform method

◆ operator/=() [2/2]

template<class T >
OMP_ValArray<T>& OMP_ValArray< T >::operator/= ( const T &  v)
inline

divisor operator

Parameters
[in]vdivisor value

◆ operator=() [1/10]

template<class T >
template<typename Q , class I1 >
Self& OMP_ValArray< 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
I1: implemented class of values
Parameters
[in]valuesvalues to copy

◆ operator=() [2/10]

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

build an array by a copy of c

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

◆ operator=() [3/10]

template<class T >
Self& OMP_ValArray< T >::operator= ( const Self values)
inline

build an array by a copy of c

Parameters
[in]valuesvalues to copy

◆ operator=() [4/10]

template<class T >
template<size_t N>
Self& OMP_ValArray< T >::operator= ( const std::array< T, N > &  values)
inline

build an array by a copy of c

Template Parameters
Nnumber of elements of values
Parameters
[in]valuesvalues to copy

◆ operator=() [5/10]

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

build an array by a copy of c

Parameters
[in]valuesvalues to copy

◆ operator=() [6/10]

template<class T >
Self& OMP_ValArray< T >::operator= ( const std::valarray< T > &  values)
inline

build an array by a copy of c

Parameters
[in]valuesvalues to copy

◆ operator=() [7/10]

template<class T >
Self& OMP_ValArray< T >::operator= ( const std::vector< T > &  values)
inline

build an array by a copy of c

Parameters
[in]valuesvalues to copy

◆ operator=() [8/10]

template<class T >
Self& OMP_ValArray< T >::operator= ( const T &  v)
inline

fill the values of the array with v

Parameters
[in]v: value to fill

◆ operator=() [9/10]

template<class T >
Self& OMP_ValArray< T >::operator= ( Self &&  values)
inline

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

Parameters
[in]valuesvalues to copy

◆ operator=() [10/10]

template<class T >
Self& OMP_ValArray< T >::operator= ( std::initializer_list< T > &&  values)
inline

build an array by a copy of c

Parameters
[in]valuesvalues to copy

◆ prod()

template<class T >
void OMP_ValArray< T >::prod ( T &  p) const
inline

return the produc of all the elements

Parameters
[out]pthe product of all the elements

◆ scalarProduct()

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

return the scalar product

Template Parameters
Q: type of X
I: implemented class of X
Parameters
[in]X: argument vector
[out]sscalar product with the same value as returned
Returns
the value of <T,X>

◆ sum()

template<class T >
void OMP_ValArray< T >::sum ( T &  s) const
inline

return the sum of all the elements

Parameters
[out]ssum of elements

◆ transform() [1/3]

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

transform the transform element in parallel to the lambda function Ti=F(const Ti)

Template Parameters
LambdaFct: lambda function definition
Parameters
[in]F: lambda function

◆ transform() [2/3]

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

transform the transform element in parallel to the lambda function Ti=F(const Xi)

Template Parameters
LambdaFct: lambda function definition
Parameters
[in]F: lambda function
[in]X: first argument of F

◆ transform() [3/3]

template<class T >
template<typename LambdaFct >
void OMP_ValArray< 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 definition
Parameters
[in]F: lambda function with one variable
[in]X: first argument of F
[in]Y: second argument of F

◆ Transform() [1/3]

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

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

Template Parameters
LambdaFct: lambda function definition
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<class T >
template<typename LambdaFct >
static void OMP_ValArray< T >::Transform ( LambdaFct &&  F,
const CORE_Array< T, Self > &  X,
Self R 
)
inlinestatic

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

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

◆ Transform() [3/3]

template<class T >
template<typename LambdaFct >
static void OMP_ValArray< T >::Transform ( LambdaFct &&  F,
Self X 
)
inlinestatic

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

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

◆ uniformRandomize()

template<class T >
void OMP_ValArray< 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()

template<class T >
static void OMP_ValArray< 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

It uses the drand method which is thread safe


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