Skip to content

Commit 35566af

Browse files
docs: fix C examples in READMEs
PR-URL: #11229 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent 48446bf commit 35566af

File tree

69 files changed

+103
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+103
-105
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ int main( void ) {
307307

308308
// Print the result:
309309
for ( int i = 0; i < N*N; i++ ) {
310-
printf( "A2[ %i ] = %lf\n", i, A[ i ] );
310+
printf( "A2[ %i ] = %lf\n", i, A2[ i ] );
311311
}
312312
}
313313
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ const float x[] = { 1.0f, -2.0f, 3.0f, -4.0f, 5.0f, -6.0f, 7.0f, -8.0f };
213213
const float y[] = { 1.0f, -2.0f, 3.0f, -4.0f, 5.0f, -6.0f, 7.0f, -8.0f };
214214

215215
float v = c_sdsdot( 5, 0.0f, x, 1, y, -1 );
216-
// returns -120.0f
216+
// returns 35.0f
217217
```
218218
219219
The function accepts the following arguments:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ int main( void ) {
335335
}
336336

337337
// Perform operation using alternative indexing semantics:
338-
c_sger( CblasRowMajor, M, N, 1.0f, x, strideX, 0, y, 0, strideY, A, N, 1, 0 );
338+
c_sger_ndarray( M, N, 1.0f, x, strideX, 0, y, strideY, 0, A, N, 1, 0 );
339339

340340
// Print the result:
341341
for ( int i = 0; i < M; i++ ) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scala
225225
float AP[] = { 1.0f, 2.0f, 3.0f, 1.0f, 2.0f, 1.0f };
226226
const float x[] = { 1.0f, 2.0f, 3.0f };
227227

228-
c_sspr_ndarray( CblasColMajor, CblasUpper, 3, 1.0f, x, 1, AP, 1, 0 );
228+
c_sspr_ndarray( CblasColMajor, CblasUpper, 3, 1.0f, x, 1, 0, AP, 1, 0 );
229229
```
230230
231231
The function accepts the following arguments:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ int main( void ) {
307307

308308
// Print the result:
309309
for ( int i = 0; i < N*N; i++ ) {
310-
printf( "A2[ %i ] = %f\n", i, A[ i ] );
310+
printf( "A2[ %i ] = %f\n", i, A2[ i ] );
311311
}
312312
}
313313
```

lib/node_modules/@stdlib/blas/ext/base/cfill/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Fills a single-precision complex floating-point strided array `X` with a specifi
221221
float x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
222222
const stdlib_complex64_t alpha = stdlib_complex64( 2.0f, 2.0f );
223223

224-
stdlib_strided_cfill_ndarray( 4, alpha, (stdlib_complex64_t *x), 1, 0 );
224+
stdlib_strided_cfill_ndarray( 4, alpha, (stdlib_complex64_t *)x, 1, 0 );
225225
```
226226
227227
The function accepts the following arguments:

lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ console.log( v );
192192
Computes the sum of absolute values ([_L1_ norm][l1norm]) of double-precision floating-point strided array elements using pairwise summation.
193193

194194
```c
195-
const double x[] = { 1.0, 2.0, 3.0, 4.0 }
195+
const double x[] = { 1.0, 2.0, 3.0, 4.0 };
196196

197197
double v = stdlib_strided_dasumpw( 4, x, 1 );
198198
// returns 10.0
@@ -213,7 +213,7 @@ double stdlib_strided_dasumpw( const CBLAS_INT N, const double *X, const CBLAS_I
213213
Computes the sum of absolute values ([_L1_ norm][l1norm]) of double-precision floating-point strided array elements using pairwise summation and alternative indexing semantics.
214214

215215
```c
216-
const double x[] = { 1.0, 2.0, 3.0, 4.0 }
216+
const double x[] = { 1.0, 2.0, 3.0, 4.0 };
217217

218218
double v = stdlib_strided_dasumpw_ndarray( 4, x, 1, 0 );
219219
// returns 10.0

lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ console.log( y );
199199
Computes the cumulative sum of double-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm.
200200

201201
```c
202-
const double x[] = { 1.0, 2.0, 3.0, 4.0 }
203-
double y[] = { 0.0, 0.0, 0.0, 0.0 }
202+
const double x[] = { 1.0, 2.0, 3.0, 4.0 };
203+
double y[] = { 0.0, 0.0, 0.0, 0.0 };
204204

205205
stdlib_strided_dcusumkbn2( 4, 0.0, x, 1, y, 1 );
206206
```
@@ -227,8 +227,8 @@ void stdlib_strided_dcusumkbn2( const CBLAS_INT N, const double sum, const doubl
227227
Computes the cumulative sum of double-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics.
228228

229229
```c
230-
const double x[] = { 1.0, 2.0, 3.0, 4.0 }
231-
double y[] = { 0.0, 0.0, 0.0, 0.0 }
230+
const double x[] = { 1.0, 2.0, 3.0, 4.0 };
231+
double y[] = { 0.0, 0.0, 0.0, 0.0 };
232232

233233
stdlib_strided_dcusumkbn2_ndarray( 4, 0.0, x, 1, 0, y, 1, 0 );
234234
```

lib/node_modules/@stdlib/blas/ext/base/dcusumors/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ void stdlib_strided_dcusumors( const CBLAS_INT N, double sum, const double *X, c
228228
Computes the cumulative sum of double-precision floating-point strided array elements using ordinary recursive summation and alternative indexing semantics.
229229

230230
```c
231-
const double x[] = { 1.0, 2.0, 3.0, 4.0 }
232-
double y[] = { 0.0, 0.0, 0.0, 0.0 }
231+
const double x[] = { 1.0, 2.0, 3.0, 4.0 };
232+
double y[] = { 0.0, 0.0, 0.0, 0.0 };
233233

234234
stdlib_strided_dcusumors_ndarray( 4, 0.0, x, 1, 0, y, 1, 0 );
235235
```

lib/node_modules/@stdlib/blas/ext/base/dcusumpw/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ void stdlib_strided_dcusumpw( const CBLAS_INT N, const double sum, const double
228228
Computes the cumulative sum of double-precision floating-point strided array elements using pairwise summation and alternative indexing semantics.
229229

230230
```c
231-
const double x[] = { 1.0, 2.0, 3.0, 4.0 }
232-
double y[] = { 0.0, 0.0, 0.0, 0.0 }
231+
const double x[] = { 1.0, 2.0, 3.0, 4.0 };
232+
double y[] = { 0.0, 0.0, 0.0, 0.0 };
233233

234234
stdlib_strided_dcusumpw_ndarray( 4, 0.0, x, 1, 0, y, 1, 0 );
235235
```

0 commit comments

Comments
 (0)