Public Types | Public Member Functions | Protected Attributes | List of all members
Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator > Class Template Reference

Matrix class made of an heterogeneous collection of matrices. More...

#include <HeterogeneousMatrixCollection.hxx>

Inheritance diagram for Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >:
Seldon::Matrix_Base< double, Allocator< double > > Seldon::VirtualMatrix< double >

Public Types

typedef Matrix< float, Prop0, Storage0, Allocator< float > > float_dense_m
 
typedef Matrix< float, Prop1, Storage1, Allocator< float > > float_sparse_m
 
typedef Matrix< double, Prop0, Storage0, Allocator< double > > double_dense_m
 
typedef Matrix< double, Prop1, Storage1, Allocator< double > > double_sparse_m
 
typedef Matrix< float_dense_m, General, RowMajorCollection, NewAlloc< float_dense_m > > float_dense_c
 
typedef Matrix< float_sparse_m, General, RowMajorCollection, NewAlloc< float_sparse_m > > float_sparse_c
 
typedef Matrix< double_dense_m, General, RowMajorCollection, NewAlloc< double_dense_m > > double_dense_c
 
typedef Matrix< double_sparse_m, General, RowMajorCollection, NewAlloc< double_sparse_m > > double_sparse_c
 
typedef Allocator< double > ::value_type value_type
 
typedef Allocator< double > ::pointer pointer
 
typedef Allocator< double > ::const_pointer const_pointer
 
typedef Allocator< double > ::reference reference
 
typedef Allocator< double > ::const_reference const_reference
 

Public Member Functions

 HeterogeneousMatrixCollection ()
 Default constructor. More...
 
 HeterogeneousMatrixCollection (int i, int j)
 Main constructor. More...
 
 HeterogeneousMatrixCollection (const HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator > &A)
 Copy constructor. More...
 
 ~HeterogeneousMatrixCollection ()
 Destructor.
 
void Clear ()
 Clears the matrix collection without releasing memory.
 
void Nullify ()
 Clears the matrix collection without releasing memory.
 
void Nullify (int i, int j)
 Clears a given underlying matrix. More...
 
void Deallocate ()
 Deallocates underlying the matrices.
 
int GetM () const
 Returns the number of rows. More...
 
int GetMmatrix () const
 Returns the number of rows. More...
 
int GetM (int i) const
 Returns the number of rows in an underlying matrix. More...
 
int GetN () const
 Returns the number of columns. More...
 
int GetNmatrix () const
 Returns the number of columns. More...
 
int GetN (int j) const
 Returns the number of columns in an underlying matrix. More...
 
int GetSize () const
 Returns the number of elements stored in memory. More...
 
int GetDataSize () const
 Returns the number of elements stored in memory. More...
 
size_t GetMemorySize () const
 Returns size of A in bytes used to store the matrix.
 
int GetType (int i, int j) const
 Returns the type of a given underlying matrix. More...
 
float_dense_cGetFloatDense ()
 Returns the collection of float dense underlying matrices. More...
 
const float_dense_cGetFloatDense () const
 
float_sparse_cGetFloatSparse ()
 Returns the collection of float sparse underlying matrices. More...
 
const float_sparse_cGetFloatSparse () const
 
double_dense_cGetDoubleDense ()
 Returns the collection of double dense underlying matrices. More...
 
const double_dense_cGetDoubleDense () const
 
double_sparse_cGetDoubleSparse ()
 Returns the collection of double sparse underlying matrices. More...
 
const double_sparse_cGetDoubleSparse () const
 
void Reallocate (int i, int j)
 Reallocates memory to resize the matrix collection. More...
 
void SetMatrix (int m, int n, const float_dense_m &)
 
void SetMatrix (int m, int n, const float_sparse_m &)
 
void SetMatrix (int m, int n, const double_dense_m &)
 
void SetMatrix (int m, int n, const double_sparse_m &)
 
void GetMatrix (int m, int n, float_dense_m &) const
 
void GetMatrix (int m, int n, float_sparse_m &) const
 
void GetMatrix (int m, int n, double_dense_m &) const
 
void GetMatrix (int m, int n, double_sparse_m &) const
 
double operator() (int i, int j) const
 Access operator. More...
 
HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator > & operator= (const HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator > &A)
 Duplicates a matrix collection (assignment operator). More...
 
void Copy (const HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator > &A)
 Duplicates a matrix collection (assignment operator). More...
 
void Print () const
 Displays the matrix collection on the standard output. More...
 
void Write (string FileName, bool with_size) const
 Writes the matrix collection in a file. More...
 
void Write (ostream &FileStream, bool with_size) const
 Writes the matrix collection to an output stream. More...
 
void WriteText (string FileName) const
 Writes the matrix collection in a file. More...
 
void WriteText (ostream &FileStream) const
 Writes the matrix collection to an output stream. More...
 
void Read (string FileName)
 Reads the matrix collection from a file. More...
 
void Read (istream &FileStream)
 Reads the matrix collection from an input stream. More...
 
pointer GetData () const
 Returns a pointer to the data array. More...
 
const_pointer GetDataConst () const
 Returns a const pointer to the data array. More...
 
void * GetDataVoid () const
 Returns a pointer of type "void*" to the data array. More...
 
const void * GetDataConstVoid () const
 Returns a pointer of type "const void*" to the data array. More...
 
int GetM () const
 Returns the number of rows. More...
 
int GetM (const Seldon::SeldonTranspose &status) const
 Returns the number of rows of the matrix possibly transposed. More...
 
int GetM (const CBLAS_TRANSPOSE &status) const
 Returns the number of rows of the matrix possibly transposed. More...
 
int GetN () const
 Returns the number of columns. More...
 
int GetN (const Seldon::SeldonTranspose &status) const
 Returns the number of columns of the matrix possibly transposed. More...
 
int GetN (const CBLAS_TRANSPOSE &status) const
 Returns the number of columns of the matrix possibly transposed. More...
 
long GetSize () const
 Returns the number of elements in the matrix. More...
 

Protected Attributes

int nz_
 Number of non-zero elements.
 
int Mmatrix_
 Number of rows of matrices.
 
int Nmatrix_
 Number of columns of matrices.
 
Vector< int > Mlocal_
 Number of rows in the underlying matrices.
 
Vector< int > Mlocal_sum_
 Cumulative number of rows in the underlying matrices.
 
Vector< int > Nlocal_
 Number of columns in the underlying matrices.
 
Vector< int > Nlocal_sum_
 Cumulative number of columns in the underlying matrices.
 
Matrix< int, General, RowMajorcollection_
 Type of the underlying matrices. More...
 
float_dense_c float_dense_c_
 Pointers of the underlying float dense matrices.
 
float_sparse_c float_sparse_c_
 Pointers of the underlying float sparse matrices.
 
double_dense_c double_dense_c_
 Pointers of the underlying double dense matrices.
 
double_sparse_c double_sparse_c_
 Pointers of the underlying double sparse matrices.
 
pointer data_
 
int m_
 
int n_
 

Detailed Description

template<class Prop0, class Storage0, class Prop1, class Storage1, template< class U > class Allocator>
class Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >

Matrix class made of an heterogeneous collection of matrices.

A collection can refer to matrices of different types : float, double, dense and sparse.

Definition at line 42 of file HeterogeneousMatrixCollection.hxx.

Constructor & Destructor Documentation

◆ HeterogeneousMatrixCollection() [1/3]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::HeterogeneousMatrixCollection

Default constructor.

On exit, the matrix is an empty 0x0 matrix.

Definition at line 47 of file HeterogeneousMatrixCollection.cxx.

◆ HeterogeneousMatrixCollection() [2/3]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::HeterogeneousMatrixCollection ( int  i,
int  j 
)

Main constructor.

Builds a i x j collection matrix.

Parameters
[in]inumber of rows of matrices.
[in]jnumber of columns of matrices.

Definition at line 70 of file HeterogeneousMatrixCollection.cxx.

◆ HeterogeneousMatrixCollection() [3/3]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::HeterogeneousMatrixCollection ( const HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator > &  A)
inline

Copy constructor.

Parameters
[in]Amatrix collection to be copied.
Note
Memory is duplicated: A is therefore independent from the current instance after the copy.

Definition at line 44 of file HeterogeneousMatrixCollectionInline.cxx.

Member Function Documentation

◆ Copy()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::Copy ( const HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator > &  A)

Duplicates a matrix collection (assignment operator).

Parameters
[in]Amatrix collection to be copied.
Note
Memory is duplicated: A is therefore independent from the current instance after the copy.

Definition at line 850 of file HeterogeneousMatrixCollection.cxx.

◆ GetData()

Matrix_Base< double , Allocator< double > >::pointer Seldon::Matrix_Base< double , Allocator< double > >::GetData
inlineinherited

Returns a pointer to the data array.

Returns a pointer to data, i.e. the data array 'data_'.

Returns
A pointer to the data array.

Definition at line 241 of file Matrix_BaseInline.cxx.

◆ GetDataConst()

Matrix_Base< double , Allocator< double > >::const_pointer Seldon::Matrix_Base< double , Allocator< double > >::GetDataConst
inlineinherited

Returns a const pointer to the data array.

Returns a const pointer to data, i.e. the data array 'data_'.

Returns
A const pointer to the data array.

Definition at line 254 of file Matrix_BaseInline.cxx.

◆ GetDataConstVoid()

const void * Seldon::Matrix_Base< double , Allocator< double > >::GetDataConstVoid
inlineinherited

Returns a pointer of type "const void*" to the data array.

Returns a pointer of type "const void*" to data, i.e. the data array 'data_'.

Returns
A const pointer of type "void*" to the data array.

Definition at line 280 of file Matrix_BaseInline.cxx.

◆ GetDataSize()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
int Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetDataSize
inline

Returns the number of elements stored in memory.

Returns
The number of elements stored in memory.

Definition at line 203 of file HeterogeneousMatrixCollectionInline.cxx.

◆ GetDataVoid()

void * Seldon::Matrix_Base< double , Allocator< double > >::GetDataVoid
inlineinherited

Returns a pointer of type "void*" to the data array.

Returns a pointer of type "void*" to data, i.e. the data array 'data_'.

Returns
A pointer of type "void*" to the data array.

Definition at line 267 of file Matrix_BaseInline.cxx.

◆ GetDoubleDense()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
const HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::double_dense_c & Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetDoubleDense
inline

Returns the collection of double dense underlying matrices.

Returns
the collection of double dense underlying matrices.

Definition at line 331 of file HeterogeneousMatrixCollectionInline.cxx.

◆ GetDoubleSparse()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
const HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::double_sparse_c & Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetDoubleSparse
inline

Returns the collection of double sparse underlying matrices.

Returns
the collection of double sparse underlying matrices.

Definition at line 363 of file HeterogeneousMatrixCollectionInline.cxx.

◆ GetFloatDense()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
const HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::float_dense_c & Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetFloatDense
inline

Returns the collection of float dense underlying matrices.

Returns
the collection of float dense underlying matrices.

Definition at line 267 of file HeterogeneousMatrixCollectionInline.cxx.

◆ GetFloatSparse()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
const HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::float_sparse_c & Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetFloatSparse
inline

Returns the collection of float sparse underlying matrices.

Returns
the collection of float sparse underlying matrices.

Definition at line 299 of file HeterogeneousMatrixCollectionInline.cxx.

◆ GetM() [1/5]

int Seldon::VirtualMatrix< double >::GetM
inlineinherited

Returns the number of rows.

Returns
The number of rows.

Definition at line 69 of file Matrix_BaseInline.cxx.

◆ GetM() [2/5]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
int Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetM
inline

Returns the number of rows.

Returns
the total number of rows. It is the sum of the number of rows in the underlying matrices.

Definition at line 82 of file HeterogeneousMatrixCollectionInline.cxx.

◆ GetM() [3/5]

int Seldon::VirtualMatrix< double >::GetM ( const CBLAS_TRANSPOSE &  status) const
inlineinherited

Returns the number of rows of the matrix possibly transposed.

Parameters
statusassumed status about the transposition of the matrix.
Returns
The number of rows of the possibly-transposed matrix.

Definition at line 122 of file Matrix_BaseInline.cxx.

◆ GetM() [4/5]

int Seldon::VirtualMatrix< double >::GetM ( const Seldon::SeldonTranspose status) const
inlineinherited

Returns the number of rows of the matrix possibly transposed.

Parameters
statusassumed status about the transposition of the matrix.
Returns
The number of rows of the possibly-transposed matrix.

Definition at line 92 of file Matrix_BaseInline.cxx.

◆ GetM() [5/5]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
int Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetM ( int  i) const
inline

Returns the number of rows in an underlying matrix.

Parameters
[in]irow index of the underlying matrix.
Returns
The number of rows in the underlying matrices with row index i.

Definition at line 112 of file HeterogeneousMatrixCollectionInline.cxx.

◆ GetMmatrix()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
int Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetMmatrix
inline

Returns the number of rows.

Returns
the total number of rows. It is the sum of the number of rows in the underlying matrices.

Definition at line 97 of file HeterogeneousMatrixCollectionInline.cxx.

◆ GetN() [1/5]

int Seldon::VirtualMatrix< double >::GetN
inlineinherited

Returns the number of columns.

Returns
The number of columns.

Definition at line 80 of file Matrix_BaseInline.cxx.

◆ GetN() [2/5]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
int Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetN
inline

Returns the number of columns.

Returns
the total number of columns. It is the sum of the number of columns in the underlying matrices.

Definition at line 135 of file HeterogeneousMatrixCollectionInline.cxx.

◆ GetN() [3/5]

int Seldon::VirtualMatrix< double >::GetN ( const CBLAS_TRANSPOSE &  status) const
inlineinherited

Returns the number of columns of the matrix possibly transposed.

Parameters
statusassumed status about the transposition of the matrix.
Returns
The number of columns of the possibly-transposed matrix.

Definition at line 137 of file Matrix_BaseInline.cxx.

◆ GetN() [4/5]

int Seldon::VirtualMatrix< double >::GetN ( const Seldon::SeldonTranspose status) const
inlineinherited

Returns the number of columns of the matrix possibly transposed.

Parameters
statusassumed status about the transposition of the matrix.
Returns
The number of columns of the possibly-transposed matrix.

Definition at line 107 of file Matrix_BaseInline.cxx.

◆ GetN() [5/5]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
int Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetN ( int  j) const
inline

Returns the number of columns in an underlying matrix.

Parameters
[in]jcolumn index of the underlying matrix.
Returns
The number of columns in the underlying matrices with column index j.

Definition at line 166 of file HeterogeneousMatrixCollectionInline.cxx.

◆ GetNmatrix()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
int Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetNmatrix
inline

Returns the number of columns.

Returns
the total number of columns. It is the sum of the number of columns in the underlying matrices.

Definition at line 150 of file HeterogeneousMatrixCollectionInline.cxx.

◆ GetSize() [1/2]

long Seldon::VirtualMatrix< double >::GetSize
inlineinherited

Returns the number of elements in the matrix.

Returns the number of elements in the matrix, i.e. the number of rows multiplied by the number of columns.

Returns
The number of elements in the matrix.

Definition at line 153 of file Matrix_BaseInline.cxx.

◆ GetSize() [2/2]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
int Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetSize
inline

Returns the number of elements stored in memory.

Returns
The number of elements stored in memory.

Definition at line 188 of file HeterogeneousMatrixCollectionInline.cxx.

◆ GetType()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
int Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::GetType ( int  i,
int  j 
) const
inline

Returns the type of a given underlying matrix.

Type 0 refers to a float dense matrice. Type 1 refers to a float sparse matrice. Type 2 refers to a double dense matrice. Type 3 refers to a double sparse matrice.

Parameters
[in]irow of the given underlying matrix.
[in]jcolumn of the given underlying matrix.
Returns
The type of the underlying matrix.

Definition at line 238 of file HeterogeneousMatrixCollectionInline.cxx.

◆ Nullify()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
void Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::Nullify ( int  i,
int  j 
)

Clears a given underlying matrix.

Parameters
[in]irow of the underlying matrix to be nullified.
[in]jcolumn of the underlying matrix to be nullified.

Definition at line 142 of file HeterogeneousMatrixCollection.cxx.

◆ operator()()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
double Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::operator() ( int  i,
int  j 
) const

Access operator.

Returns the value of element (i, j).

Parameters
[in]irow index.
[in]jcolumn index.
Returns
Element (i, j) of the matrix.

Definition at line 764 of file HeterogeneousMatrixCollection.cxx.

◆ operator=()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator > & Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::operator= ( const HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator > &  A)

Duplicates a matrix collection (assignment operator).

Parameters
[in]Amatrix collection to be copied.
Note
Memory is duplicated: A is therefore independent from the current instance after the copy.

Definition at line 832 of file HeterogeneousMatrixCollection.cxx.

◆ Print()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
void Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::Print

Displays the matrix collection on the standard output.

Displays elements on the standard output, in text format.

Definition at line 925 of file HeterogeneousMatrixCollection.cxx.

◆ Read() [1/2]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
void Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::Read ( istream &  FileStream)

Reads the matrix collection from an input stream.

Reads a matrix collection stored in binary format from a stream. The number of rows of matrices (integer) and the number of columns of matrices (integer) are read, and the underlying matrices are then read in the same order as it should be in memory (e.g. row-major storage).

Parameters
[in,out]FileStreaminput stream.

Definition at line 1199 of file HeterogeneousMatrixCollection.cxx.

◆ Read() [2/2]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
void Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::Read ( string  FileName)

Reads the matrix collection from a file.

Reads a matrix collection stored in binary format in a file. The number of rows of matrices (integer) and the number of columns of matrices (integer) are read, and the underlying matrices are then read in the same order as it should be in memory (e.g. row-major storage).

Parameters
[in]FileNameinput file name.

Definition at line 1169 of file HeterogeneousMatrixCollection.cxx.

◆ Reallocate()

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
void Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::Reallocate ( int  i,
int  j 
)

Reallocates memory to resize the matrix collection.

On exit, the matrix is a matrix collection with i x j underlying matrices.

Parameters
[in]inumber of rows of matrices.
[in]jnumber of columns of matrices.
Warning
Depending on your allocator, data may be lost.

Definition at line 211 of file HeterogeneousMatrixCollection.cxx.

◆ Write() [1/2]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
void Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::Write ( ostream &  FileStream,
bool  with_size = true 
) const

Writes the matrix collection to an output stream.

Writes the matrix collection to an output stream in binary format. The number of rows of matrices (integer) and the number of columns of matrices (integer) are written, and the underlying matrices are then written in the same order as in memory (e.g. row-major storage).

Parameters
[in,out]FileStreamoutput stream.
[in]with_sizeif set to 'false', the dimensions of the matrix are not saved.

Definition at line 980 of file HeterogeneousMatrixCollection.cxx.

◆ Write() [2/2]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
void Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::Write ( string  FileName,
bool  with_size 
) const

Writes the matrix collection in a file.

Stores the matrix collection in a file in binary format. The number of rows of matrices (integer) and the number of columns of matrices (integer) are written, and the underlying matrices are then written in the same order as in memory (e.g. row-major storage).

Parameters
[in]FileNameoutput file name.
[in]with_sizeif set to 'false', the dimensions of the matrix are not saved.

Definition at line 949 of file HeterogeneousMatrixCollection.cxx.

◆ WriteText() [1/2]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
void Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::WriteText ( ostream &  FileStream) const

Writes the matrix collection to an output stream.

Stores the matrix to an output stream in text format. Only the underlying matrices are written, without the dimensions. Each row is written on a single line and elements of a row are delimited by tabulations.

Parameters
[in,out]FileStreamoutput stream.

Definition at line 1095 of file HeterogeneousMatrixCollection.cxx.

◆ WriteText() [2/2]

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
void Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::WriteText ( string  FileName) const

Writes the matrix collection in a file.

Stores the matrix in a file in text format. Only the underlying matrices are written, without the dimensions. Each row is written on a single line and elements of a row are delimited by tabulations.

Parameters
[in]FileNameoutput file name.

Definition at line 1063 of file HeterogeneousMatrixCollection.cxx.

Member Data Documentation

◆ collection_

template<class Prop0 , class Storage0 , class Prop1 , class Storage1 , template< class U > class Allocator>
Matrix<int, General, RowMajor> Seldon::HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator >::collection_
protected

Type of the underlying matrices.

Type 0 refers to float dense matrices. Type 1 refers to float sparse matrices. Type 2 refers to double dense matrices. Type 3 refers to double sparse matrices.

Definition at line 88 of file HeterogeneousMatrixCollection.hxx.


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