MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::sparse::util::detail Namespace Reference

Functions

template<typename Value, typename Parameters, typename Fill>
mat::compressed2D< Value, Parameters > csr_from_rows (std::size_t nrows, std::size_t ncols, std::size_t nnz, Fill &&fill)
 A compressed2D built row by row, without an inserter (issue 908): the default inserter's 5 slots per row sent longer rows to its std::map, and a permutation keeps every row whole, so the rows can be written directly.

Function Documentation

◆ csr_from_rows()

template<typename Value, typename Parameters, typename Fill>
mat::compressed2D< Value, Parameters > mtl::sparse::util::detail::csr_from_rows ( std::size_t nrows,
std::size_t ncols,
std::size_t nnz,
Fill && fill )

A compressed2D built row by row, without an inserter (issue 908): the default inserter's 5 slots per row sent longer rows to its std::map, and a permutation keeps every row whole, so the rows can be written directly.

fill(i, buf) appends new row i's (column, value) pairs, columns unique and in any order; they are sorted by column here.