Template Class DynamicCsr
Defined in File DynamicCsr.h
Class Documentation
-
template<class I = int, class V = double>
class DynamicCsr a sparse matrix by rows, with indices of type I and values of type V, whose rows are appended and removed
Public Functions
-
inline DynamicCsr(void)
the matrix of no rows
-
inline std::size_t rows(void) const
the number of the rows
-
inline std::size_t nonzeros(void) const
the number of the entries
-
inline bool empty(void) const
-
void reserve(std::size_t r, std::size_t z)
room for r rows and z entries
-
void clear(void)
removes all the rows, keeping the memory
-
std::size_t append(std::span<const I> ind, std::span<const V> val)
appends the row of the entries ( ind[ k ] , val[ k ] ); its index
- Pre:
ind and val have the same length
-
std::size_t append(std::size_t r, const I *beg, const I *ind, const V *val)
appends the r rows of a compressed form: the row k has the entries beg[ k ] - beg[ 0 ] to beg[ k + 1 ] - beg[ 0 ] of ind and val; the index of the first one
- Pre:
beg is not decreasing
-
template<std::ranges::contiguous_range R>
void remove(const R &E) removes the rows of E (a contiguous range of integers, e.g., a std::vector), closing the gaps in one pass
- Pre:
E is strictly increasing and below rows()
-
void remove(std::size_t first, std::size_t last)
removes the rows from first to last, last excluded
- Pre:
first <= last <= rows()
-
inline DynamicCsr(void)