21 #ifndef SELDON_FILE_HETEROGENEOUS_MATRIX_COLLECTION_HXX
24 #include "../share/Common.hxx"
25 #include "../share/Properties.hxx"
26 #include "../share/Storage.hxx"
27 #include "../share/Errors.hxx"
28 #include "../share/Allocator.hxx"
39 template <
class Prop0,
class Storage0,
40 class Prop1,
class Storage1,
41 template <
class U>
class Allocator>
107 Storage1, Allocator>& A);
119 int GetM(
int i)
const;
122 int GetN(
int j)
const;
126 int GetType(
int i,
int j)
const;
156 Storage1, Allocator>&
158 Prop1, Storage1, Allocator>& A);
161 Prop1, Storage1, Allocator>& A);
167 void Write(
string FileName,
bool with_size)
const;
168 void Write(ostream& FileStream,
bool with_size)
const;
170 void WriteText(ostream& FileStream)
const;
172 void Read(
string FileName);
173 void Read(istream& FileStream);
179 template <
template <
class U>
class Allocator>
183 RowSparse, Allocator >
189 typedef Allocator<double> allocator;
200 #define SELDON_FILE_HETEROGENEOUS_MATRIX_COLLECTION_HXX
float_sparse_c & GetFloatSparse()
Returns the collection of float sparse underlying matrices.
void WriteText(string FileName) const
Writes the matrix collection in a file.
void Print() const
Displays the matrix collection on the standard output.
double_sparse_c & GetDoubleSparse()
Returns the collection of double sparse underlying matrices.
double_sparse_c double_sparse_c_
Pointers of the underlying double sparse matrices.
Base class for all matrices.
double operator()(int i, int j) const
Access operator.
float_dense_c float_dense_c_
Pointers of the underlying float dense matrices.
int GetSize() const
Returns the number of elements stored in memory.
void Read(string FileName)
Reads the matrix collection from a file.
size_t GetMemorySize() const
Returns size of A in bytes used to store the matrix.
void Reallocate(int i, int j)
Reallocates memory to resize the matrix collection.
HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator > & operator=(const HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator > &A)
Duplicates a matrix collection (assignment operator).
Matrix class made of an heterogeneous collection of matrices.
HeterogeneousMatrixCollection()
Default constructor.
int GetNmatrix() const
Returns the number of columns.
int nz_
Number of non-zero elements.
int GetM() const
Returns the number of rows.
int Mmatrix_
Number of rows of matrices.
void Write(string FileName, bool with_size) const
Writes the matrix collection in a file.
Vector< int > Mlocal_
Number of rows in the underlying matrices.
int GetType(int i, int j) const
Returns the type of a given underlying matrix.
void Copy(const HeterogeneousMatrixCollection< Prop0, Storage0, Prop1, Storage1, Allocator > &A)
Duplicates a matrix collection (assignment operator).
Vector< int > Nlocal_
Number of columns in the underlying matrices.
Vector< int > Mlocal_sum_
Cumulative number of rows in the underlying matrices.
void Clear()
Clears the matrix collection without releasing memory.
double_dense_c & GetDoubleDense()
Returns the collection of double dense underlying matrices.
float_dense_c & GetFloatDense()
Returns the collection of float dense underlying matrices.
int Nmatrix_
Number of columns of matrices.
int GetMmatrix() const
Returns the number of rows.
~HeterogeneousMatrixCollection()
Destructor.
int GetN() const
Returns the number of columns.
Vector< int > Nlocal_sum_
Cumulative number of columns in the underlying matrices.
void Deallocate()
Deallocates underlying the matrices.
double_dense_c double_dense_c_
Pointers of the underlying double dense matrices.
int GetDataSize() const
Returns the number of elements stored in memory.
float_sparse_c float_sparse_c_
Pointers of the underlying float sparse matrices.
Matrix< int, General, RowMajor > collection_
Type of the underlying matrices.
void Nullify()
Clears the matrix collection without releasing memory.