code: public function checkMatrixDimensions($B = null)
      {
          if ($B instanceof self) {
              if (($this->m == $B->getRowDimension()) && ($this->n == $B->getColumnDimension())) {
                  return true;
              }
  
              throw new CalculationException(self::MATRIX_DIMENSION_EXCEPTION);
          }
  
          throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
      }
docs: checkMatrixDimensions.
  
  Is matrix B the same size?
  
  @param Matrix $B Matrix B
  
  @return bool