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

this class define a PTR array with OpenMP vectorization More...

#include <OMP_PtrArray.h>

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

Public Member Functions

 OMP_PtrArray ()
 build an instance of class
 
 OMP_PtrArray (const tIndex &n)
 build an instance of class of size n More...
 
virtual ~OMP_PtrArray ()
 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= (std::initializer_list< T > &&values)
 build an array by a copy of c More...
 
Selfoperator= (const 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 > &cpy)
 copy the container More...
 
template<typename Q , class I >
void copy (CORE_Array< Q, I > &&cpy)
 copy the container : 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 &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 > &v)
 array sub operator More...
 
template<typename Q , class I >
Selfoperator*= (const CORE_Array< Q, I > &v)
 array multiply operator More...
 
template<typename Q , class I >
Selfoperator/= (const CORE_Array< Q, I > &v)
 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...
 
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 &p) 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 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_PtrArray< T, OMP_PtrArray< 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 unique pointer of the class More...
 
template<class Q >
static void Copy (const tIndex &n, const Q *X, T *R)
 copy the n values of a pointers array More...
 
template<typename Q >
static void Copy (const tIndex &n, const std::vector< Q > &X, T *R)
 copy the the n first values of an initializer More...
 
static void Copy (const tIndex &n, const std::initializer_list< T > &X, T *R)
 copy the the n first values of an initializer More...
 
static void Copy (const tIndex &n, std::initializer_list< T > &&X, T *R)
 copy the the n first values of an initializer More...
 
static void Initialize (const T &v, const tIndex &n, T *R)
 copy the n values of a pointers array More...
 
static void UniformRandomize (const T &min, const T &max, const tIndex &n, T *values)
 randomize the vector in [0,max] 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 void Add (const Q &v, const tIndex &n, T *values)
 add to the values the constant v More...
 
template<typename Q >
static void Add (const tIndex &n, const Q *Y, T *X)
 compute X+=Y More...
 
template<typename Q >
static void Sub (const tIndex &n, const Q *Y, T *X)
 compute X-=Y More...
 
template<typename Q >
static void Multiply (const Q &v, const tIndex &n, T *values)
 multiply the values by the constant v More...
 
template<typename Q >
static void Multiply (const tIndex &n, const Q *Y, T *X)
 compute X*=Y More...
 
template<typename Q >
static void Divide (const tIndex &n, const Q *Y, T *X)
 compute X/=Y More...
 
static T norm2 (const tIndex &n, const T *values)
 computes the square of norm of the \(L_2 \) norm 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 product of all the elements More...
 
template<typename Q >
static T ScalarProduct (const tIndex &n, const Q *X, const T *Y)
 return the sclar product 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 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_PtrArray< T, OMP_PtrArray< 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<class T>
class OMP_PtrArray< T >

this class define a PTR array with OpenMP vectorization

<< NOTE

Template Parameters
T: type of the element of the array

Constructor & Destructor Documentation

◆ OMP_PtrArray()

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

build an instance of class of size n

Parameters
[in]nsize of the array

Member Function Documentation

◆ Add() [1/2]

template<class T >
template<typename Q >
static void OMP_PtrArray< T >::Add ( const Q &  v,
const tIndex &  n,
T *  values 
)
inlinestatic

add to the values the constant v

Template Parameters
Q: type of v
Parameters
[in]v: constant to add
[in]n: size of values
[in,out]values: values to be added

◆ Add() [2/2]

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

compute X+=Y

Template Parameters
Q: type of v
Parameters
[in]n: min size of X and Y
[in]Y: values to add
[in,out]X: X+=Y

◆ axpy()

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

◆ AXPY()

template<class T >
template<typename Q >
void OMP_PtrArray< 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 values 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<class T >
template<typename Q , class I >
void OMP_PtrArray< T >::copy ( const CORE_Array< Q, I > &  cpy)
inline

copy the container

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

◆ copy() [2/10]

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

copy the container

Template Parameters
Iimplemented class of cpy
Parameters
[in]cpy: container to copy

◆ copy() [3/10]

template<class T >
template<typename Q >
void OMP_PtrArray< 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/4]

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

copy the n values of a pointers array

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

◆ copy() [4/10]

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

◆ Copy() [2/4]

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

copy the the n first values of an initializer

Parameters
[in]n: values to copy
[in]X: the values to copy
[out]R: the copied values Using pointers loop . R is supposed to have a size of n

◆ copy() [6/10]

template<class T >
template<typename Q >
void OMP_PtrArray< 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<class T >
template<typename Q >
void OMP_PtrArray< 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() [3/4]

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

copy the the n first values of an initializer

Template Parameters
Q: type of Vs
Parameters
[in]n: values to copy
[in]X: the values to copy
[out]R: the copied values Using pointers loop . R is supposed to have a size of n

◆ copy() [8/10]

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

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

copy the the n first values of an initializer

Parameters
[in]n: values to copy
[in]X: the values to copy
[out]R: the copied values Using pointers loop . R is supposed to have a size of n

◆ copy() [9/10]

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

copy the container : mv is destroyed after this

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

◆ copy() [10/10]

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

copy the container : mv is destroyed after this

Template Parameters
Iimplemented class of cpy
Parameters
[in]cpy:container to move

◆ Divide()

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

compute X/=Y

Template Parameters
Q: type of v
Parameters
[in]n: min size of X and Y
[in]Y: values
[in,out]X: X/=Y

Thrwos an excpetion if Y is null at an element

◆ getMemorySize()

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

◆ Initialize()

template<class T >
static void OMP_PtrArray< T >::Initialize ( const T &  v,
const tIndex &  n,
T *  R 
)
inlinestatic

copy the n values of a pointers array

Parameters
[in]v: constant init value
[in]n: number of values
[out]R: the copied values of size n

◆ initialize()

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

initialize the array to the value x

Parameters
[in]xconstant value

using the for loop

◆ isNANContained()

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

return true if one value is Not A Number

Returns
false if all the values is a Number

◆ IsNANContained()

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

return true if one value is Not A Number

Parameters
[in]n: size of values
[in]valuesvalues to detect NAN
Returns
false if all the values is a Number

◆ l2Distance2()

template<class T >
template<typename Q , class I >
tReal OMP_PtrArray< 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 values of X
I: imllemented 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_PtrArray< 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
Q: type of values 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<class T >
tReal OMP_PtrArray< 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_PtrArray< 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 values of X
I: imllemented class of X
Parameters
[in]Xthe array to compute the distance
[out]imax: indexof the maximum element
Returns
the L2-Distance squared \( \sum_i |T_i-X_i|^2 \)

◆ LinfDistance()

template<class T >
template<typename Q >
static tReal OMP_PtrArray< T >::LinfDistance ( const tIndex &  nX,
const Q *  Xs,
const tIndex &  nY,
const T *  Ys,
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 values of X
Parameters
[in]nX: number of values of X
[in]Xsvalues of array X
[in]nY: number of values of Y
[in]Ysvalues of array Y
[out]imaxthe index where the module is max
Returns
the max of the module

◆ linfNorm()

template<class T >
tReal OMP_PtrArray< 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|) \)

◆ Multiply() [1/2]

template<class T >
template<typename Q >
static void OMP_PtrArray< T >::Multiply ( const Q &  v,
const tIndex &  n,
T *  values 
)
inlinestatic

multiply the values by the constant v

Template Parameters
Q: type of v
Parameters
[in]v: multiplied factor
[in]n: size of values
[in,out]values: values to multiply

◆ Multiply() [2/2]

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

compute X*=Y

Template Parameters
Q: type of v
Parameters
[in]n: min size of X and Y
[in]Y: values to add
[in,out]X: X*=Y

◆ New()

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

return a unique pointer of the class

Returns
an unique pointer of the class

◆ norm2()

template<class T >
static T OMP_PtrArray< T >::norm2 ( const tIndex &  n,
const T *  values 
)
inlinestatic

computes the square of norm of the \(L_2 \) norm

Parameters
[in]n: nulbe rof values
[in]valuesvalues
Returns
the square of L2-norm

◆ Normalize()

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

normalize the array

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

◆ operator%=()

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

modulo operator

Parameters
[in]v: modulo 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 v
I: implemented class of v
Parameters
[in]varray to multiply use a pointer loop

◆ operator*=() [1/2]

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

array multiply operator

Template Parameters
Q: type of v
I: implemented class of v
Parameters
[in]varray to multiply use a pointers loop

◆ operator*=() [2/2]

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

multiplicator operator

Parameters
[in]vmultiplicator value

◆ operator+=()

template<class T >
Self& OMP_PtrArray< 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_PtrArray< T >::operator-= ( const CORE_Array< Q, I > &  v)
inline

array sub operator

Template Parameters
Q: type of v
I: implemented class of v
Parameters
[in]varray to multiply Use trnsform method

◆ operator-=() [2/2]

template<class T >
Self& OMP_PtrArray< 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_PtrArray< T >::operator/= ( const CORE_Array< Q, I > &  v)
inline

array divisor operator

Template Parameters
Q: type of v
I: implemented class of v
Parameters
[in]varray to multiply use a transform method

◆ operator/=() [2/2]

template<class T >
Self& OMP_PtrArray< 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_PtrArray< 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
I1implemented class of values
Parameters
[in]valuesvalues to copy

◆ operator=() [2/10]

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

build an array by a copy of c

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

◆ operator=() [3/10]

template<class T >
Self& OMP_PtrArray< 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_PtrArray< T >::operator= ( const std::array< T, N > &  values)
inline

build an array by a copy of c

Template Parameters
N: number of values
Parameters
[in]valuesvalues to copy

◆ operator=() [5/10]

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

return the product of all the elements

Parameters
[in]n: the size of the values
[in]values: values
Returns
the product of all the elements

◆ prod()

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

return the produc of all the elements

Parameters
[out]p: the product of all the elements

◆ scalarProduct()

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

return the scalar product

Template Parameters
Q: type of values of X
I: imllemented class of X
Parameters
[in]X: argument vector
[out]sthe scalar product as in return
Returns
the value of <T,X>

◆ ScalarProduct()

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

return the sclar product

Template Parameters
Q: type of values of X
Parameters
[in]n: size of the vectors
[in]X: the vector values to make the product
[in]Y: the vector values to make the product
Returns
the <X,Y>

◆ Sub()

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

compute X-=Y

Template Parameters
Q: type of v
Parameters
[in]n: min size of X and Y
[in]Y: values
[in,out]X: X-=Y

◆ Sum()

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

return the sum of all the elements

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

◆ sum()

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

randomize the vector in [0,max]

Parameters
[in]minmin value
[in]maxmax value
[in]n: size of values
[out]values: the values to randomize

It uses the drand method which is thread safe


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