README.md (2005B)
1 <!-- 2 3 @license Apache-2.0 4 5 Copyright (c) 2018 The Stdlib Authors. 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 19 --> 20 21 # isCentrosymmetricMatrix 22 23 > Test if a value is a [centrosymmetric matrix][centrosymmetric-matrix]. 24 25 <section class="usage"> 26 27 ## Usage 28 29 ```javascript 30 var isCentrosymmetricMatrix = require( '@stdlib/assert/is-centrosymmetric-matrix' ); 31 ``` 32 33 #### isCentrosymmetricMatrix( value ) 34 35 Tests if a value is a [centrosymmetric matrix][centrosymmetric-matrix]. 36 37 <!-- eslint-disable array-element-newline --> 38 39 ```javascript 40 var ndarray = require( '@stdlib/ndarray/ctor' ); 41 42 var buffer = [ 43 1, 2, 3, 44 4, 5, 4, 45 3, 2, 1 46 ]; 47 var arr = ndarray( 'generic', buffer, [ 3, 3 ], [ 3, 1 ], 0, 'row-major' ); 48 49 var bool = isCentrosymmetricMatrix( arr ); 50 // returns true 51 ``` 52 53 </section> 54 55 <!-- /.usage --> 56 57 <section class="examples"> 58 59 ## Examples 60 61 <!-- eslint no-undef: "error" --> 62 63 ```javascript 64 var ndarray = require( '@stdlib/ndarray/ctor' ); 65 var isCentrosymmetricMatrix = require( '@stdlib/assert/is-centrosymmetric-matrix' ); 66 67 var arr = ndarray( 'generic', [ 2, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); 68 69 var out = isCentrosymmetricMatrix( arr ); 70 // returns true 71 72 out = isCentrosymmetricMatrix( [ 1, 2, 3, 4 ] ); 73 // returns false 74 75 out = isCentrosymmetricMatrix( {} ); 76 // returns false 77 78 out = isCentrosymmetricMatrix( null ); 79 // returns false 80 ``` 81 82 </section> 83 84 <!-- /.examples --> 85 86 <section class="links"> 87 88 [centrosymmetric-matrix]: https://en.wikipedia.org/wiki/Centrosymmetric_matrix 89 90 </section> 91 92 <!-- /.links -->