isEquivalent method

bool isEquivalent(
  1. Matrix matrxiB
)

Check if two matrices are equivalent

  • matrixB The matrix to compare
  • Returns True if the matrices are equivalent

Implementation

bool isEquivalent(Matrix matrxiB) {
  if (matrxiB._col != _col && matrxiB._row != _row) {
    return false;
  } else {
    for (var row = 0; row < _matrix.length; row++) {
      for (var col = 0; col < _matrix[0].length; col++) {
        if (matrxiB.getAt(row, col) != getAt(row, col)) {
          return false;
        }
      }
    }
    return true;
  }
}