|
| | sparse_accumulator (SizeType n) |
| void | clear () |
| | Reset for a new column assembly. O(1) - just bumps the generation counter.
|
| void | scatter (SizeType i, const Value &val) |
| | Scatter value into position i: x[i] += val.
|
| void | store (SizeType i, const Value &val) |
| | Store value at position i (overwrite, don't accumulate).
|
| bool | is_set (SizeType i) const |
| | Check if position i has been touched in the current generation.
|
| Value | operator() (SizeType i) const |
| | Read value at position i. Returns 0 if not set.
|
| Value & | operator[] (SizeType i) |
| | Mutable access to value at position i.
|
| const std::vector< SizeType > & | indices () const |
| | Return the indices that have been touched in the current generation.
|
| SizeType | nnz () const |
| | Number of nonzeros currently accumulated.
|
| SizeType | size () const |
| | Dimension of the accumulator.
|
template<typename Value, typename SizeType = std::size_t>
class mtl::sparse::util::sparse_accumulator< Value, SizeType >
Sparse accumulator for assembling a sparse column.
Uses a dense workspace with generation-based marking to avoid clearing. This is the "scatter" data structure from CSparse (cs_scatter).