OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
Vector< T, EIGEN_BASE > Class Template Reference

Detailed Description

template<typename T>
class Vector< T, EIGEN_BASE >

Definition at line 91 of file Vector_eigen.hpp.

Public Member Functions

 Vector (const Vector< T > &v)
 Copy the vector.
 
 Vector (const Vector< T > &&v)
 Copy the vector.
 
 Vector (size_t n)
 Create a vector with n elements.
 
 Vector ()
 Create a vector with 0 elements.
 
void resize (size_t row, size_t l_row)
 Resize the Vector.
 
void insert (size_t i, T val)
 Return a reference to the vector element.
 
T & insert (size_t i)
 Return a reference to the vector element.
 
const T & insert (size_t i) const
 Return a reference to the vector element.
 
const T & operator() (size_t i) const
 Return a reference to the vector element.
 
T & operator() (size_t i)
 Return a reference to the vector element.
 
const Eigen::Matrix< T, Eigen::Dynamic, 1 > & getVec () const
 Get the Eigen Vector object.
 
Eigen::Matrix< T, Eigen::Dynamic, 1 > & getVec ()
 Get the Eigen Vector object.
 
void scatter ()
 Scatter the vector information to the other processors.
 
void fromFile (std::string file)
 Load from file.
 
Vector< T > & operator= (const Vector< T > &v)
 Copy the vector.
 
Vector< T > & operator= (const Vector< T > &&v)
 Copy the vector.
 
Vector< T > & operator= (Eigen::Matrix< T, Eigen::Dynamic, 1 > &v)
 Copy the vector (it is used for special purpose)
 

Private Member Functions

void collect () const
 Here we collect the full vector on master.
 
void setEigen () const
 Set the Eigen internal vector.
 
void build_map () const
 Build the map.
 

Private Attributes

Eigen::Matrix< T, Eigen::Dynamic, 1 > v
 Eigen vector.
 
openfpm::vector< rval< T, EIGEN_RVAL > > row_val
 row val vector
 
openfpm::vector< rval< T, EIGEN_RVAL > > row_val_recv
 row val vector received
 
std::unordered_map< size_t, size_t > map
 global to local map
 
invalid
 invalid
 
openfpm::vector< size_t > prc
 Processors from where we gather.
 
openfpm::vector< size_t > sz
 

Constructor & Destructor Documentation

◆ Vector() [1/4]

template<typename T >
Vector< T, EIGEN_BASE >::Vector ( const Vector< T > &  v)
inline

Copy the vector.

Parameters
vvector to copy

Definition at line 166 of file Vector_eigen.hpp.

◆ Vector() [2/4]

template<typename T >
Vector< T, EIGEN_BASE >::Vector ( const Vector< T > &&  v)
inline

Copy the vector.

Parameters
vvector to copy

Definition at line 177 of file Vector_eigen.hpp.

◆ Vector() [3/4]

template<typename T >
Vector< T, EIGEN_BASE >::Vector ( size_t  n)
inline

Create a vector with n elements.

Parameters
nnumber of elements in the vector

Definition at line 188 of file Vector_eigen.hpp.

◆ Vector() [4/4]

template<typename T >
Vector< T, EIGEN_BASE >::Vector ( )
inline

Create a vector with 0 elements.

Definition at line 196 of file Vector_eigen.hpp.

Member Function Documentation

◆ build_map()

template<typename T >
void Vector< T, EIGEN_BASE >::build_map ( ) const
inlineprivate

Build the map.

Definition at line 151 of file Vector_eigen.hpp.

◆ collect()

template<typename T >
void Vector< T, EIGEN_BASE >::collect ( ) const
inlineprivate

Here we collect the full vector on master.

Definition at line 118 of file Vector_eigen.hpp.

◆ fromFile()

template<typename T >
void Vector< T, EIGEN_BASE >::fromFile ( std::string  file)
inline

Load from file.

Definition at line 361 of file Vector_eigen.hpp.

◆ getVec() [1/2]

template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, 1 > & Vector< T, EIGEN_BASE >::getVec ( )
inline

Get the Eigen Vector object.

Returns
the Eigen Vector

Definition at line 324 of file Vector_eigen.hpp.

◆ getVec() [2/2]

template<typename T >
const Eigen::Matrix< T, Eigen::Dynamic, 1 > & Vector< T, EIGEN_BASE >::getVec ( ) const
inline

Get the Eigen Vector object.

Returns
the Eigen Vector

Definition at line 311 of file Vector_eigen.hpp.

◆ insert() [1/3]

template<typename T >
T & Vector< T, EIGEN_BASE >::insert ( size_t  i)
inline

Return a reference to the vector element.

Parameters
ielement
Returns
reference to the element vector

Definition at line 235 of file Vector_eigen.hpp.

◆ insert() [2/3]

template<typename T >
const T & Vector< T, EIGEN_BASE >::insert ( size_t  i) const
inline

Return a reference to the vector element.

Parameters
ielement
Returns
reference to the element vector

Definition at line 253 of file Vector_eigen.hpp.

◆ insert() [3/3]

template<typename T >
void Vector< T, EIGEN_BASE >::insert ( size_t  i,
val 
)
inline

Return a reference to the vector element.

Parameters
ielement
valvalue

Definition at line 217 of file Vector_eigen.hpp.

◆ operator()() [1/2]

template<typename T >
T & Vector< T, EIGEN_BASE >::operator() ( size_t  i)
inline

Return a reference to the vector element.

Warning
The element must exist
Parameters
ielement
Returns
reference to the element vector

Definition at line 294 of file Vector_eigen.hpp.

◆ operator()() [2/2]

template<typename T >
const T & Vector< T, EIGEN_BASE >::operator() ( size_t  i) const
inline

Return a reference to the vector element.

Warning
The element must exist
Parameters
ielement
Returns
reference to the element vector

Definition at line 273 of file Vector_eigen.hpp.

◆ operator=() [1/3]

template<typename T >
Vector< T > & Vector< T, EIGEN_BASE >::operator= ( const Vector< T > &&  v)
inline

Copy the vector.

Parameters
vvector to copy

Definition at line 393 of file Vector_eigen.hpp.

◆ operator=() [2/3]

template<typename T >
Vector< T > & Vector< T, EIGEN_BASE >::operator= ( const Vector< T > &  v)
inline

Copy the vector.

Parameters
vvector to copy

Definition at line 378 of file Vector_eigen.hpp.

◆ operator=() [3/3]

template<typename T >
Vector< T > & Vector< T, EIGEN_BASE >::operator= ( Eigen::Matrix< T, Eigen::Dynamic, 1 > &  v)
inline

Copy the vector (it is used for special purpose)

Warning
v MUST contain at least all the elements of the vector
Parameters
vbase eigen vector to copy

Definition at line 410 of file Vector_eigen.hpp.

◆ resize()

template<typename T >
void Vector< T, EIGEN_BASE >::resize ( size_t  row,
size_t  l_row 
)
inline

Resize the Vector.

Parameters
rownumbers of row
l_rowunused

Definition at line 206 of file Vector_eigen.hpp.

◆ scatter()

template<typename T >
void Vector< T, EIGEN_BASE >::scatter ( )
inline

Scatter the vector information to the other processors.

Eigen does not have a real parallel vector, so in order to work we have to scatter the vector from one processor to the other

Definition at line 339 of file Vector_eigen.hpp.

◆ setEigen()

template<typename T >
void Vector< T, EIGEN_BASE >::setEigen ( ) const
inlineprivate

Set the Eigen internal vector.

Definition at line 139 of file Vector_eigen.hpp.

Field Documentation

◆ invalid

template<typename T >
T Vector< T, EIGEN_BASE >::invalid
private

invalid

Definition at line 106 of file Vector_eigen.hpp.

◆ map

template<typename T >
std::unordered_map<size_t,size_t> Vector< T, EIGEN_BASE >::map
mutableprivate

global to local map

Definition at line 103 of file Vector_eigen.hpp.

◆ prc

template<typename T >
openfpm::vector<size_t> Vector< T, EIGEN_BASE >::prc
mutableprivate

Processors from where we gather.

Definition at line 109 of file Vector_eigen.hpp.

◆ row_val

template<typename T >
openfpm::vector<rval<T,EIGEN_RVAL> > Vector< T, EIGEN_BASE >::row_val
mutableprivate

row val vector

Definition at line 97 of file Vector_eigen.hpp.

◆ row_val_recv

template<typename T >
openfpm::vector<rval<T,EIGEN_RVAL> > Vector< T, EIGEN_BASE >::row_val_recv
mutableprivate

row val vector received

Definition at line 100 of file Vector_eigen.hpp.

◆ sz

template<typename T >
openfpm::vector<size_t> Vector< T, EIGEN_BASE >::sz
mutableprivate

Definition at line 112 of file Vector_eigen.hpp.

◆ v

template<typename T >
Eigen::Matrix<T, Eigen::Dynamic, 1> Vector< T, EIGEN_BASE >::v
mutableprivate

Eigen vector.

Definition at line 94 of file Vector_eigen.hpp.


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