Returns a NumArray with the same size, but filled with 1
public static onesLike ( |
||
$numArray | given NumArray | |
Résultat |
/** * Tests NumPHP::onesLike with 3x2 matrix */ public function testOnesLike() { $numArray = new NumArray([[1, 1], [1, 1], [1, 1]]); $expectedNumArray = NumPHP::ones(3, 2); $this->assertNumArrayEquals($expectedNumArray, NumPHP::onesLike($numArray)); }