Skip to content

num::sparse_matvec

Defined in header <linear/sparse/sparse.hpp>

void sparse_matvec(const spmat &A, const vec<real> &x, vec<real> &y);

Multiply a sparse matrix and a vector: \(y \leftarrow A x\), in \(O(\mathrm{nnz})\).

Exceptions

  • std::invalid_argument: If the dimensions do not agree.