operator - method

Matrix operator -(
  1. Matrix other
)

Subtract two matrices of same dimensions.

Throws MatrixInvalidDimensions if dimensions do not match.

Implementation

Matrix operator -(Matrix other) {
  if (this.m != other.m || this.n != other.n) throw new MatrixInvalidDimensions();
  return this + ~other;
}