nullity method

int nullity()

Returns the nullity of the matrix.

The nullity is the dimension of the null space of the matrix.

Example:

Matrix A = Matrix.fromList([
  [1, 2, 3],
  [0, 1, 1],
  [0, 0, 0]
]);

print(A.nullity()); // Output: 1

Implementation

int nullity() {
  return columnCount - rank();
}