Skip to content

num::sparse_congruence

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

spmat sparse_congruence(const spmat &A, view<const real> weights);

Scale the rows and columns of a sparse matrix by the same weights: \(W A W\), \(W = \mathrm{diag}(w)\). The result has the pattern of A.

Exceptions

  • std::invalid_argument: If the dimensions disagree.