28 #ifndef SPLA_CPU_FORMAT_CSR_HPP
29 #define SPLA_CPU_FORMAT_CSR_HPP
44 storage.
Ap.resize(n_rows + 1);
45 storage.
Aj.resize(n_values);
46 storage.
Ax.resize(n_values);
58 assert(out.
Ax.empty());
60 for (
uint i = 0; i < n_rows; i++) {
61 for (
uint j = Ap[i]; j < Ap[i + 1]; j++) {
62 out.
Ax.insert(robin_hood::pair<std::pair<uint, uint>, T>(std::pair<uint, uint>(i, Aj[j]), Ax[j]));
79 assert(Ri.size() == in.
values);
80 assert(Rj.size() == in.
values);
81 assert(Rx.size() == in.
values);
83 for (
uint i = 0; i < n_rows; i++) {
84 for (
uint j = Ap[i]; j < Ap[i + 1]; j++) {
CPU list of coordinates matrix format.
Definition: cpu_formats.hpp:148
std::vector< uint > Aj
Definition: cpu_formats.hpp:155
std::vector< T > Ax
Definition: cpu_formats.hpp:156
std::vector< uint > Ai
Definition: cpu_formats.hpp:154
CPU compressed sparse row matrix format.
Definition: cpu_formats.hpp:166
std::vector< uint > Ap
Definition: cpu_formats.hpp:172
std::vector< uint > Aj
Definition: cpu_formats.hpp:173
std::vector< T > Ax
Definition: cpu_formats.hpp:174
Dictionary of keys sparse matrix format.
Definition: cpu_formats.hpp:128
robin_hood::unordered_flat_map< Key, T, pair_hash > Ax
Definition: cpu_formats.hpp:137
uint values
Definition: tdecoration.hpp:58
void cpu_csr_to_dok(uint n_rows, const CpuCsr< T > &in, CpuDok< T > &out)
Definition: cpu_format_csr.hpp:51
void cpu_csr_to_coo(uint n_rows, const CpuCsr< T > &in, CpuCoo< T > &out)
Definition: cpu_format_csr.hpp:68
void cpu_csr_resize(const uint n_rows, const uint n_values, CpuCsr< T > &storage)
Definition: cpu_format_csr.hpp:41
std::uint32_t uint
Library index and size type.
Definition: config.hpp:56
Definition: algorithm.hpp:37