30 #ifndef ATBSPARSEMATRIX_LEGACY_HH 31 #define ATBSPARSEMATRIX_LEGACY_HH 145 template<
int NRows,
int NCols>
146 SparseMatrix(blitz::TinyMatrix<T,NRows,NCols>
const &m);
166 void resize(
size_t r,
size_t c);
175 size_t nRows()
const;
184 size_t nColumns()
const;
193 blitz::TinyVector<size_t,2> shape()
const;
202 size_t nNonZeroEntries()
const;
218 void clearRow(
size_t r);
227 void clearColumn(
size_t c);
273 bool nonZero(
size_t r,
size_t c)
const;
286 T
const &operator()(
size_t r,
size_t c)
const;
304 T &operator()(
size_t r,
size_t c);
326 blitz::Array<T,2> toBlitz()
const;
353 void operator*=(T
const &alpha);
362 void operator/=(T
const &alpha);
377 void save(std::string
const &fileName, std::string
const &groupName,
378 bool throwErrors =
false);
396 void load(std::string
const &fileName, std::string
const &groupName,
397 bool throwErrors =
false);
401 void updateColumn(
size_t c)
const;
403 size_t _nRows, _nColumns;
404 std::vector< SparseVector<T> > _rows;
407 mutable std::vector<bool> _columnsValid;
408 mutable std::vector< SparseVector<T> > _columns;
455 template<
typename T,
int Dim>
508 #include "SparseMatrix.icc" Exception specialization for error handling within libArrayToolbox.
std::map< size_t, T >::const_iterator const_iterator
The SparseMatrixError class is the exception type thrown when SparseMatrix operations fail...
The SparseMatrix class provides a sparse matrix data structure and corresponding arithmetics.
Objects of the RuntimeError class are thrown in case of errors while processing ArrayToolbox function...
~SparseMatrixError()
Destructor.
Lightweight alternative to libBlitzHDF5 providing its basic functionality.
Polynomial< CoeffT > operator*(const Polynomial< CoeffT > &p1, const Polynomial< CoeffT > &p2)
Multiplication operator.
SparseMatrixError(std::string const &message="")
Create a new SparseMatrixError object with given error message.