MathPHP\LinearAlgebra\MatrixOperationsTest::testMap PHP Метод

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

public testMap ( )
    public function testMap()
    {
        $A = MatrixFactory::create([[1, 2, 3], [4, 5, 6], [7, 8, 9]]);
        $doubler = function ($x) {
            return $x * 2;
        };
        $R = $A->map($doubler);
        $E = MatrixFactory::create([[2, 4, 6], [8, 10, 12], [14, 16, 18]]);
        $this->assertEquals($E, $R);
    }
MatrixOperationsTest