Skip to content

Commit 104d60e

Browse files
committed
feat: add main exports
--- 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: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 249cf71 commit 104d60e

File tree

4 files changed

+233
-0
lines changed

4 files changed

+233
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
// MODULES //
22+
23+
var base = require( './base.js' );
24+
25+
26+
// MAIN //
27+
28+
/**
29+
* Generates a plane rotation of a vector such that the following equation is satisfied.
30+
*
31+
* ```tex
32+
* \(\begin{bmatrix} C & S \\ -S & C \end{bmatrix} \begin{bmatrix} F \\ G \end{bmatrix} = \begin{bmatrix} R \\ 0 \end{bmatrix}\)
33+
* ```
34+
*
35+
* @param {Float64Array} F - single element array representing the first component of the vector to be rotated
36+
* @param {Float64Array} G - single element array representing the second component of the vector to be rotated
37+
* @param {Float64Array} CS - single element array overwritten by the cosine of the rotation
38+
* @param {Float64Array} SN - single element array overwritten by the sine of the rotation
39+
* @param {Float64Array} R - single element array overwritten by the non-zero component of the rotated vector
40+
* @returns {void}
41+
*
42+
* @example
43+
* var Float64Array = require( '@stdlib/array/float64' );
44+
*
45+
* var F = new Float64Array( [ 3.0 ] );
46+
* var G = new Float64Array( [ 4.0 ] );
47+
* var CS = new Float64Array( 1 );
48+
* var SN = new Float64Array( 1 );
49+
* var R = new Float64Array( 1 );
50+
*
51+
* dlartg( F, G, CS, SN, R );
52+
* // R => <Float64Array>[ 5.0 ]
53+
* // CS => <Float64Array>[ 0.6 ]
54+
* // SN => <Float64Array>[ 0.8 ]
55+
*/
56+
function dlartg( F, G, CS, SN, R ) {
57+
base( F, 0, G, 0, CS, 0, SN, 0, R, 0 );
58+
}
59+
60+
61+
// EXPORTS //
62+
63+
module.exports = dlartg;
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
* LAPACK routine to generate a plane rotation of a vector such that the following equation is satisfied.
23+
*
24+
* ```tex
25+
* \(\begin{bmatrix} C & S \\ -S & C \end{bmatrix} \begin{bmatrix} F \\ G \end{bmatrix} = \begin{bmatrix} R \\ 0 \end{bmatrix}\)
26+
* ```
27+
*
28+
* @module @stdlib/lapack/base/dlartg
29+
*
30+
* @example
31+
* var Float64Array = require( '@stdlib/array/float64' );
32+
* var dlartg = require( '@stdlib/lapack/base/dlartg' );
33+
*
34+
* var F = new Float64Array( [ 3.0 ] );
35+
* var G = new Float64Array( [ 4.0 ] );
36+
* var CS = new Float64Array( 1 );
37+
* var SN = new Float64Array( 1 );
38+
* var R = new Float64Array( 1 );
39+
*
40+
* dlartg( F, G, CS, SN, R );
41+
* // R => <Float64Array>[ 5.0 ]
42+
* // CS => <Float64Array>[ 0.6 ]
43+
* // SN => <Float64Array>[ 0.8 ]
44+
*/
45+
46+
// MODULES //
47+
48+
var join = require( 'path' ).join;
49+
var tryRequire = require( '@stdlib/utils/try-require' );
50+
var isError = require( '@stdlib/assert/is-error' );
51+
var main = require( './main.js' );
52+
53+
54+
// MAIN //
55+
56+
var dlartg;
57+
var tmp = tryRequire( join( __dirname, './native.js' ) );
58+
if ( isError( tmp ) ) {
59+
dlartg = main;
60+
} else {
61+
dlartg = tmp;
62+
}
63+
64+
65+
// EXPORTS //
66+
67+
module.exports = dlartg;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
// MODULES //
22+
23+
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
24+
var dlartg = require( './dlartg.js' );
25+
var ndarray = require( './ndarray.js' );
26+
27+
28+
// MAIN //
29+
30+
setReadOnly( dlartg, 'ndarray', ndarray );
31+
32+
33+
// EXPORTS //
34+
35+
module.exports = dlartg;
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+
// MODULES //
22+
23+
var base = require( './base.js' );
24+
25+
26+
// MAIN //
27+
28+
/**
29+
* Generates a plane rotation of a vector such that the following equation is satisfied.
30+
*
31+
* ```tex
32+
* \(\begin{bmatrix} C & S \\ -S & C \end{bmatrix} \begin{bmatrix} F \\ G \end{bmatrix} = \begin{bmatrix} R \\ 0 \end{bmatrix}\)
33+
* ```
34+
*
35+
* @param {Float64Array} F - single element array representing the first component of the vector to be rotated
36+
* @param {NonNegativeInteger} offsetF - starting index for `F`
37+
* @param {Float64Array} G - single element array representing the second component of the vector to be rotated
38+
* @param {NonNegativeInteger} offsetG - starting index for `G`
39+
* @param {Float64Array} CS - single element array overwritten by the cosine of the rotation
40+
* @param {NonNegativeInteger} offsetCS - starting index for `CS`
41+
* @param {Float64Array} SN - single element array overwritten by the sine of the rotation
42+
* @param {NonNegativeInteger} offsetSN - starting index for `SN`
43+
* @param {Float64Array} R - single element array overwritten by the non-zero component of the rotated vector
44+
* @param {NonNegativeInteger} offsetR - starting index for `R`
45+
* @returns {void}
46+
*
47+
* @example
48+
* var Float64Array = require( '@stdlib/array/float64' );
49+
*
50+
* var F = new Float64Array( [ 3.0 ] );
51+
* var G = new Float64Array( [ 4.0 ] );
52+
* var CS = new Float64Array( 1 );
53+
* var SN = new Float64Array( 1 );
54+
* var R = new Float64Array( 1 );
55+
*
56+
* dlartg( F, 0, G, 0, CS, 0, SN, 0, R, 0 );
57+
* // R => <Float64Array>[ 5.0 ]
58+
* // CS => <Float64Array>[ 0.6 ]
59+
* // SN => <Float64Array>[ 0.8 ]
60+
*/
61+
function dlartg( F, offsetF, G, offsetG, CS, offsetCS, SN, offsetSN, R, offsetR) { // eslint-disable-line max-len
62+
base( F, offsetF, G, offsetG, CS, offsetCS, SN, offsetSN, R, offsetR );
63+
}
64+
65+
66+
// EXPORTS //
67+
68+
module.exports = dlartg;

0 commit comments

Comments
 (0)