Skip to content

Latest commit

 

History

History

is-symmetric-matrix

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 ctor = require( '@stdlib/ndarray/ctor' );

var ndarray = ctor( 'generic', 2 );
var arr = ndarray( [ 0, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );

var bool = isSymmetricMatrix( arr );
// returns true

Examples

var ctor = require( '@stdlib/ndarray/ctor' );
var isSymmetricMatrix = require( '@stdlib/assert/is-symmetric-matrix' );

var ndarray = ctor( 'generic', 2 );
var arr = ndarray( [ 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