isFullRank method

bool isFullRank({
  1. double tolerance = 0.0,
})

Is the matrix full rank? tolerance a diagonal element of R whose absolute value is less than or equal to tolerance * max(|diag(R)|) counts as zero. The default (0.0) only treats exact zeros as rank deficient. return true if R, and hence A, has full rank.

Implementation

bool isFullRank({double tolerance = 0.0}) {
  var maxDiag = 0.0;
  for (var j = 0; j < _n; j++) {
    maxDiag = _Rdiag[j].abs() > maxDiag ? _Rdiag[j].abs() : maxDiag;
  }
  for (var j = 0; j < _n; j++) {
    if (_Rdiag[j].abs() <= tolerance * maxDiag || _Rdiag[j] == 0) {
      return false;
    }
  }
  return true;
}