21 #ifndef SELDON_FILE_HETEROGENEOUS_MATRIX_COLLECTION_INLINE_CXX
23 #include "HeterogeneousMatrixCollection.hxx"
40 template <
class Prop0,
class Storage0,
41 class Prop1,
class Storage1,
42 template <
class U>
class Allocator>
inline
45 Storage0, Prop1, Storage1, Allocator>& A):
58 template <
class Prop0,
class Storage0,
59 class Prop1,
class Storage1,
60 template <
class U>
class Allocator>
inline
78 template <
class Prop0,
class Storage0,
79 class Prop1,
class Storage1,
80 template <
class U>
class Allocator>
inline int
93 template <
class Prop0,
class Storage0,
94 class Prop1,
class Storage1,
95 template <
class U>
class Allocator>
inline int
108 template <
class Prop0,
class Storage0,
109 class Prop1,
class Storage1,
110 template <
class U>
class Allocator>
inline int
114 #ifdef SELDON_CHECK_BOUNDS
115 if (i < 0 || i >= Mmatrix_)
116 throw WrongRow(
"HeterogeneousMatrixCollection::GetM()",
117 string(
"Index should be in [0, ")
118 +
to_str(Mmatrix_ - 1) +
"], but is equal to "
131 template <
class Prop0,
class Storage0,
132 class Prop1,
class Storage1,
133 template <
class U>
class Allocator>
inline int
146 template <
class Prop0,
class Storage0,
147 class Prop1,
class Storage1,
148 template <
class U>
class Allocator>
inline int
162 template <
class Prop0,
class Storage0,
163 class Prop1,
class Storage1,
164 template <
class U>
class Allocator>
inline int
168 #ifdef SELDON_CHECK_BOUNDS
169 if (j < 0 || j >= Nmatrix_)
170 throw WrongCol(
"HeterogeneousMatrixCollection::GetN()",
171 string(
"Index should be in [0, ")
172 +
to_str(Nmatrix_ - 1) +
"], but is equal to "
184 template <
class Prop0,
class Storage0,
185 class Prop1,
class Storage1,
186 template <
class U>
class Allocator>
inline int
190 return this->m_ * this->n_;
198 template <
class Prop0,
class Storage0,
199 class Prop1,
class Storage1,
200 template <
class U>
class Allocator>
210 template <
class Prop0,
class Storage0,
211 class Prop1,
class Storage1,
212 template <
class U>
class Allocator>
233 template <
class Prop0,
class Storage0,
234 class Prop1,
class Storage1,
235 template <
class U>
class Allocator>
240 #ifdef SELDON_CHECK_BOUNDS
241 if (i < 0 || i >= Mmatrix_)
242 throw WrongRow(
"HeterogeneousMatrixCollection::GetType()",
243 string(
"Index should be in [0, ")
244 +
to_str(Mmatrix_ - 1) +
"], but is equal to "
246 if (j < 0 || j >= Nmatrix_)
247 throw WrongCol(
"HeterogeneousMatrixCollection::GetType()",
248 string(
"Index should be in [0, ")
249 +
to_str(Nmatrix_ - 1) +
"], but is equal to "
252 return collection_(i, j);
261 template <
class Prop0,
class Storage0,
262 class Prop1,
class Storage1,
263 template <
class U>
class Allocator>
inline typename
269 return float_dense_c_;
277 template <
class Prop0,
class Storage0,
278 class Prop1,
class Storage1,
279 template <
class U>
class Allocator>
inline const typename
285 return float_dense_c_;
293 template <
class Prop0,
class Storage0,
294 class Prop1,
class Storage1,
295 template <
class U>
class Allocator>
inline typename
296 HeterogeneousMatrixCollection<Prop0, Storage0, Prop1, Storage1, Allocator>
301 return float_sparse_c_;
309 template <
class Prop0,
class Storage0,
310 class Prop1,
class Storage1,
311 template <
class U>
class Allocator>
inline const typename
317 return float_sparse_c_;
325 template <
class Prop0,
class Storage0,
326 class Prop1,
class Storage1,
327 template <
class U>
class Allocator>
inline typename
328 HeterogeneousMatrixCollection<Prop0, Storage0, Prop1, Storage1, Allocator>
333 return double_dense_c_;
341 template <
class Prop0,
class Storage0,
342 class Prop1,
class Storage1,
343 template <
class U>
class Allocator>
inline const typename
349 return double_dense_c_;
357 template <
class Prop0,
class Storage0,
358 class Prop1,
class Storage1,
359 template <
class U>
class Allocator>
inline typename
360 HeterogeneousMatrixCollection<Prop0, Storage0, Prop1, Storage1, Allocator>
365 return double_sparse_c_;
373 template <
class Prop0,
class Storage0,
374 class Prop1,
class Storage1,
375 template <
class U>
class Allocator>
inline const typename
381 return double_sparse_c_;
394 template <
template <
class U>
class Allocator>
396 Matrix<FloatDouble, General, DenseSparseCollection, Allocator<double> >
409 template <
template <
class U>
class Allocator>
421 #define SELDON_FILE_MATRIX_HETEROGENEOUS_COLLECTION_INLINE_CXX
float_sparse_c & GetFloatSparse()
Returns the collection of float sparse underlying matrices.
double_sparse_c & GetDoubleSparse()
Returns the collection of double sparse underlying matrices.
Base class for all matrices.
int GetSize() const
Returns the number of elements stored in memory.
std::string to_str(const T &input)
Converts most types to string.
size_t GetMemorySize() const
Returns size of A in bytes used to store the matrix.
Matrix class made of an heterogeneous collection of matrices.
HeterogeneousMatrixCollection()
Default constructor.
int GetNmatrix() const
Returns the number of columns.
int GetM() const
Returns the number of rows.
int GetType(int i, int j) const
Returns the type of a given underlying matrix.
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 GetMmatrix() const
Returns the number of rows.
~HeterogeneousMatrixCollection()
Destructor.
int GetN() const
Returns the number of columns.
int GetDataSize() const
Returns the number of elements stored in memory.