Ejemplo n.º 1
0
 public function inverse()
 {
     $determinant = new Determinant($this->matrix);
     $factor = $determinant->retrieve();
     if ($factor === $this->valueZero) {
         throw new NotInverseException();
     }
     $factor = 1 / $factor;
     $transposed = $this->transposed();
     $operations = new Operations($transposed, $this->precision);
     $adjugate = $operations->adjugateMatrix();
     $operations = new Operations($adjugate, $this->precision);
     return $operations->multiplicationScalar($factor);
 }