MathPHP\LinearAlgebra\MatrixAxiomsTest::testInverseWithLUDecompositionInverse PHP Метод

testInverseWithLUDecompositionInverse() публичный Метод

(PA)⁻¹ = (LU)⁻¹ = U⁻¹L⁻¹ Inverse of the LU decomposition equation is the inverse of the other side.
    public function testInverseWithLUDecompositionInverse(array $A)
    {
        $A = MatrixFactory::create($A);
        $LUP = $A->LUDecomposition();
        $L = $LUP['L'];
        $U = $LUP['U'];
        $P = $LUP['P'];
        $⟮PA⟯⁻¹ = $P->multiply($A)->inverse();
        $⟮LU⟯⁻¹ = $L->multiply($U)->inverse();
        $U⁻¹ = $U->inverse();
        $L⁻¹ = $L->inverse();
        $U⁻¹L⁻¹ = $U⁻¹->multiply($L⁻¹);
        $this->assertEquals($⟮PA⟯⁻¹->getMatrix(), $⟮LU⟯⁻¹->getMatrix());
        $this->assertEquals($⟮LU⟯⁻¹->getMatrix(), $U⁻¹L⁻¹->getMatrix());
        $this->assertEquals($⟮PA⟯⁻¹->getMatrix(), $U⁻¹L⁻¹->getMatrix());
    }
MatrixAxiomsTest