Skip to content

Commit 616fc9d

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents c43823b + 50eeb8b commit 616fc9d

File tree

403 files changed

+55953
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

403 files changed

+55953
-107
lines changed

lib/node_modules/@stdlib/assert/docs/types/index.d.ts

+5,955
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2021 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/* tslint:disable:no-unused-expression */
20+
21+
import assert = require( './index' );
22+
23+
24+
// TESTS //
25+
26+
// The exported value is the expected interface...
27+
{
28+
assert; // $ExpectType ASSERT
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2021 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// TypeScript Version: 2.0
20+
21+
/**
22+
* Tests if a value is a centrosymmetric matrix.
23+
*
24+
* ## Notes
25+
*
26+
* - The implementation must rely on manually checking that \\(M_{ij} = M_{N-i-1,N-j-1}\\), and, while element access is deterministic, no way exists to prevent cache misses outside of reordering the underlying matrix elements, thus incurring a larger performance penalty than just "jumping around" in a single pass.
27+
* - Worst case scenario: O(N^2).
28+
*
29+
* @param v - value to test
30+
* @returns boolean indicating if a value is a centrosymmetric matrix
31+
*
32+
* @example
33+
* var ndarray = require( `@stdlib/ndarray/ctor` );
34+
*
35+
* var arr = ndarray( 'generic', [ 2, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
36+
*
37+
* var bool = isCentrosymmetricMatrix( arr );
38+
* // returns true
39+
*
40+
* bool = isCentrosymmetricMatrix( [] );
41+
* // returns false
42+
*/
43+
declare function isCentrosymmetricMatrix( v: any ): boolean;
44+
45+
46+
// EXPORTS //
47+
48+
export = isCentrosymmetricMatrix;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2021 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/* tslint:disable:no-invalid-this */
20+
21+
import isCentrosymmetricMatrix = require( './index' );
22+
23+
24+
// TESTS //
25+
26+
// The function returns a boolean...
27+
{
28+
const matrix = {
29+
'data': [ 2, 1, 1, 2 ],
30+
'ndims': 2,
31+
'shape': [ 2, 2 ],
32+
'strides': [ 2, 1 ],
33+
'offset': 0,
34+
'order': 'row-major',
35+
'dtype': 'generic',
36+
'length': 4,
37+
'flags': {},
38+
'get': function get( i: number, j: number ): number {
39+
const idx = ( this.strides[ 0 ] * i ) + ( this.strides[ 1 ] * j );
40+
return this.data[ idx ];
41+
},
42+
'set': function set( i: number, j: number, v: number ): number {
43+
const idx = ( this.strides[ 0 ] * i ) + ( this.strides[ 1 ] * j );
44+
this.data[ idx ] = v;
45+
return v;
46+
}
47+
};
48+
isCentrosymmetricMatrix( matrix ); // $ExpectType boolean
49+
isCentrosymmetricMatrix( [] ); // $ExpectType boolean
50+
isCentrosymmetricMatrix( false ); // $ExpectType boolean
51+
}
52+
53+
// The compiler throws an error if the function is provided an unsupported number of arguments...
54+
{
55+
isCentrosymmetricMatrix(); // $ExpectError
56+
}

lib/node_modules/@stdlib/assert/is-centrosymmetric-matrix/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"lib": "./lib",
2222
"test": "./test"
2323
},
24+
"types": "./docs/types",
2425
"scripts": {},
2526
"homepage": "https://github.com/stdlib-js/stdlib",
2627
"repository": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2021 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// TypeScript Version: 2.0
20+
21+
/**
22+
* Tests if a value is a plain object containing a circular reference.
23+
*
24+
* @param value - value to test
25+
* @returns boolean indicating whether value is a plain object containing a circular reference
26+
*
27+
* @example
28+
* var obj = {
29+
* 'a': 'beep',
30+
* 'b': {
31+
* 'c': 'boop'
32+
* }
33+
* };
34+
* obj.b.self = obj;
35+
* var bool = isCircularPlainObject( obj );
36+
* // returns true
37+
*
38+
* @example
39+
* var arr = [ 1, 2, 3 ];
40+
* arr.push( arr );
41+
* var bool = isCircularPlainObject( arr );
42+
* // returns false
43+
*
44+
* @example
45+
* var bool = isCircularPlainObject( {} );
46+
* // returns false
47+
*
48+
* @example
49+
* var bool = isCircularPlainObject( null );
50+
* // returns false
51+
*/
52+
declare function isCircularPlainObject( value: any ): boolean;
53+
54+
55+
// EXPORTS //
56+
57+
export = isCircularPlainObject;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2021 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
import isCircularPlainObject = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a boolean...
25+
{
26+
isCircularPlainObject( {} ); // $ExpectType boolean
27+
isCircularPlainObject( [] ); // $ExpectType boolean
28+
}
29+
30+
// The compiler throws an error if the function is provided an unsupported number of arguments...
31+
{
32+
isCircularPlainObject(); // $ExpectError
33+
isCircularPlainObject( [], 123 ); // $ExpectError
34+
}

lib/node_modules/@stdlib/assert/is-circular-plain-object/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"lib": "./lib",
2222
"test": "./test"
2323
},
24+
"types": "./docs/types",
2425
"scripts": {},
2526
"homepage": "https://github.com/stdlib-js/stdlib",
2627
"repository": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2021 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// TypeScript Version: 2.0
20+
21+
/**
22+
* Tests if a value is a complex typed array.
23+
*
24+
* @param value - value to test
25+
* @returns boolean indicating if a value is a complex typed array
26+
*
27+
* @example
28+
* var Complex128Array = require( `@stdlib/array/complex128` );
29+
*
30+
* var bool = isComplexTypedArray( new Complex128Array( 10 ) );
31+
* // returns true
32+
*/
33+
declare function isComplexTypedArray( value: any ): boolean;
34+
35+
36+
// EXPORTS //
37+
38+
export = isComplexTypedArray;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2021 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
import isComplexTypedArray = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a boolean...
25+
{
26+
isComplexTypedArray( [] ); // $ExpectType boolean
27+
}
28+
29+
// The compiler throws an error if the function is provided an unsupported number of arguments...
30+
{
31+
isComplexTypedArray(); // $ExpectError
32+
isComplexTypedArray( [], 123 ); // $ExpectError
33+
}

lib/node_modules/@stdlib/assert/is-complex-typed-array/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"lib": "./lib",
2222
"test": "./test"
2323
},
24+
"types": "./docs/types",
2425
"scripts": {},
2526
"homepage": "https://github.com/stdlib-js/stdlib",
2627
"repository": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2021 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// TypeScript Version: 2.0
20+
21+
/**
22+
* Tests if a value is a Complex128Array.
23+
*
24+
* @param value - value to test
25+
* @returns boolean indicating whether value is a Complex128Array
26+
*
27+
* @example
28+
* var bool = isComplex128Array( new Complex128Array( 10 ) );
29+
* // returns true
30+
*
31+
* @example
32+
* var bool = isComplex128Array( [] );
33+
* // returns false
34+
*/
35+
declare function isComplex128Array( value: any ): boolean;
36+
37+
38+
// EXPORTS //
39+
40+
export = isComplex128Array;

0 commit comments

Comments
 (0)