Check that it's a square matrix.
bool
NdArray::is_square()
This function has no parameters.
A boolean. True if it's a square matrix, false otherwise.
use SciPhp\NumPhp as np;
// false, it's a 1-dim
np::ar([1, 2, 3])->is_square();
// true, it's a 3x3
np::ar(
[[1, 2, 3],
[1, 2, 3],
[1, 2, 3]]
)->is_square();
// false, it's a 4x3
np::ar(
[[1, 2, 3],
[1, 2, 3],
[1, 2, 3],
[1, 2, 3]]
)->is_square();