MathPHP\LinearAlgebra\MatrixAxiomsTest::testTraceOfProductIsSameRegardlessOfOrderMultiplied PHP Method

testTraceOfProductIsSameRegardlessOfOrderMultiplied() public method

tr(AB) = tr(BA) Trace of product does not matter the order they were multiplied
    public function testTraceOfProductIsSameRegardlessOfOrderMultiplied(array $A, array $B)
    {
        $A = MatrixFactory::create($A);
        $B = MatrixFactory::create($B);
        $tr⟮AB⟯ = $A->multiply($B)->trace();
        $tr⟮BA⟯ = $B->multiply($A)->trace();
        $this->assertEquals($tr⟮AB⟯, $tr⟮BA⟯);
    }
MatrixAxiomsTest