Skip to content

Commit 1ab9f58

Browse files
committed
feat: add ndarray/vector namespace
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent c08c18d commit 1ab9f58

File tree

7 files changed

+442
-0
lines changed

7 files changed

+442
-0
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 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+
# Vector
22+
23+
> Vector constructors and associated utilities.
24+
25+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
26+
27+
<section class="intro">
28+
29+
</section>
30+
31+
<!-- /.intro -->
32+
33+
<!-- Package usage documentation. -->
34+
35+
<section class="usage">
36+
37+
## Usage
38+
39+
```javascript
40+
var ns = require( '@stdlib/ndarray/vector' );
41+
```
42+
43+
#### ns
44+
45+
Namespace containing ndarray vector constructors and associated utilities.
46+
47+
```javascript
48+
var o = ns;
49+
// returns {...}
50+
```
51+
52+
The namespace exports the following:
53+
54+
<!-- <toc pattern="*"> -->
55+
56+
<!-- </toc> -->
57+
58+
</section>
59+
60+
<!-- /.usage -->
61+
62+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
63+
64+
<section class="notes">
65+
66+
</section>
67+
68+
<!-- /.notes -->
69+
70+
<!-- Package usage examples. -->
71+
72+
<section class="examples">
73+
74+
## Examples
75+
76+
<!-- TODO: better examples -->
77+
78+
<!-- eslint no-undef: "error" -->
79+
80+
```javascript
81+
var objectKeys = require( '@stdlib/utils/keys' );
82+
var ns = require( '@stdlib/ndarray/vector' );
83+
84+
console.log( objectKeys( ns ) );
85+
```
86+
87+
</section>
88+
89+
<!-- /.examples -->
90+
91+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
92+
93+
<section class="related">
94+
95+
</section>
96+
97+
<!-- /.related -->
98+
99+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
100+
101+
<section class="links">
102+
103+
</section>
104+
105+
<!-- /.links -->
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 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: 4.1
20+
21+
/* eslint-disable max-lines */
22+
23+
import Float64Vector = require( '@stdlib/ndarray/vector/float64' );
24+
25+
/**
26+
* Interface describing a namespace.
27+
*/
28+
interface Namespace {
29+
/**
30+
* TODO
31+
*/
32+
Float64Vector: typeof Float64Vector;
33+
}
34+
35+
/**
36+
* Vector constructors and associated utilities.
37+
*/
38+
declare var ns: Namespace;
39+
40+
41+
// EXPORTS //
42+
43+
export = ns;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 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+
/* eslint-disable @typescript-eslint/no-unused-expressions */
20+
21+
import ns = require( './index' );
22+
23+
24+
// TESTS //
25+
26+
// The exported value is the expected interface...
27+
{
28+
ns; // $ExpectType Namespace
29+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 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+
'use strict';
20+
21+
var objectKeys = require( '@stdlib/utils/keys' );
22+
var ns = require( './../lib' );
23+
24+
console.log( objectKeys( ns ) );
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 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+
'use strict';
20+
21+
/*
22+
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
23+
*/
24+
25+
// MODULES //
26+
27+
var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
28+
29+
30+
// MAIN //
31+
32+
/**
33+
* Namespace.
34+
*
35+
* @namespace ns
36+
*/
37+
var ns = {};
38+
39+
/**
40+
* @name BooleanVector
41+
* @memberof ns
42+
* @readonly
43+
* @type {Function}
44+
* @see {@link module:@stdlib/ndarray/vector/bool}
45+
*/
46+
setReadOnly( ns, 'BooleanVector', require( '@stdlib/ndarray/vector/bool' ) );
47+
48+
/**
49+
* @name vector
50+
* @memberof ns
51+
* @readonly
52+
* @type {Function}
53+
* @see {@link module:@stdlib/ndarray/vector/ctor}
54+
*/
55+
setReadOnly( ns, 'vector', require( '@stdlib/ndarray/vector/ctor' ) );
56+
57+
/**
58+
* @name Float32Vector
59+
* @memberof ns
60+
* @readonly
61+
* @type {Function}
62+
* @see {@link module:@stdlib/ndarray/vector/float32}
63+
*/
64+
setReadOnly( ns, 'Float32Vector', require( '@stdlib/ndarray/vector/float32' ) );
65+
66+
/**
67+
* @name Float64Vector
68+
* @memberof ns
69+
* @readonly
70+
* @type {Function}
71+
* @see {@link module:@stdlib/ndarray/vector/float64}
72+
*/
73+
setReadOnly( ns, 'Float64Vector', require( '@stdlib/ndarray/vector/float64' ) );
74+
75+
/**
76+
* @name Int8Vector
77+
* @memberof ns
78+
* @readonly
79+
* @type {Function}
80+
* @see {@link module:@stdlib/ndarray/vector/int8}
81+
*/
82+
setReadOnly( ns, 'Int8Vector', require( '@stdlib/ndarray/vector/int8' ) );
83+
84+
/**
85+
* @name Int16Vector
86+
* @memberof ns
87+
* @readonly
88+
* @type {Function}
89+
* @see {@link module:@stdlib/ndarray/vector/int16}
90+
*/
91+
setReadOnly( ns, 'Int16Vector', require( '@stdlib/ndarray/vector/int16' ) );
92+
93+
/**
94+
* @name Int32Vector
95+
* @memberof ns
96+
* @readonly
97+
* @type {Function}
98+
* @see {@link module:@stdlib/ndarray/vector/int32}
99+
*/
100+
setReadOnly( ns, 'Int32Vector', require( '@stdlib/ndarray/vector/int32' ) );
101+
102+
/**
103+
* @name Uint8Vector
104+
* @memberof ns
105+
* @readonly
106+
* @type {Function}
107+
* @see {@link module:@stdlib/ndarray/vector/uint8}
108+
*/
109+
setReadOnly( ns, 'Uint8Vector', require( '@stdlib/ndarray/vector/uint8' ) );
110+
111+
/**
112+
* @name Uint8ClampedVector
113+
* @memberof ns
114+
* @readonly
115+
* @type {Function}
116+
* @see {@link module:@stdlib/ndarray/vector/uint8c}
117+
*/
118+
setReadOnly( ns, 'Uint8ClampedVector', require( '@stdlib/ndarray/vector/uint8c' ) );
119+
120+
/**
121+
* @name Uint16Vector
122+
* @memberof ns
123+
* @readonly
124+
* @type {Function}
125+
* @see {@link module:@stdlib/ndarray/vector/uint16}
126+
*/
127+
setReadOnly( ns, 'Uint16Vector', require( '@stdlib/ndarray/vector/uint16' ) );
128+
129+
/**
130+
* @name Uint32Vector
131+
* @memberof ns
132+
* @readonly
133+
* @type {Function}
134+
* @see {@link module:@stdlib/ndarray/vector/uint32}
135+
*/
136+
setReadOnly( ns, 'Uint32Vector', require( '@stdlib/ndarray/vector/uint32' ) );
137+
138+
139+
// EXPORTS //
140+
141+
module.exports = ns;

0 commit comments

Comments
 (0)