Skip to content

Commit b68a188

Browse files
committed
feat: add support for specifying integer size
1 parent 34a206e commit b68a188

File tree

7 files changed

+167
-21
lines changed

7 files changed

+167
-21
lines changed

lib/node_modules/@stdlib/blas/base/drot/README.md

+107
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,113 @@ console.log( y );
179179

180180
<!-- /.examples -->
181181

182+
<!-- C interface documentation. -->
183+
184+
* * *
185+
186+
<section class="c">
187+
188+
## C APIs
189+
190+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
191+
192+
<section class="intro">
193+
194+
</section>
195+
196+
<!-- /.intro -->
197+
198+
<!-- C usage documentation. -->
199+
200+
<section class="usage">
201+
202+
### Usage
203+
204+
```c
205+
#include "stdlib/blas/base/drot.h"
206+
```
207+
208+
#### c_drot( N, X, strideX, Y, strideY, c, s )
209+
210+
Applies a plane rotation.
211+
212+
```c
213+
double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0 };
214+
double y[] = { 6.0, 7.0, 8.0, 9.0, 10.0 };
215+
216+
c_drot( 5, x, 1, y, 1, 0.8, 0.6 );
217+
```
218+
219+
The function accepts the following arguments:
220+
221+
- **N**: `[in] CBLAS_INT` number of indexed elements.
222+
- **X**: `[inout] double*` first input array.
223+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
224+
- **Y**: `[inout] double*` first input array.
225+
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
226+
- **c**: `[in] double` cosine of the angle of rotation.
227+
- **s**: `[in] double` sine of the angle of rotation.
228+
229+
```c
230+
void c_drot( const CBLAS_INT N, double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY, const double c, const double s );
231+
```
232+
233+
</section>
234+
235+
<!-- /.usage -->
236+
237+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
238+
239+
<section class="notes">
240+
241+
</section>
242+
243+
<!-- /.notes -->
244+
245+
<!-- C API usage examples. -->
246+
247+
<section class="examples">
248+
249+
### Examples
250+
251+
```c
252+
#include "stdlib/blas/base/drot.h"
253+
#include <stdio.h>
254+
255+
int main( void ) {
256+
// Create strided arrays:
257+
double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0 };
258+
double y[] = { 6.0, 7.0, 8.0, 9.0, 10.0 };
259+
260+
// Specify the number of elements:
261+
const int N = 5;
262+
263+
// Specify stride lengths:
264+
const int strideX = 1;
265+
const int strideY = 1;
266+
267+
// Specify angle of rotation:
268+
const double c = 0.8;
269+
const double s = 0.6;
270+
271+
// Apply plane rotation:
272+
c_drot( N, x, strideX, y, strideY, c, s );
273+
274+
// Print the result:
275+
for ( int i = 0; i < 5; i++ ) {
276+
printf( "x[ %i ] = %lf, y[ %i ] = %lf\n", i, x[ i ], i, y[ i ] );
277+
}
278+
}
279+
```
280+
281+
</section>
282+
283+
<!-- /.examples -->
284+
285+
</section>
286+
287+
<!-- /.c -->
288+
182289
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
183290
184291
<section class="related">

lib/node_modules/@stdlib/blas/base/drot/include/stdlib/blas/base/drot.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#ifndef DROT_H
2323
#define DROT_H
2424

25+
#include "stdlib/blas/base/shared.h"
26+
2527
/*
2628
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
2729
*/
@@ -32,7 +34,7 @@ extern "C" {
3234
/**
3335
* Applies a plane rotation.
3436
*/
35-
void c_drot( const int N, double *X, const int strideX, double *Y, const int strideY, const double c, const double s );
37+
void c_drot( const CBLAS_INT N, double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY, const double c, const double s );
3638

3739
#ifdef __cplusplus
3840
}

lib/node_modules/@stdlib/blas/base/drot/include/stdlib/blas/base/drot_cblas.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#ifndef DROT_CBLAS_H
2323
#define DROT_CBLAS_H
2424

25+
#include "stdlib/blas/base/shared.h"
26+
2527
/*
2628
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
2729
*/
@@ -32,7 +34,7 @@ extern "C" {
3234
/**
3335
* Applies a plane rotation.
3436
*/
35-
void cblas_drot( const int N, double *X, const int strideX, double *Y, const int strideY, const double c, const double s );
37+
void cblas_drot( const CBLAS_INT N, double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY, const double c, const double s );
3638

3739
#ifdef __cplusplus
3840
}

lib/node_modules/@stdlib/blas/base/drot/manifest.json

+45-13
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"libraries": [],
4444
"libpath": [],
4545
"dependencies": [
46+
"@stdlib/blas/base/shared",
4647
"@stdlib/napi/export",
4748
"@stdlib/napi/argv",
4849
"@stdlib/napi/argv-int64",
@@ -63,7 +64,9 @@
6364
],
6465
"libraries": [],
6566
"libpath": [],
66-
"dependencies": []
67+
"dependencies": [
68+
"@stdlib/blas/base/shared"
69+
]
6770
},
6871
{
6972
"task": "examples",
@@ -78,7 +81,9 @@
7881
],
7982
"libraries": [],
8083
"libpath": [],
81-
"dependencies": []
84+
"dependencies": [
85+
"@stdlib/blas/base/shared"
86+
]
8287
},
8388

8489
{
@@ -98,6 +103,7 @@
98103
],
99104
"libpath": [],
100105
"dependencies": [
106+
"@stdlib/blas/base/shared",
101107
"@stdlib/napi/export",
102108
"@stdlib/napi/argv",
103109
"@stdlib/napi/argv-int64",
@@ -121,7 +127,9 @@
121127
"-lpthread"
122128
],
123129
"libpath": [],
124-
"dependencies": []
130+
"dependencies": [
131+
"@stdlib/blas/base/shared"
132+
]
125133
},
126134
{
127135
"task": "examples",
@@ -139,7 +147,9 @@
139147
"-lpthread"
140148
],
141149
"libpath": [],
142-
"dependencies": []
150+
"dependencies": [
151+
"@stdlib/blas/base/shared"
152+
]
143153
},
144154

145155
{
@@ -157,6 +167,7 @@
157167
"libraries": [],
158168
"libpath": [],
159169
"dependencies": [
170+
"@stdlib/blas/base/shared",
160171
"@stdlib/napi/export",
161172
"@stdlib/napi/argv",
162173
"@stdlib/napi/argv-int64",
@@ -177,7 +188,9 @@
177188
],
178189
"libraries": [],
179190
"libpath": [],
180-
"dependencies": []
191+
"dependencies": [
192+
"@stdlib/blas/base/shared"
193+
]
181194
},
182195
{
183196
"task": "examples",
@@ -192,7 +205,9 @@
192205
],
193206
"libraries": [],
194207
"libpath": [],
195-
"dependencies": []
208+
"dependencies": [
209+
"@stdlib/blas/base/shared"
210+
]
196211
},
197212

198213
{
@@ -211,6 +226,7 @@
211226
],
212227
"libpath": [],
213228
"dependencies": [
229+
"@stdlib/blas/base/shared",
214230
"@stdlib/napi/export",
215231
"@stdlib/napi/argv",
216232
"@stdlib/napi/argv-int64",
@@ -233,7 +249,9 @@
233249
"-lblas"
234250
],
235251
"libpath": [],
236-
"dependencies": []
252+
"dependencies": [
253+
"@stdlib/blas/base/shared"
254+
]
237255
},
238256
{
239257
"task": "examples",
@@ -250,7 +268,9 @@
250268
"-lblas"
251269
],
252270
"libpath": [],
253-
"dependencies": []
271+
"dependencies": [
272+
"@stdlib/blas/base/shared"
273+
]
254274
},
255275

256276
{
@@ -270,6 +290,7 @@
270290
],
271291
"libpath": [],
272292
"dependencies": [
293+
"@stdlib/blas/base/shared",
273294
"@stdlib/napi/export",
274295
"@stdlib/napi/argv",
275296
"@stdlib/napi/argv-int64",
@@ -293,7 +314,9 @@
293314
"-lpthread"
294315
],
295316
"libpath": [],
296-
"dependencies": []
317+
"dependencies": [
318+
"@stdlib/blas/base/shared"
319+
]
297320
},
298321
{
299322
"task": "examples",
@@ -311,7 +334,9 @@
311334
"-lpthread"
312335
],
313336
"libpath": [],
314-
"dependencies": []
337+
"dependencies": [
338+
"@stdlib/blas/base/shared"
339+
]
315340
},
316341

317342
{
@@ -328,6 +353,7 @@
328353
"libraries": [],
329354
"libpath": [],
330355
"dependencies": [
356+
"@stdlib/blas/base/shared",
331357
"@stdlib/napi/export",
332358
"@stdlib/napi/argv",
333359
"@stdlib/napi/argv-int64",
@@ -348,7 +374,9 @@
348374
],
349375
"libraries": [],
350376
"libpath": [],
351-
"dependencies": []
377+
"dependencies": [
378+
"@stdlib/blas/base/shared"
379+
]
352380
},
353381
{
354382
"task": "examples",
@@ -363,7 +391,9 @@
363391
],
364392
"libraries": [],
365393
"libpath": [],
366-
"dependencies": []
394+
"dependencies": [
395+
"@stdlib/blas/base/shared"
396+
]
367397
},
368398

369399
{
@@ -379,7 +409,9 @@
379409
],
380410
"libraries": [],
381411
"libpath": [],
382-
"dependencies": []
412+
"dependencies": [
413+
"@stdlib/blas/base/shared"
414+
]
383415
}
384416
]
385417
}

lib/node_modules/@stdlib/blas/base/drot/src/drot.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
#include "stdlib/blas/base/drot.h"
20+
#include "stdlib/blas/base/shared.h"
2021

2122
/**
2223
* Applies a plane rotation.
@@ -29,11 +30,11 @@
2930
* @param c cosine of the angle of rotation
3031
* @param s sine of the angle of rotation
3132
*/
32-
void c_drot( const int N, double *X, const int strideX, double *Y, const int strideY, const double c, const double s ) {
33+
void c_drot( const CBLAS_INT N, double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY, const double c, const double s ) {
3334
double tmp;
34-
int ix;
35-
int iy;
36-
int i;
35+
CBLAS_INT ix;
36+
CBLAS_INT iy;
37+
CBLAS_INT i;
3738

3839
if ( N <= 0 ) {
3940
return;

lib/node_modules/@stdlib/blas/base/drot/src/drot_cblas.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "stdlib/blas/base/drot.h"
2020
#include "stdlib/blas/base/drot_cblas.h"
21+
#include "stdlib/blas/base/shared.h"
2122

2223
/**
2324
* Applies a plane rotation.
@@ -30,6 +31,6 @@
3031
* @param c cosine of the angle of rotation
3132
* @param s sine of the angle of rotation
3233
*/
33-
void c_drot( const int N, double *X, const int strideX, double *Y, const int strideY, const double c, const double s ) {
34+
void c_drot( const CBLAS_INT N, double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY, const double c, const double s ) {
3435
cblas_drot( N, X, strideX, Y, strideY, c, s );
3536
}

lib/node_modules/@stdlib/blas/base/drot/src/drot_f.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "stdlib/blas/base/drot.h"
2020
#include "stdlib/blas/base/drot_fortran.h"
21+
#include "stdlib/blas/base/shared.h"
2122

2223
/**
2324
* Applies a plane rotation.
@@ -30,6 +31,6 @@
3031
* @param c cosine of the angle of rotation
3132
* @param s sine of the angle of rotation
3233
*/
33-
void c_drot( const int N, double *X, const int strideX, double *Y, const int strideY, const double c, const double s ) {
34+
void c_drot( const CBLAS_INT N, double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY, const double c, const double s ) {
3435
drot( &N, X, &strideX, Y, &strideY, &c, &s );
3536
}

0 commit comments

Comments
 (0)