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

this class describes a standart arithmetic array type implemented with a memory allocation with type T. More...

#include <CORE_StdPtrArray.h>

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

Public Member Functions

 CORE_StdPtrArray ()
 build an instance of class
 
 CORE_StdPtrArray (const CORE_PtrArray< T, Self > &c)
 build an instance of class
 
virtual ~CORE_StdPtrArray ()
 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 > &cpy)
 copy the container More...
 
template<typename Q , class I >
void copy (CORE_Array< Q, I > &&cpy)
 copy the conatiner : mv is destroyed after this More...
 
template<class I >
void copy (const Self &cpy)
 copy the container More...
 
template<class I >
void copy (Self &&cpy)
 copy the container : 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 &v)
 randomize the field 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...
 
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 >
void AXPY (const tIndex &n, const Q &alpha, const Q *X, const T &beta, T *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 &prod) const
 return the produc 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
 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 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_PtrArray< T, CORE_StdPtrArray< T > >
 CORE_PtrArray ()
 build an array of T*
 
virtual ~CORE_PtrArray ()
 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
 
void fitToSize (tInteger size)
 modify the size of the array More...
 
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...
 
const T * getValues () const
 get the values of the array for reading More...
 
T * getValues ()
 get the values of the array 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...
 
void swap (CORE_PtrArray< T, I1 > &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...
 
template<typename Q >
static void Copy (const tIndex &n, const Q *X, T *R)
 copy the first n values of a values More...
 
template<typename Q >
static void Copy (const tIndex &n, const std::vector< Q > &X, T *R)
 copy the first n values of a values More...
 
static void Copy (const tIndex &n, std::initializer_list< T > X, T *R)
 copy the first n values of a values More...
 
static void UniformRandomize (const T &min, const T &max, const tIndex &n, T *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...
 
template<typename Q >
static void Add (const Q &X, const tIndex &n, T *R)
 mulitply method : R:=R+X More...
 
template<typename Q >
static void Add (const tIndex &n, const Q *X, T *R)
 mulitply method : R:=R+X More...
 
template<typename Q >
static void Sub (const tIndex &n, const Q *X, T *R)
 mulitply method : R:=R-X More...
 
template<typename Q >
requires static functions_type::isArithmeticType< Q > void Multiply (const Q &X, const tIndex &n, T *R)
 mulitply method : R:=R*X More...
 
template<typename Q >
static void Multiply (const tIndex &n, const Q *X, T *R)
 multiply method : R:=R*X More...
 
template<typename Q >
static void Divide (const tIndex &n, const Q *X, T *R)
 divide method : R:=R/X More...
 
template<typename Q , size_t N>
static void Normalize (std::array< Q, N > &a)
 normalize the array More...
 
static void Normalize (const tIndex &n, T *values)
 normalize the array More...
 
static tBoolean IsNANContained (const tIndex &n, const T *values)
 return true if one value is Not A Number More...
 
static T Sum (const tIndex &n, const T *values)
 return the sum of all the elements More...
 
static T Prod (const tIndex &n, const T *values)
 return the produc of all the elements More...
 
template<typename Q >
static T ScalarProduct (const tIndex n, const Q *X, const T *Y)
 return the scalar product <X,Y> More...
 
template<typename Q >
static tReal L2Distance2 (const tIndex &nX, const Q *Xs, const tIndex &nY, const T *Ys)
 compute the square of L2 distance of X to Y More...
 
template<typename Q >
static tReal LinfDistance (const tIndex &nX, const Q *Xs, const tIndex &nY, const T *Ys, tIndex &imax)
 compute the L-inf distance of X to Y 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_PtrArray< T, CORE_StdPtrArray< T > >
void desallocate ()
 allocate the array
 
virtual T * newAllocation (const tIndex &n) const
 create a memory allocation More...
 
virtual void deleteAllocation (T *&mem) const
 delete a memory allocation More...
 
- 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_StdPtrArray< T >

this class describes a standart arithmetic array type implemented with a memory allocation with type T.

Member Function Documentation

◆ Add() [1/2]

template<typename T >
template<typename Q >
static void CORE_StdPtrArray< T >::Add ( const Q &  X,
const tIndex &  n,
T *  R 
)
inlinestatic

mulitply method : R:=R+X

Parameters
[in]XX constant value
[in]n: size of R
[in,out]Rresult array R=R+X;

◆ Add() [2/2]

template<typename T >
template<typename Q >
static void CORE_StdPtrArray< T >::Add ( const tIndex &  n,
const Q *  X,
T *  R 
)
inlinestatic

mulitply method : R:=R+X

Parameters
[in]n: min size of X & R
[in]XX array
[in,out]Rresult array R=R+X;

◆ axpy()

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

compute This=beta.This+ alpha .X

Template Parameters
Qtype of X and alpha
Inumber of elements of X
Parameters
[in]alphaalpha parameter
[in]XX array
[in]beta: beta parameter

◆ AXPY()

template<typename T >
template<typename Q >
void CORE_StdPtrArray< T >::AXPY ( const tIndex &  n,
const Q &  alpha,
const Q *  X,
const T &  beta,
T *  Y 
)
inline

compute Y=beta.Y+ alpha .X

Template Parameters
Qtype of X and alpha
Parameters
[in]n: common size of X & Y
[in]alphaalpha parameter
[in]XX array
[in]beta: beta parameter
[in,out]Y: Y array

◆ copy() [1/10]

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

copy the container

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

◆ copy() [2/10]

template<typename T >
template<class I >
void CORE_StdPtrArray< T >::copy ( const Self cpy)
inline

copy the container

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

◆ copy() [3/10]

template<typename T >
template<typename Q >
void CORE_StdPtrArray< 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 values to copy
[in]Vs: values of the array of size >=n

◆ Copy() [1/3]

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

copy the first n values of a values

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

Uses the pointers loop

◆ copy() [4/10]

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

◆ copy() [5/10]

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

◆ copy() [6/10]

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

◆ copy() [7/10]

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

◆ Copy() [2/3]

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

copy the first n values of a values

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

Uses the pointers loop

◆ copy() [8/10]

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

initialize the array to the values of list

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

◆ Copy() [3/3]

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

copy the first n values of a values

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

Uses the pointers loop

◆ copy() [9/10]

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

copy the conatiner : mv is destroyed after this

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

◆ copy() [10/10]

template<typename T >
template<class I >
void CORE_StdPtrArray< T >::copy ( Self &&  cpy)
inline

copy the container : mv is destroyed after this

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

◆ Divide()

template<typename T >
template<typename Q >
static void CORE_StdPtrArray< T >::Divide ( const tIndex &  n,
const Q *  X,
T *  R 
)
inlinestatic

divide method : R:=R/X

Template Parameters
Qtype of X
Parameters
[in]n: min size of X & R
[in]XX array
[in,out]Rresult array R=R/X;

◆ getMemorySize()

template<typename T >
virtual tMemSize CORE_StdPtrArray< 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_PtrArray< T, CORE_StdPtrArray< T > >.

◆ initialize()

template<typename T >
void CORE_StdPtrArray< T >::initialize ( const T &  v)
inline

randomize the field

Parameters
[in]v: constant initial value

◆ isNANContained()

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

return true if one value is Not A Number

Returns
false if all the values is a Number

◆ IsNANContained()

template<typename T >
static tBoolean CORE_StdPtrArray< T >::IsNANContained ( const tIndex &  n,
const T *  values 
)
inlinestatic

return true if one value is Not A Number

Parameters
[in]n: number of values
[in]valuesvalues
Returns
false if all the values is a Number

◆ l2Distance2()

template<typename T >
template<typename Q , class I >
tReal CORE_StdPtrArray< 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: implement 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<typename T >
template<typename Q >
static tReal CORE_StdPtrArray< T >::L2Distance2 ( const tIndex &  nX,
const Q *  Xs,
const tIndex &  nY,
const T *  Ys 
)
inlinestatic

compute the square of L2 distance of X to Y

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

◆ l2Norm2()

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

compute the square of L2-Norm of this

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

◆ linfDistance() [1/2]

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

compute the L infinity distance of this to X

Template Parameters
Qtype of X
Inumber of elements of X
Parameters
[in]Xthe array to compute the distance
[out]imaxindex where the norm is max
Returns
the Linf-norm \( i_{max}=argmax_i |T_i-X_i| \)

◆ LinfDistance()

template<typename T >
template<typename Q >
static tReal CORE_StdPtrArray< T >::LinfDistance ( const tIndex &  nX,
const Q *  Xs,
const tIndex &  nY,
const T *  Ys,
tIndex &  imax 
)
inlinestatic

compute the L-inf distance of X to Y

Template Parameters
Qtype of X
Parameters
[in]nX: number of values of X
[in]Xsthe values of array to compute the distance
[in]nY: number of values of Y
[in]Ysthe values of array to compute the distance
[out]imax: index of the max value
Returns
the Linf-distance imax=argmax(|Y_i-X_i|)

◆ linfDistance() [2/2]

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

compute the L infinity norm of This

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

◆ Multiply() [1/2]

template<typename T >
template<typename Q >
requires static functions_type::isArithmeticType<Q> void CORE_StdPtrArray< T >::Multiply ( const Q &  X,
const tIndex &  n,
T *  R 
)
inlinestatic

mulitply method : R:=R*X

Template Parameters
Qtype of X
Parameters
[in]XX constant value
[in]n: size of R
[in,out]Rresult array R=R*X;

◆ Multiply() [2/2]

template<typename T >
template<typename Q >
static void CORE_StdPtrArray< T >::Multiply ( const tIndex &  n,
const Q *  X,
T *  R 
)
inlinestatic

multiply method : R:=R*X

Template Parameters
Qtype of X
Parameters
[in]n: min size of X & R
[in]XX array
[in,out]Rresult array R=R*X;

◆ New()

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

return a new unique pointer of this

Returns
an unqie pointer of this class

◆ Normalize() [1/2]

template<typename T >
static void CORE_StdPtrArray< T >::Normalize ( const tIndex &  n,
T *  values 
)
inlinestatic

normalize the array

Parameters
[in]n:number of values
[in,out]values: values to normalize

◆ Normalize() [2/2]

template<typename T >
template<typename Q , size_t N>
static void CORE_StdPtrArray< T >::Normalize ( std::array< Q, N > &  a)
inlinestatic

normalize the array

Template Parameters
Qtype of X
Nnumber of elements of X
Parameters
[in,out]aarray to normalize

◆ operator%=()

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

modulo operator

Parameters
[in]v: modulo value

and operator

Parameters
[in]v: and value

or operator

Parameters
[in]v: and value

complementary operator

Parameters
[in]v: complementary value

left shift operator

Parameters
[in]v: left shift value

right shift operator

Parameters
[in]v: left shift value

array add operator : This +=X

Parameters
[in]Xargument array

◆ operator*=() [1/2]

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

array multiply operator This*=X

Parameters
[in]Xarray argument use a pointers loop

◆ operator*=() [2/2]

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

multiplicator operator

Parameters
[in]v: multiplicator value

◆ operator+=()

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

add operator

Parameters
[in]v:add value

◆ operator-=() [1/2]

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

array sub operator : This -=X

Parameters
[in]Xarray to multiply * Use trnsform method

◆ operator-=() [2/2]

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

sub operator

Parameters
[in]v:sub value

◆ operator/=() [1/2]

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

array divisor operator This/=X

Parameters
[in]Xarray to divide use a trsnform method

◆ operator/=() [2/2]

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

divisor operator

Parameters
[in]v: divisor value

◆ operator=() [1/10]

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

◆ operator=() [2/10]

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

build an array by a copy of c

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

◆ operator=() [3/10]

template<typename T >
Self& CORE_StdPtrArray< 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_StdPtrArray< 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_StdPtrArray< T >::operator= ( const std::array< Q, N > &  values)
inline

build an array by a copy of c

Template Parameters
Nsize of values
Qtype of values
Parameters
[in]valuesvalues to copy

◆ operator=() [6/10]

template<typename T >
Self& CORE_StdPtrArray< 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_StdPtrArray< T >::operator= ( const std::valarray< Q > &  values)
inline

build an array by a copy of c

Template Parameters
Qtype of values
Parameters
[in]valuesvalues to copy

◆ operator=() [8/10]

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

build an array by a copy of c

Template Parameters
Qtype of values
Parameters
[in]valuesvalues to copy

◆ operator=() [9/10]

template<typename T >
Self& CORE_StdPtrArray< 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_StdPtrArray< 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 >
static T CORE_StdPtrArray< T >::Prod ( const tIndex &  n,
const T *  values 
)
inlinestatic

return the produc of all the elements

Parameters
[in]n: number of values
[in]valuesvalues to make the product
Returns
the product of all the elements

◆ prod()

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

return the produc of all the elements

Parameters
[out]prodthe product of all the elements

◆ scalarProduct()

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

return the scalar product

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

◆ ScalarProduct()

template<typename T >
template<typename Q >
static T CORE_StdPtrArray< T >::ScalarProduct ( const tIndex  n,
const Q *  X,
const T *  Y 
)
inlinestatic

return the scalar product <X,Y>

Template Parameters
Q: type of X,Y
Parameters
[in]n: number of X and Y values
[in]X: argument vector
[in]Y: argument vector
Returns
the value of \( <T,X>=\sum_{i=0}^{N-1} T_i.A_i \)

◆ Sub()

template<typename T >
template<typename Q >
static void CORE_StdPtrArray< T >::Sub ( const tIndex &  n,
const Q *  X,
T *  R 
)
inlinestatic

mulitply method : R:=R-X

Template Parameters
Qtype of X
Parameters
[in]n: min size of X & R
[in]XX array
[in,out]Rresult array R=R-X;

◆ Sum()

template<typename T >
static T CORE_StdPtrArray< T >::Sum ( const tIndex &  n,
const T *  values 
)
inlinestatic

return the sum of all the elements

Parameters
[in]n: number of values
[in]valuesvalues to sum
Returns
the sum of all the elements

◆ sum()

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

return the sum of all the elements

Parameters
[out]sthe sum of all the elements

◆ transform() [1/3]

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

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

Parameters
[in]F: lambda function with one variable

◆ transform() [2/3]

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

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

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

◆ transform() [3/3]

template<typename T >
template<typename LambdaFct >
void CORE_StdPtrArray< 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)

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

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

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_StdPtrArray< T >::Transform ( LambdaFct &&  F,
Self R 
)
inlinestatic

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

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

◆ uniformRandomize()

template<typename T >
void CORE_StdPtrArray< 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<typename T >
static void CORE_StdPtrArray< T >::UniformRandomize ( const T &  min,
const T &  max,
const tIndex &  n,
T *  values 
)
inlinestatic

generate a random val array

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

end iterator


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