Check that it's a square matrix.
bool
NumPhp::is_square(
array|NdArray
$m
)
$m
A boolean. True if given matrix is a square matrix, false otherwise.
use SciPhp\NumPhp as np;
// false, it's a 1-dim
np::is_square([1, 2, 3]);
// true, it's a 3x3
np::is_square(
[[1, 2, 3],
[1, 2, 3],
[1, 2, 3]]
);
// false, it's a 4x3
np::is_square(
[[1, 2, 3],
[1, 2, 3],
[1, 2, 3],
[1, 2, 3]]
);