Skip to content

Commit 25ef497

Browse files
committed
feat: add lapack/base/shared
--- 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: passed - 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 3192ef5 commit 25ef497

File tree

15 files changed

+723
-0
lines changed

15 files changed

+723
-0
lines changed
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
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+
# shared
22+
23+
> Common symbols and type definitions shared across base LAPACK APIs.
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 headerDir = require( '@stdlib/lapack/base/shared' );
41+
```
42+
43+
#### headerDir
44+
45+
Absolute file path for the directory containing header files for C APIs.
46+
47+
```javascript
48+
var dir = headerDir;
49+
// returns <string>
50+
```
51+
52+
</section>
53+
54+
<!-- /.usage -->
55+
56+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
57+
58+
<section class="notes">
59+
60+
</section>
61+
62+
<!-- /.notes -->
63+
64+
<!-- Package usage examples. -->
65+
66+
<section class="examples">
67+
68+
## Examples
69+
70+
```javascript
71+
var headerDir = require( '@stdlib/lapack/base/shared' );
72+
73+
console.log( headerDir );
74+
// => <string>
75+
```
76+
77+
</section>
78+
79+
<!-- /.examples -->
80+
81+
<!-- C interface documentation. -->
82+
83+
* * *
84+
85+
<section class="c">
86+
87+
## C APIs
88+
89+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
90+
91+
<section class="intro">
92+
93+
</section>
94+
95+
<!-- /.intro -->
96+
97+
<!-- C usage documentation. -->
98+
99+
<section class="usage">
100+
101+
### Usage
102+
103+
```c
104+
#include "stdlib/lapack/base/shared.h"
105+
```
106+
107+
#### TODO
108+
109+
TODO
110+
111+
</section>
112+
113+
<!-- /.usage -->
114+
115+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
116+
117+
<section class="notes">
118+
119+
</section>
120+
121+
<!-- /.notes -->
122+
123+
<!-- C API usage examples. -->
124+
125+
<section class="examples">
126+
127+
</section>
128+
129+
<!-- /.examples -->
130+
131+
</section>
132+
133+
<!-- /.c -->
134+
135+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
136+
137+
<section class="references">
138+
139+
</section>
140+
141+
<!-- /.references -->
142+
143+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
144+
145+
<section class="related">
146+
147+
</section>
148+
149+
<!-- /.related -->
150+
151+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
152+
153+
<section class="links">
154+
155+
</section>
156+
157+
<!-- /.links -->
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
/**
22+
* Absolute file path for the directory containing header files for C APIs.
23+
*
24+
* @example
25+
* var dir = headerDir;
26+
* // returns <string>
27+
*/
28+
declare const headerDir: string;
29+
30+
31+
// EXPORTS //
32+
33+
export = headerDir;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
import headerDir = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The variable is a string...
25+
{
26+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
27+
headerDir; // $ExpectType string
28+
}
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 headerDir = require( './../lib' );
22+
23+
console.log( headerDir );
24+
// => <string>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
#ifndef STDLIB_LAPACK_BASE_SHARED_H
20+
#define STDLIB_LAPACK_BASE_SHARED_H
21+
22+
#include "shared/lapacke.h"
23+
#include "shared/macros.h"
24+
25+
#endif // !STDLIB_LAPACK_BASE_SHARED_H
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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+
#ifndef STDLIB_LAPACK_BASE_SHARED_LAPACKE_H
20+
#define STDLIB_LAPACK_BASE_SHARED_LAPACKE_H
21+
22+
#include "stdlib/blas/base/shared.h"
23+
#include <stddef.h>
24+
#include <stdint.h>
25+
#include <inttypes.h>
26+
27+
/*
28+
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
29+
*/
30+
#ifdef __cplusplus
31+
extern "C" {
32+
#endif
33+
34+
// Integer type:
35+
#ifndef LAPACK_INT
36+
#ifdef LAPACK_ILP64
37+
#define LAPACK_INT int64_t
38+
#else
39+
#define LAPACK_INT int32_t
40+
#endif
41+
#endif
42+
43+
// Integer format string:
44+
#ifndef LAPACK_IFMT
45+
#ifdef LAPACK_ILP64
46+
#define LAPACK_IFMT PRId64
47+
#else
48+
#define LAPACK_IFMT PRId32
49+
#endif
50+
#endif
51+
52+
// Array storage layout:
53+
#ifndef LAPACK_LAYOUT
54+
typedef enum LAPACK_LAYOUT {
55+
// Row-major order (C-style):
56+
LAPACK_ROW_MAJOR = CblasRowMajor,
57+
58+
// Column-major order (Fortran-style):
59+
LAPACK_COL_MAJOR = CblasColMajor,
60+
} LAPACK_LAYOUT;
61+
#endif
62+
63+
// Transpose operation:
64+
#ifndef LAPACK_TRANSPOSE
65+
typedef enum LAPACK_TRANSPOSE {
66+
// No transposition:
67+
LAPACK_NO_TRANSPOSE = CblasNoTrans,
68+
69+
// Transposition:
70+
LAPACK_TRANSPOSE = CblasTrans,
71+
72+
// Conjugate transposition:
73+
LAPACK_CONJUGATE_TRANSPOSE = CblasConjTrans,
74+
} LAPACK_TRANSPOSE;
75+
#endif
76+
77+
// Upper/lower triangular part:
78+
#ifndef LAPACK_UPLO
79+
typedef enum LAPACK_UPLO {
80+
// Upper triangular part:
81+
LAPACK_UPPER_TRIANGLE = CblasUpper,
82+
83+
// Lower triangular part:
84+
LAPACK_LOWER_TRIANGLE = CblasLower,
85+
} LAPACK_UPLO;
86+
#endif
87+
88+
// Diagonal elements:
89+
#ifndef LAPACK_DIAGONAL
90+
typedef enum LAPACK_DIAGONAL {
91+
// Non-unit diagonal elements:
92+
LAPACK_NON_UNIT_DIAGONAL = CblasNonUnit,
93+
94+
// Unit diagonal elements:
95+
LAPACK_UNIT_DIAGONAL = CblasUnit,
96+
} LAPACK_DIAGONAL;
97+
#endif
98+
99+
// Operation side:
100+
#ifndef LAPACK_SIDE
101+
typedef enum LAPACK_SIDE {
102+
// Triangular matrix is on the left side of a matrix-matrix operation (e.g., AX = B, where A is a triangular matrix):
103+
LAPACK_LEFT = CblasLeft,
104+
105+
// Triangular matrix is on the right side of a matrix-matrix operation (e.g., XA = B, where A is a triangular matrix):
106+
LAPACK_RIGHT = CblasRight,
107+
} LAPACK_SIDE;
108+
#endif
109+
110+
#ifdef __cplusplus
111+
}
112+
#endif
113+
114+
#endif // !STDLIB_LAPACK_BASE_SHARED_LAPACKE_H

0 commit comments

Comments
 (0)