Skip to content

Commit 3422a64

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: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 08aa12a commit 3422a64

File tree

1 file changed

+258
-0
lines changed
  • lib/node_modules/@stdlib/lapack/base/iladlc

1 file changed

+258
-0
lines changed
Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
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+
# iladlc
22+
23+
> Find the index of the last non zero column in a matrix `A`
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var iladlc = require( '@stdlib/lapack/base/iladlc' );
31+
```
32+
33+
#### iladlc( order, M, N, A, LDA )
34+
35+
Finds the index of the last non zero column in a matrix `A`.
36+
37+
```javascript
38+
var Float64Array = require( '@stdlib/array/float64' );
39+
40+
var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] );
41+
42+
/*
43+
A = [
44+
[ 1.0, 2.0, 0.0 ],
45+
[ 3.0, 4.0, 0.0 ]
46+
]
47+
*/
48+
49+
var out = iladlc( 'row-major', 2, 3, A, 3 );
50+
// returns 1
51+
```
52+
53+
The function has the following parameters:
54+
55+
- **order**: storage layout.
56+
- **M**: number of rows in `A`.
57+
- **N**: number of columns in `A`.
58+
- **A**: input [`Float64Array`][mdn-float64array].
59+
- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
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( [ 9999.0, 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] );
70+
71+
// Create offset views...
72+
var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
73+
74+
var out = iladlc( 'row-major', 2, 3, A1, 3 );
75+
// returns 1
76+
```
77+
78+
#### iladlc.ndarray( uplo, M, N, A, sa1, sa2, oa, B, sb1, sb2, ob )
79+
80+
Finds the index of the last non zero column in a matrix `A` using alternative indexing semantics.
81+
82+
```javascript
83+
var Float64Array = require( '@stdlib/array/float64' );
84+
85+
var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] );
86+
87+
/*
88+
A = [
89+
[ 1.0, 2.0, 0.0 ],
90+
[ 3.0, 4.0, 0.0 ]
91+
]
92+
*/
93+
94+
var out = iladlc.ndarray( 2, 3, A, 3, 1, 0 );
95+
// returns 1
96+
```
97+
98+
The function has the following parameters:
99+
100+
- **M**: number of rows in `A`.
101+
- **N**: number of columns in `A`.
102+
- **A**: input [`Float64Array`][mdn-float64array].
103+
- **sa1**: stride of the first dimension of `A`.
104+
- **sa2**: stride of the second dimension of `A`.
105+
- **oa**: starting index for `A`.
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( [ 9999.0, 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] );
113+
114+
/*
115+
A = [
116+
[ 1.0, 2.0, 0.0 ],
117+
[ 3.0, 4.0, 0.0 ]
118+
]
119+
*/
120+
121+
var out = iladlc.ndarray( 2, 3, A, 3, 1, 1 );
122+
// returns 1
123+
```
124+
125+
</section>
126+
127+
<!-- /.usage -->
128+
129+
<section class="notes">
130+
131+
## Notes
132+
133+
- `iladlc()` corresponds to the [LAPACK][lapack] routine [`iladlc`][lapack-iladlc].
134+
135+
</section>
136+
137+
<!-- /.notes -->
138+
139+
<section class="examples">
140+
141+
## Examples
142+
143+
<!-- eslint no-undef: "error" -->
144+
145+
```javascript
146+
var ndarray2array = require( '@stdlib/ndarray/base/to-array' );
147+
var Float64Array = require( '@stdlib/array/float64' );
148+
var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
149+
var iladlc = require( '@stdlib/lapack/base/iladlc' );
150+
151+
var shape = [ 3, 3 ];
152+
var order = 'row-major';
153+
var strides = shape2strides( shape, order );
154+
155+
var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0, 5.0, 6.0, 0.0 ] );
156+
console.log( ndarray2array( A, shape, strides, 0, order ) );
157+
158+
var out = iladlc( order, shape[ 0 ], shape[ 1 ], A, strides[ 0 ] );
159+
console.log( out );
160+
```
161+
162+
</section>
163+
164+
<!-- /.examples -->
165+
166+
<!-- C interface documentation. -->
167+
168+
* * *
169+
170+
<section class="c">
171+
172+
## C APIs
173+
174+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
175+
176+
<section class="intro">
177+
178+
</section>
179+
180+
<!-- /.intro -->
181+
182+
<!-- C usage documentation. -->
183+
184+
<section class="usage">
185+
186+
### Usage
187+
188+
```c
189+
TODO
190+
```
191+
192+
#### TODO
193+
194+
TODO.
195+
196+
```c
197+
TODO
198+
```
199+
200+
TODO
201+
202+
```c
203+
TODO
204+
```
205+
206+
</section>
207+
208+
<!-- /.usage -->
209+
210+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
211+
212+
<section class="notes">
213+
214+
</section>
215+
216+
<!-- /.notes -->
217+
218+
<!-- C API usage examples. -->
219+
220+
<section class="examples">
221+
222+
### Examples
223+
224+
```c
225+
TODO
226+
```
227+
228+
</section>
229+
230+
<!-- /.examples -->
231+
232+
</section>
233+
234+
<!-- /.c -->
235+
236+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
237+
238+
<section class="related">
239+
240+
</section>
241+
242+
<!-- /.related -->
243+
244+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
245+
246+
<section class="links">
247+
248+
[lapack]: https://www.netlib.org/lapack/explore-html/
249+
250+
[lapack-iladlc]: https://www.netlib.org/lapack/explore-html-3.6.1/d7/d43/group__aux_o_t_h_e_rauxiliary_gab8b3783390380038c9d26de61d7aefb4.html
251+
252+
[mdn-float64array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array
253+
254+
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
255+
256+
</section>
257+
258+
<!-- /.links -->

0 commit comments

Comments
 (0)