Skip to content

Commit 5306dac

Browse files
committed
feat: add blas/base/wasm 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed ---
1 parent 8663446 commit 5306dac

File tree

7 files changed

+610
-0
lines changed

7 files changed

+610
-0
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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+
# BLAS
22+
23+
> Basic linear algebra subprograms (BLAS) compiled to WebAssembly.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var blas = require( '@stdlib/blas/base/wasm' );
31+
```
32+
33+
#### blas
34+
35+
Namespace for basic linear algebra subprograms (BLAS) compiled to WebAssembly.
36+
37+
```javascript
38+
var o = blas;
39+
// returns {...}
40+
```
41+
42+
### BLAS Level 1
43+
44+
<!-- <toc pattern="+(*amax|*asum|*axpy|*copy|*dot*|*imax1|*nrm2|*rot*|*scal|*sum1|*swap)"> -->
45+
46+
<div class="namespace-toc">
47+
48+
</div>
49+
50+
<!-- </toc> -->
51+
52+
### BLAS Level 2
53+
54+
<!-- <toc pattern="+(*gemv|*ger|*hemv|*symv|*her*|*syr*|*trmv|*trsv|*pmv|*hpmv|*spmv|*hpr*|*spr*|*tmpv|*tpsv|*gbmv|*hbmv|*sbmv|*tbmv|*tbsv)"> -->
55+
56+
<div class="namespace-toc">
57+
58+
</div>
59+
60+
<!-- </toc> -->
61+
62+
### BLAS Level 3
63+
64+
<!-- <toc pattern="+(*gemm|*hemm|*symm|*herk|*syrk|*her2k|*syr2k|*trmm|*trsm)"> -->
65+
66+
<div class="namespace-toc">
67+
68+
</div>
69+
70+
<!-- </toc> -->
71+
72+
</section>
73+
74+
<!-- /.usage -->
75+
76+
<section class="examples">
77+
78+
## Examples
79+
80+
<!-- TODO: better examples -->
81+
82+
<!-- eslint no-undef: "error" -->
83+
84+
```javascript
85+
var objectKeys = require( '@stdlib/utils/keys' );
86+
var blas = require( '@stdlib/blas/base/wasm' );
87+
88+
console.log( objectKeys( blas ) );
89+
```
90+
91+
</section>
92+
93+
<!-- /.examples -->
94+
95+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
96+
97+
<section class="related">
98+
99+
</section>
100+
101+
<!-- /.related -->
102+
103+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
104+
105+
<section class="links">
106+
107+
<!-- <toc-links> -->
108+
109+
<!-- </toc-links> -->
110+
111+
</section>
112+
113+
<!-- /.links -->
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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 dasum = require( '@stdlib/blas/base/dasum' );
24+
25+
/**
26+
* Interface describing the namespace.
27+
*/
28+
interface Namespace {
29+
/**
30+
* Computes the sum of the absolute values.
31+
*
32+
* @param N - number of indexed elements
33+
* @param x - input array
34+
* @param stride - stride length
35+
* @returns sum of absolute values
36+
*
37+
* @example
38+
* var Float64Array = require( '@stdlib/array/float64' );
39+
*
40+
* var x = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );
41+
*
42+
* var z = ns.dasum( x.length, x, 1 );
43+
* // returns 15.0
44+
*
45+
* @example
46+
* var Float64Array = require( '@stdlib/array/float64' );
47+
*
48+
* var x = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );
49+
*
50+
* var z = ns.dasum.ndarray( x.length, x, 1, 0 );
51+
* // returns 21.0
52+
*/
53+
dasum: typeof dasum;
54+
}
55+
56+
/**
57+
* Basic linear algebra subprograms (BLAS) compiled to WebAssembly.
58+
*/
59+
declare var ns: Namespace;
60+
61+
62+
// EXPORTS //
63+
64+
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 blas = require( './../lib' );
23+
24+
console.log( objectKeys( blas ) );

0 commit comments

Comments
 (0)