Function Utils::isZero(const arma::sp_mat&, double)

Function Documentation

bool Utils::isZero(const arma::sp_mat &M, double tol = 1e-6) noexcept

Checks if a matrix is a zero matrix. Optimized for sparse matrices.

Parameters
  • M – The input matrix

  • tol – A numerical tolerance

Returns

True if all elements are zero