/** * Tests if Helper::isSquareMatrix works with valid square matrix */ public function testCheckSquareMatrixValid() { $numArray = NumPHP::eye(3); $this->assertTrue(Helper::isSquareMatrix($numArray)); }
/** * Build the lower triangular matrix from given matrix * * @param NumArray $numArray given matrix * * @return NumArray * * @since 1.0.0 */ protected static function buildLMatrix(NumArray $numArray) { $shape = $numArray->getShape(); $numArray->add(NumPHP::eye($shape[0], $shape[1])); return $numArray; }
/** * Tests NumPHP::identity with argument 3 */ public function testIdentity() { $numArray = NumPHP::identity(3); $expectedNumArray = NumPHP::eye(3, 3); $this->assertNumArrayEquals($expectedNumArray, $numArray); }