Beispiel #1
0
 /**
  * Check that multiplication is possible when mA is a square
  *
  * @param \Chippyash\Math\Matrix\NumericMatrix $mSq
  * @param \Chippyash\Math\Matrix\NumericMatrix $mB
  * @throws ComputationException
  */
 protected function checkSquareMatrixCompatibility(NumericMatrix $mSq, NumericMatrix $mB)
 {
     if ($mB->is('columnvector') && $mSq->columns() != $mB->rows()) {
         throw new ComputationException('Two matrices cannot be multiplied: mA->columns != mB->rows');
     }
     if ($mB->is('square') && $mSq->vertices() != $mB->vertices()) {
         throw new ComputationException('Two matrices cannot be multiplied: mA->columns != mB->rows');
     }
 }