Skip to content

Commit 1d595e0

Browse files
committed
docs: add readme
--- 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: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - 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: na - task: lint_license_headers status: passed ---
1 parent ec09f0f commit 1d595e0

File tree

5 files changed

+261
-12
lines changed

5 files changed

+261
-12
lines changed
Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
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+
# dlascl
22+
23+
> Multiplies a real M by N matrix `A` by a real scalar `CTO/CFROM`.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var dlascl = require( '@stdlib/lapack/base/dlascl' );
31+
```
32+
33+
#### dlascl( order, type, KL, KU, CFROM, CTO, M, N, A, LDA )
34+
35+
Multiplies a real M by N matrix `A` by a real scalar `CTO/CFROM`.
36+
37+
```javascript
38+
var Float64Array = require( '@stdlib/array/float64' );
39+
40+
var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
41+
42+
dlascl( 'row-major', 'general', 0, 0, 1.0, 2.0, 3, 2, A, 2 );
43+
// A => <Float64Array>[ 2.0, 4.0, 6.0, 8.0, 10.0, 12.0 ]
44+
```
45+
46+
The function has the following parameters:
47+
48+
- **order**: storage layout.
49+
- **type**: specifies the type of matrix `A` ( should be one of these: `general`, `upper`, `lower`, `upper-hessenberg`, `symmetric-banded-lower`, `symmetric-banded-upper` or `banded` ).
50+
- **KL**: lower band width of `A`. Referenced only if type is `symmetric-banded-lower` or `banded`.
51+
- **KU**: upper band width of `A`. Referenced only if type is `symmetric-banded-upper` or `banded`.
52+
- **CFROM**: the matrix `A` is multiplied by `CTO / CFROM`.
53+
- **CTO**: the matrix `A` is multiplied by `CTO / CFROM`.
54+
- **M**: number of rows in matrix `A`.
55+
- **N**: number of columns in matrix `A`.
56+
- **A**: input [`Float64Array`][mdn-float64array].
57+
- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
58+
59+
If `type` is `banded`, `symmetric-banded-lower` or `symmetric-banded-upper` the matrix should be stored in the [`Band storage`][lapack-band-storage] format.
60+
61+
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
62+
63+
<!-- eslint-disable stdlib/capitalized-comments -->
64+
65+
```javascript
66+
var Float64Array = require( '@stdlib/array/float64' );
67+
68+
// Initial arrays...
69+
var A0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
70+
71+
// Create offset views...
72+
var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
73+
74+
dlascl( 'row-major', 'general', 0, 0, 1.0, 2.0, 3, 2, A1, 2 );
75+
// A0 => <Float64Array>[ 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0 ]
76+
```
77+
78+
#### dlascl.ndarray( type, KL, KU, CFROM, CTO, M, N, A, strideA1, strideA2, offsetA )
79+
80+
Multiplies a real M by N matrix `A` by a real scalar `CTO/CFROM` using alternative indexing semantics.
81+
82+
```javascript
83+
var Float64Array = require( '@stdlib/array/float64' );
84+
85+
var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
86+
87+
dlascl.ndarray( 'general', 0, 0, 1.0, 2.0, 3, 2, A, 2, 1, 0 );
88+
// A => <Float64Array>[ 2.0, 4.0, 6.0, 8.0, 10.0, 12.0 ]
89+
```
90+
91+
The function has the following additional parameters:
92+
93+
- **type**: specifies the type of matrix `A` ( should be one of these: `general`, `upper`, `lower`, `upper-hessenberg`, `symmetric-banded-lower`, `symmetric-banded-upper` or `banded` ).
94+
- **KL**: lower band width of `A`. Referenced only if type is `symmetric-banded-lower` or `banded`.
95+
- **KU**: upper band width of `A`. Referenced only if type is `symmetric-banded-upper` or `banded`.
96+
- **CFROM**: the matrix `A` is multiplied by `CTO / CFROM`.
97+
- **CTO**: the matrix `A` is multiplied by `CTO / CFROM`.
98+
- **M**: number of rows in matrix `A`.
99+
- **N**: number of columns in matrix `A`.
100+
- **A**: input [`Float64Array`][mdn-float64array].
101+
- **strideA1**: stride of the first dimension of `A`.
102+
- **strideA2**: stride of the second dimension of `A`.
103+
- **offsetA**: starting index for `A`.
104+
105+
If `type` is `banded`, `symmetric-banded-lower` or `symmetric-banded-upper` the matrix should be stored in the [`Band storage`][lapack-band-storage] format.
106+
107+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example,
108+
109+
```javascript
110+
var Float64Array = require( '@stdlib/array/float64' );
111+
112+
var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
113+
114+
dlascl.ndarray( 'general', 0, 0, 1.0, 2.0, 3, 2, A, 2, 1, 1 );
115+
// A => <Float64Array>[ 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0 ]
116+
```
117+
118+
</section>
119+
120+
<!-- /.usage -->
121+
122+
<section class="notes">
123+
124+
## Notes
125+
126+
- `dlascl()` corresponds to the [LAPACK][lapack] routine [`dlascl`][lapack-dlascl].
127+
- If `type` is `banded`, `symmetric-banded-lower` or `symmetric-banded-upper` the matrix should be stored in the [`Band storage`][lapack-band-storage] format.
128+
129+
</section>
130+
131+
<!-- /.notes -->
132+
133+
<section class="examples">
134+
135+
## Examples
136+
137+
<!-- eslint no-undef: "error" -->
138+
139+
```javascript
140+
var Float64Array = require( '@stdlib/array/float64' );
141+
var dlascl = require( '@stdlib/lapack/base/dlascl' );
142+
143+
// Define a matrix A (3x2 in row-major order):
144+
var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
145+
console.log( 'Initial A (row-major): ', A );
146+
147+
dlascl( 'row-major', 'general', 0, 0, 1.0, 2.0, 3, 2, A, 2 );
148+
console.log( 'Scaled A (row-major): ', A );
149+
```
150+
151+
</section>
152+
153+
<!-- /.examples -->
154+
155+
<!-- C interface documentation. -->
156+
157+
* * *
158+
159+
<section class="c">
160+
161+
## C APIs
162+
163+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
164+
165+
<section class="intro">
166+
167+
</section>
168+
169+
<!-- /.intro -->
170+
171+
<!-- C usage documentation. -->
172+
173+
<section class="usage">
174+
175+
### Usage
176+
177+
```c
178+
TODO
179+
```
180+
181+
#### TODO
182+
183+
TODO.
184+
185+
```c
186+
TODO
187+
```
188+
189+
TODO
190+
191+
```c
192+
TODO
193+
```
194+
195+
</section>
196+
197+
<!-- /.usage -->
198+
199+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
200+
201+
<section class="notes">
202+
203+
</section>
204+
205+
<!-- /.notes -->
206+
207+
<!-- C API usage examples. -->
208+
209+
<section class="examples">
210+
211+
### Examples
212+
213+
```c
214+
TODO
215+
```
216+
217+
</section>
218+
219+
<!-- /.examples -->
220+
221+
</section>
222+
223+
<!-- /.c -->
224+
225+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
226+
227+
<section class="related">
228+
229+
</section>
230+
231+
<!-- /.related -->
232+
233+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
234+
235+
<section class="links">
236+
237+
[lapack]: https://www.netlib.org/lapack/explore-html/
238+
239+
[lapack-dlascl]: https://www.netlib.org/lapack/explore-html-3.6.1/d7/d43/group__aux_o_t_h_e_rauxiliary_ga7bce4c35ec5a86ee0bfdd15c476d99c8.html
240+
241+
[lapack-band-storage]: https://www.netlib.org/lapack/lug/node124.html
242+
243+
[mdn-float64array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array
244+
245+
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
246+
247+
</section>
248+
249+
<!-- /.links -->

lib/node_modules/@stdlib/lapack/base/dlascl/docs/types/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ interface Routine {
3333
* @param type - specifies the type of matrix `A`
3434
* @param KL - lower band width of `A`. Referenced only if type is `symmetric-banded-lower` or `banded`.
3535
* @param KU - upper band width of `A`. Referenced only if type is `symmetric-banded-upper` or `banded`.
36-
* @param CFROM - the matrix `A` are multiplied by `CTO / CFROM`
37-
* @param CTO - the matrix `A` are multiplied by `CTO / CFROM`
36+
* @param CFROM - the matrix `A` is multiplied by `CTO / CFROM`
37+
* @param CTO - the matrix `A` is multiplied by `CTO / CFROM`
3838
* @param M - number of rows in matrix `A`
3939
* @param N - number of columns in matrix `A`
4040
* @param A - input matrix
@@ -57,8 +57,8 @@ interface Routine {
5757
* @param type - specifies the type of matrix `A`
5858
* @param KL - lower band width of `A`. Referenced only if type is `symmetric-banded-lower` or `banded`.
5959
* @param KU - upper band width of `A`. Referenced only if type is `symmetric-banded-upper` or `banded`.
60-
* @param CFROM - the matrix `A` are multiplied by `CTO / CFROM`
61-
* @param CTO - the matrix `A` are multiplied by `CTO / CFROM`
60+
* @param CFROM - the matrix `A` is multiplied by `CTO / CFROM`
61+
* @param CTO - the matrix `A` is multiplied by `CTO / CFROM`
6262
* @param M - number of rows in matrix `A`
6363
* @param N - number of columns in matrix `A`
6464
* @param A - input matrix
@@ -85,8 +85,8 @@ interface Routine {
8585
* @param type - specifies the type of matrix `A`
8686
* @param KL - lower band width of `A`. Referenced only if type is `symmetric-banded-lower` or `banded`.
8787
* @param KU - upper band width of `A`. Referenced only if type is `symmetric-banded-upper` or `banded`.
88-
* @param CFROM - the matrix `A` are multiplied by `CTO / CFROM`
89-
* @param CTO - the matrix `A` are multiplied by `CTO / CFROM`
88+
* @param CFROM - the matrix `A` is multiplied by `CTO / CFROM`
89+
* @param CTO - the matrix `A` is multiplied by `CTO / CFROM`
9090
* @param M - number of rows in matrix `A`
9191
* @param N - number of columns in matrix `A`
9292
* @param A - input matrix

lib/node_modules/@stdlib/lapack/base/dlascl/lib/base.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ var bignum = 1.0 / smlnum;
4545
* @param {string} type - specifies the type of matrix `A`
4646
* @param {NonNegativeInteger} KL - lower band width of `A`. Referenced only if type is `symmetric-banded-lower` or `banded`.
4747
* @param {NonNegativeInteger} KU - upper band width of `A`. Referenced only if type is `symmetric-banded-upper` or `banded`.
48-
* @param {number} CFROM - the matrix `A` are multiplied by `CTO / CFROM`
49-
* @param {number} CTO - the matrix `A` are multiplied by `CTO / CFROM`
48+
* @param {number} CFROM - the matrix `A` is multiplied by `CTO / CFROM`
49+
* @param {number} CTO - the matrix `A` is multiplied by `CTO / CFROM`
5050
* @param {NonNegativeInteger} M - number of rows in matrix `A`
5151
* @param {NonNegativeInteger} N - number of columns in matrix `A`
5252
* @param {Float64Array} A - input matrix

lib/node_modules/@stdlib/lapack/base/dlascl/lib/dlascl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ var base = require( './base.js' );
3737
* @param {string} type - specifies the type of matrix `A`
3838
* @param {NonNegativeInteger} KL - lower band width of `A`. Referenced only if type is `symmetric-banded-lower` or `banded`.
3939
* @param {NonNegativeInteger} KU - upper band width of `A`. Referenced only if type is `symmetric-banded-upper` or `banded`.
40-
* @param {number} CFROM - the matrix `A` are multiplied by `CTO / CFROM`
41-
* @param {number} CTO - the matrix `A` are multiplied by `CTO / CFROM`
40+
* @param {number} CFROM - the matrix `A` is multiplied by `CTO / CFROM`
41+
* @param {number} CTO - the matrix `A` is multiplied by `CTO / CFROM`
4242
* @param {NonNegativeInteger} M - number of rows in matrix `A`
4343
* @param {NonNegativeInteger} N - number of columns in matrix `A`
4444
* @param {Float64Array} A - input matrix

lib/node_modules/@stdlib/lapack/base/dlascl/lib/ndarray.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ var base = require( './base.js' );
3232
* @param {string} type - specifies the type of matrix `A`
3333
* @param {NonNegativeInteger} KL - lower band width of `A`. Referenced only if type is `symmetric-banded-lower` or `banded`.
3434
* @param {NonNegativeInteger} KU - upper band width of `A`. Referenced only if type is `symmetric-banded-upper` or `banded`.
35-
* @param {number} CFROM - the matrix `A` are multiplied by `CTO / CFROM`
36-
* @param {number} CTO - the matrix `A` are multiplied by `CTO / CFROM`
35+
* @param {number} CFROM - the matrix `A` is multiplied by `CTO / CFROM`
36+
* @param {number} CTO - the matrix `A` is multiplied by `CTO / CFROM`
3737
* @param {NonNegativeInteger} M - number of rows in matrix `A`
3838
* @param {NonNegativeInteger} N - number of columns in matrix `A`
3939
* @param {Float64Array} A - input matrix

0 commit comments

Comments
 (0)