21 #ifndef SELDON_FILE_MATRIX_COLLECTION_INLINE_CXX
23 #include "MatrixCollection.hxx"
36 template <
class T,
class Prop,
class Storage,
class Allocator>
51 template <
class T,
class Prop,
class Storage,
class Allocator>
68 template <
class T,
class Prop,
class Storage,
class Allocator>
80 template <
class T,
class Prop,
class Storage,
class Allocator>
92 template <
class T,
class Prop,
class Storage,
class Allocator>
95 #ifdef SELDON_CHECK_BOUNDS
96 if (i < 0 || i >= Mmatrix_)
97 throw WrongRow(
"MatrixCollection::GetM()",
98 string(
"Index should be in [0, ")
99 +
to_str(Mmatrix_ - 1) +
"], but is equal to "
112 template <
class T,
class Prop,
class Storage,
class Allocator>
124 template <
class T,
class Prop,
class Storage,
class Allocator>
137 template <
class T,
class Prop,
class Storage,
class Allocator>
140 #ifdef SELDON_CHECK_BOUNDS
141 if (j < 0 || j >= Nmatrix_)
142 throw WrongCol(
"MatrixCollection::GetN()",
143 string(
"Index should be in [0, ")
144 +
to_str(Nmatrix_ - 1) +
"], but is equal to "
156 template <
class T,
class Prop,
class Storage,
class Allocator>
159 return this->m_ * this->n_;
167 template <
class T,
class Prop,
class Storage,
class Allocator>
175 template <
class T,
class Prop,
class Storage,
class Allocator>
178 size_t taille = size_t(nz_)*
sizeof(T);
195 template <
class T,
class Prop,
class Storage,
class Allocator>
197 typename MatrixCollection<T, Prop, Storage, Allocator>::matrix_reference
200 #ifdef SELDON_CHECK_BOUNDS
201 if (i < 0 || i >= Mmatrix_)
202 throw WrongRow(
"MatrixCollection::GetMatrix(int, int)",
203 string(
"Row index should be in [0, ")
204 +
to_str(Mmatrix_ - 1) +
"], but is equal to "
206 if (j < 0 || j >= Nmatrix_)
207 throw WrongCol(
"MatrixCollection::GetMatrix(int, int)",
208 string(
"Column index should be in [0, ")
209 +
to_str(Nmatrix_ - 1) +
"], but is equal to "
213 return matrix_(i, j);
224 template <
class T,
class Prop,
class Storage,
class Allocator>
226 ::const_matrix_reference
230 #ifdef SELDON_CHECK_BOUNDS
231 if (i < 0 || i >= Mmatrix_)
232 throw WrongRow(
"MatrixCollection::GetMatrix(int, int)",
233 string(
"Row index should be in [0, ")
234 +
to_str(Mmatrix_ - 1) +
"], but is equal to "
236 if (j < 0 || j >= Nmatrix_)
237 throw WrongCol(
"MatrixCollection::GetMatrix(int, int)",
238 string(
"Column index should be in [0, ")
239 +
to_str(Nmatrix_ - 1) +
"], but is equal to "
243 return matrix_(i, j);
261 template <
class T,
class Prop,
class Allocator>
273 template <
class T,
class Prop,
class Allocator>
294 template <
class T,
class Prop,
class Allocator>
306 template <
class T,
class Prop,
class Allocator>
327 template <
class T,
class Prop,
class Allocator>
339 template <
class T,
class Prop,
class Allocator>
361 template <
class T,
class Prop,
class Allocator>
373 template <
class T,
class Prop,
class Allocator>
384 #define SELDON_FILE_MATRIX_COLLECTION_INLINE_CXX
Base class for all matrices.
std::string to_str(const T &input)
Converts most types to string.
Matrix class made of a collection of matrices.
~MatrixCollection()
Destructor.
int GetM() const
Returns the number of rows.
matrix_reference GetMatrix(int i, int j)
Access to an underlying matrix.
int GetNmatrix() const
Returns the number of columns.
MatrixCollection()
Default constructor.
int GetMmatrix() const
Returns the number of rows.
int GetN() const
Returns the number of columns.
size_t GetMemorySize() const
Returns size of A in bytes used to store the matrix.
int GetDataSize() const
Returns the number of elements stored in memory.
int GetSize() const
Returns the number of elements stored in memory.