MathPHP\LinearAlgebra\MatrixAxiomsTest::testKroneckerProductScalarMultiplication PHP 메소드

testKroneckerProductScalarMultiplication() 공개 메소드

Axiom: (kA) ⊗ B = A ⊗ (kB) = k(A ⊗ B) Kronecker product scalar multiplication
    public function testKroneckerProductScalarMultiplication(array $A, array $B)
    {
        $A = MatrixFactory::create($A);
        $B = MatrixFactory::create($B);
        $k = 5;
        $⟮kA⟯⊗B = $A->scalarMultiply($k)->kroneckerProduct($B);
        $A⊗⟮kB⟯ = $A->kroneckerProduct($B->scalarMultiply($k));
        $k⟮A⊗B⟯ = $A->kroneckerProduct($B)->scalarMultiply($k);
        $this->assertEquals($⟮kA⟯⊗B->getMatrix(), $A⊗⟮kB⟯->getMatrix());
        $this->assertEquals($⟮kA⟯⊗B->getMatrix(), $k⟮A⊗B⟯->getMatrix());
        $this->assertEquals($k⟮A⊗B⟯->getMatrix(), $A⊗⟮kB⟯->getMatrix());
    }
MatrixAxiomsTest