Skip to content

num::symmetric_part

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

spmat symmetric_part(const spmat &A);

Compute \((A + A^{T})/2\), the symmetric part of a square matrix.

Parameters

  • A: Square CSR matrix.

Return value

CSR matrix whose pattern is that of A unioned with its transpose.

Exceptions

  • std::invalid_argument: If A is not square.