Template Class SellMatrix

Class Documentation

template<std::size_t C = 4>
class SellMatrix

a sparse matrix of doubles in SELL-C-sigma, chunks of C rows (4 by default, the fastest on a Xeon Gold 5120 with AVX-512: the gathers of 8 lanes cost more than they save)

Public Functions

explicit SellMatrix(const CsrMatrix &A, std::size_t sigma = 256)

the matrix A, its rows sorted by length within windows of sigma rows

Pre:

sigma >= 1 and m < 2^32

inline std::size_t rows(void) const
inline std::size_t cols(void) const
inline std::size_t nonzeros(void) const

the nonzeros of A, and the places with the padding

inline std::size_t places(void) const
void multiply(const double *x, double *y) const

y = A x into y, which must have m entries

Pre:

x has n entries and y m entries, apart from x

void multiply(const double *x, double *y, std::size_t first, std::size_t last) const

the entries of y = A x of the rows of the chunks [ first , last ) of C rows (by the permutation), so that the chunks may be split among threads

Pre:

x has n entries and y m entries, apart from x, first <= last <= chunks()

inline std::size_t chunks(void) const

the number of chunks

inline std::size_t chunkStart(std::size_t c) const

the place where the chunk c starts, chunks() for the end

std::vector<double> multiply(const std::vector<double> &x) const

y = A x

Pre:

x has n entries