|
||
---|---|---|
.. | ||
docs | ||
lib | ||
package.json | ||
README.md |
isSymmetricMatrix
Test if a value is a symmetric matrix.
Usage
var isSymmetricMatrix = require( '@stdlib/assert/is-symmetric-matrix' );
isSymmetricMatrix( value )
Tests if a value is a symmetric matrix.
var ndarray = require( '@stdlib/ndarray/ctor' );
var arr = ndarray( 'generic', [ 0, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
var bool = isSymmetricMatrix( arr );
// returns true
Examples
var ndarray = require( '@stdlib/ndarray/ctor' );
var isSymmetricMatrix = require( '@stdlib/assert/is-symmetric-matrix' );
var arr = ndarray( 'generic', [ 0, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
var out = isSymmetricMatrix( arr );
// returns true
out = isSymmetricMatrix( [ 1, 2, 3, 4 ] );
// returns false
out = isSymmetricMatrix( {} );
// returns false
out = isSymmetricMatrix( null );
// returns false