|
| template<typename M, typename F> |
| void | mtl::io::for_each_nonzero (const M &A, F &&f) |
| | Generic fallback: scan (i,j) and report entries that differ from zero.
|
| template<typename Value, typename Parameters, typename F> |
| void | mtl::io::for_each_nonzero (const mat::compressed2D< Value, Parameters > &A, F &&f) |
| | CSR: iterate the three arrays directly (O(nnz)), skipping stored zeros.
|
| template<typename Value, typename Parameters, typename F> |
| void | mtl::io::for_each_nonzero (const mat::coordinate2D< Value, Parameters > &A, F &&f) |
| | COO: iterate the stored triplets (O(nnz)), skipping stored zeros.
|
| template<typename Value, typename Parameters, typename F> |
| void | mtl::io::for_each_nonzero (const mat::ell_matrix< Value, Parameters > &A, F &&f) |
| | ELLPACK: iterate the packed rows up to the invalid sentinel (O(nnz)), skipping stored zeros.
|
| std::size_t | mtl::io::detail::scale_index (std::size_t idx, std::size_t span, std::size_t dim) |
| | floor(idx * span / dim) for idx < dim and span <= dim, without overflowing the intermediate product for huge logical dimensions.
|
| template<typename M> |
| spy_grid< magnitude_t< typename M::value_type > > | mtl::io::detail::build_spy_grid (const M &A, std::size_t max_pixels) |
| void | mtl::io::detail::colormap (double t, std::uint8_t &r, std::uint8_t &gc, std::uint8_t &b) |
| | Compact viridis-like colormap: t in [0,1] -> (r,g,b), 8-bit.
|
| template<typename M> |
| void | mtl::io::spy (const M &A, const std::filesystem::path &path, const spy_options &opt={}) |
| | Binary non-zero pattern: black mark on white where the matrix has a non-zero (MATLAB spy).
|
| template<typename M> |
| void | mtl::io::spy_magnitude (const M &A, const std::filesystem::path &path, const spy_options &opt={}) |
| | Non-zero pattern colored by per-cell max |a_ij| (analog of imagesc(abs(A))).
|
| template<typename M> |
| void | mtl::io::spy_density (const M &A, const std::filesystem::path &path, const spy_options &opt={}) |
| | Non-zero pattern colored by per-cell non-zero count – reveals clustering once a large matrix is down-sampled.
|