Skip to content

Commit d26e12f

Browse files
committed
docs: change variable naming for blas/base/dznrm2
--- 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: passed - 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: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - 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 ceac1d7 commit d26e12f

30 files changed

+342
-342
lines changed

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

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,33 @@ limitations under the License.
3030
var dznrm2 = require( '@stdlib/blas/base/dznrm2' );
3131
```
3232

33-
#### dznrm2( N, zx, strideX )
33+
#### dznrm2( N, x, strideX )
3434

3535
Computes the L2-norm of a complex double-precision floating-point vector.
3636

3737
```javascript
3838
var Complex128Array = require( '@stdlib/array/complex128' );
3939

40-
var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] );
40+
var x = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] );
4141

42-
var norm = dznrm2( 4, zx, 1 );
42+
var norm = dznrm2( 4, x, 1 );
4343
// returns ~0.8
4444
```
4545

4646
The function has the following parameters:
4747

4848
- **N**: number of indexed elements.
49-
- **zx**: input [`Complex128Array`][@stdlib/array/complex128].
50-
- **strideX**: index increment for `zx`.
49+
- **x**: input [`Complex128Array`][@stdlib/array/complex128].
50+
- **strideX**: index increment for `x`.
5151

5252
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to traverse every other value,
5353

5454
```javascript
5555
var Complex128Array = require( '@stdlib/array/complex128' );
5656

57-
var zx = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
57+
var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
5858

59-
var norm = dznrm2( 2, zx, 2 );
59+
var norm = dznrm2( 2, x, 2 );
6060
// returns ~4.6
6161
```
6262

@@ -66,26 +66,26 @@ Note that indexing is relative to the first index. To introduce an offset, use [
6666
var Complex128Array = require( '@stdlib/array/complex128' );
6767

6868
// Initial array:
69-
var zx0 = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
69+
var x0 = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
7070

7171
// Create an offset view:
72-
var zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
72+
var x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
7373

7474
// Compute the L2-norm:
75-
var norm = dznrm2( 2, zx1, 1 );
75+
var norm = dznrm2( 2, x1, 1 );
7676
// returns ~9.3
7777
```
7878

79-
#### dznrm2.ndarray( N, zx, strideX, offset )
79+
#### dznrm2.ndarray( N, x, strideX, offset )
8080

8181
Computes the L2-norm of a complex double-precision floating-point vector using alternative indexing semantics.
8282

8383
```javascript
8484
var Complex128Array = require( '@stdlib/array/complex128' );
8585

86-
var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] );
86+
var x = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] );
8787

88-
var norm = dznrm2.ndarray( 4, zx, 1, 0 );
88+
var norm = dznrm2.ndarray( 4, x, 1, 0 );
8989
// returns ~0.8
9090
```
9191

@@ -98,9 +98,9 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the
9898
```javascript
9999
var Complex128Array = require( '@stdlib/array/complex128' );
100100

101-
var zx = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
101+
var x = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
102102

103-
var norm = dznrm2.ndarray( 2, zx, 1, 1 );
103+
var norm = dznrm2.ndarray( 2, x, 1, 1 );
104104
// returns ~9.3
105105
```
106106

@@ -135,11 +135,11 @@ function rand() {
135135
return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) );
136136
}
137137

138-
var zx = filledarrayBy( 10, 'complex128', rand );
139-
console.log( zx.toString() );
138+
var x = filledarrayBy( 10, 'complex128', rand );
139+
console.log( x.toString() );
140140

141141
// Computes the L2-norm:
142-
var norm = dznrm2( zx.length, zx, 1 );
142+
var norm = dznrm2( x.length, x, 1 );
143143
console.log( norm );
144144
```
145145

@@ -173,47 +173,47 @@ console.log( norm );
173173
#include "stdlib/blas/base/dznrm2.h"
174174
```
175175

176-
#### c_dznrm2( N, \*ZX, strideX )
176+
#### c_dznrm2( N, \*X, strideX )
177177

178178
Computes the L2-norm of a complex double-precision floating-point vector.
179179

180180
```c
181-
const double zx[] = { 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 };
181+
const double X[] = { 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 };
182182

183-
double norm = c_dznrm2( 4, (void *)zx, 1 );
183+
double norm = c_dznrm2( 4, (void *)X, 1 );
184184
// returns 0.8
185185
```
186186
187187
The function accepts the following arguments:
188188
189189
- **N**: `[in] CBLAS_INT` number of indexed elements.
190-
- **ZX**: `[in] void*` input array.
191-
- **strideX**: `[in] CBLAS_INT` index increment for `ZX`.
190+
- **X**: `[in] void*` input array.
191+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
192192
193193
```c
194-
double c_dznrm2( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX );
194+
double c_dznrm2( const CBLAS_INT N, const void *X, const CBLAS_INT strideX );
195195
```
196196

197-
#### c_dznrm2_ndarray( N, \*ZX, strideX, offsetX )
197+
#### c_dznrm2_ndarray( N, \*X, strideX, offsetX )
198198

199199
Computes the L2-norm of a complex double-precision floating-point vector using alternative indexing semantics.
200200

201201
```c
202-
const double zx[] = { 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 };
202+
const double X[] = { 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 };
203203

204-
double norm = c_dznrm2_ndarray( 4, (void *)zx, 1, 0 );
204+
double norm = c_dznrm2_ndarray( 4, (void *)X, 1, 0 );
205205
// returns 0.8
206206
```
207207
208208
The function accepts the following arguments:
209209
210210
- **N**: `[in] CBLAS_INT` number of indexed elements.
211-
- **ZX**: `[in] void*` input array.
212-
- **strideX**: `[in] CBLAS_INT` index increment for `ZX`.
213-
- **offsetX**: `[in] CBLAS_INT` starting index for `ZX`.
211+
- **X**: `[in] void*` input array.
212+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
213+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
214214
215215
```c
216-
double c_dznrm2_ndarray( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX, const CBLAS_INT offsetX );
216+
double c_dznrm2_ndarray( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
217217
```
218218

219219
</section>
@@ -240,7 +240,7 @@ double c_dznrm2_ndarray( const CBLAS_INT N, const void *ZX, const CBLAS_INT stri
240240

241241
int main( void ) {
242242
// Create a strided array of interleaved real and imaginary components:
243-
const double zx[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
243+
const double X[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
244244

245245
// Specify the number of elements:
246246
const int N = 4;
@@ -249,13 +249,13 @@ int main( void ) {
249249
const int strideX = 1;
250250

251251
// Compute the L2-norm:
252-
double norm = c_dznrm2( N, (void *)zx, strideX );
252+
double norm = c_dznrm2( N, (void *)X, strideX );
253253

254254
// Print the result:
255255
printf( "L2-norm: %lf\n", norm );
256256

257257
// Compute the L2-norm using alternative indexing semantics:
258-
norm = c_dznrm2_ndarray( N, (void *)zx, -strideX, N-1 );
258+
norm = c_dznrm2_ndarray( N, (void *)X, -strideX, N-1 );
259259

260260
// Print the result:
261261
printf( "L2-norm: %lf\n", norm );

lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var options = {
4646
* @returns {Function} benchmark function
4747
*/
4848
function createBenchmark( len ) {
49-
var zx = new Complex128Array( uniform( len*2, -10.0, 10.0, options ) );
49+
var x = new Complex128Array( uniform( len*2, -10.0, 10.0, options ) );
5050
return benchmark;
5151

5252
function benchmark( b ) {
@@ -55,7 +55,7 @@ function createBenchmark( len ) {
5555

5656
b.tic();
5757
for ( i = 0; i < b.iterations; i++ ) {
58-
norm = dznrm2( zx.length, zx, 1 );
58+
norm = dznrm2( x.length, x, 1 );
5959
if ( isnan( norm ) ) {
6060
b.fail( 'should not return NaN' );
6161
}

lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var options = {
5151
* @returns {Function} benchmark function
5252
*/
5353
function createBenchmark( len ) {
54-
var zx = new Complex128Array( uniform( len*2, -10.0, 10.0, options ) );
54+
var x = new Complex128Array( uniform( len*2, -10.0, 10.0, options ) );
5555
return benchmark;
5656

5757
function benchmark( b ) {
@@ -60,7 +60,7 @@ function createBenchmark( len ) {
6060

6161
b.tic();
6262
for ( i = 0; i < b.iterations; i++ ) {
63-
norm = dznrm2( zx.length, zx, 1 );
63+
norm = dznrm2( x.length, x, 1 );
6464
if ( isnan( norm ) ) {
6565
b.fail( 'should not return NaN' );
6666
}

lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var options = {
4646
* @returns {Function} benchmark function
4747
*/
4848
function createBenchmark( len ) {
49-
var zx = new Complex128Array( uniform( len*2, -10.0, 10.0, options ) );
49+
var x = new Complex128Array( uniform( len*2, -10.0, 10.0, options ) );
5050
return benchmark;
5151

5252
function benchmark( b ) {
@@ -55,7 +55,7 @@ function createBenchmark( len ) {
5555

5656
b.tic();
5757
for ( i = 0; i < b.iterations; i++ ) {
58-
norm = dznrm2( zx.length, zx, 1, 0 );
58+
norm = dznrm2( x.length, x, 1, 0 );
5959
if ( isnan( norm ) ) {
6060
b.fail( 'should not return NaN' );
6161
}

lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var options = {
5151
* @returns {Function} benchmark function
5252
*/
5353
function createBenchmark( len ) {
54-
var zx = new Complex128Array( uniform( len*2, -10.0, 10.0, options ) );
54+
var x = new Complex128Array( uniform( len*2, -10.0, 10.0, options ) );
5555
return benchmark;
5656

5757
function benchmark( b ) {
@@ -60,7 +60,7 @@ function createBenchmark( len ) {
6060

6161
b.tic();
6262
for ( i = 0; i < b.iterations; i++ ) {
63-
norm = dznrm2( zx.length, zx, 1, 0 );
63+
norm = dznrm2( x.length, x, 1, 0 );
6464
if ( isnan( norm ) ) {
6565
b.fail( 'should not return NaN' );
6666
}

lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/c/benchmark.length.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,20 @@ static double rand_double( void ) {
9595
* @return elapsed time in seconds
9696
*/
9797
static double benchmark1( int iterations, int len ) {
98-
double zx[ len*2 ];
98+
double X[ len*2 ];
9999
double elapsed;
100100
double norm;
101101
double t;
102102
int i;
103103

104104
for ( i = 0; i < len*2; i += 2 ) {
105-
zx[ i ] = ( rand_double()*10000.0 ) - 5000.0;
106-
zx[ i+1 ] = ( rand_double()*10000.0 ) - 5000.0;
105+
X[ i ] = ( rand_double()*10000.0 ) - 5000.0;
106+
X[ i+1 ] = ( rand_double()*10000.0 ) - 5000.0;
107107
}
108108
norm = 0.0;
109109
t = tic();
110110
for ( i = 0; i < iterations; i++ ) {
111-
norm = c_dznrm2( len, (void *)zx, 1 );
111+
norm = c_dznrm2( len, (void *)X, 1 );
112112
if ( norm != norm ) {
113113
printf( "should not return NaN\n" );
114114
break;
@@ -129,20 +129,20 @@ static double benchmark1( int iterations, int len ) {
129129
* @return elapsed time in seconds
130130
*/
131131
static double benchmark2( int iterations, int len ) {
132-
double zx[ len*2 ];
132+
double X[ len*2 ];
133133
double elapsed;
134134
double norm;
135135
double t;
136136
int i;
137137

138138
for ( i = 0; i < len*2; i += 2 ) {
139-
zx[ i ] = ( rand_double()*10000.0 ) - 5000.0;
140-
zx[ i+1 ] = ( rand_double()*10000.0 ) - 5000.0;
139+
X[ i ] = ( rand_double()*10000.0 ) - 5000.0;
140+
X[ i+1 ] = ( rand_double()*10000.0 ) - 5000.0;
141141
}
142142
norm = 0.0;
143143
t = tic();
144144
for ( i = 0; i < iterations; i++ ) {
145-
norm = c_dznrm2_ndarray( len, (void *)zx, 1, 0 );
145+
norm = c_dznrm2_ndarray( len, (void *)X, 1, 0 );
146146
if ( norm != norm ) {
147147
printf( "should not return NaN\n" );
148148
break;

lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/fortran/benchmark.length.f

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ double precision function benchmark( iterations, len )
124124
! ..
125125
! External functions:
126126
interface
127-
double precision function dznrm2( N, zx, strideX )
128-
complex(kind=kind(0.0d0)) :: zx(*)
127+
double precision function dznrm2( N, X, strideX )
128+
complex(kind=kind(0.0d0)) :: X(*)
129129
integer :: strideX, N
130130
end function dznrm2
131131
end interface
@@ -217,4 +217,4 @@ subroutine main()
217217
end do
218218
call print_summary( count, count )
219219
end subroutine main
220-
end program bench
220+
end program bench

0 commit comments

Comments
 (0)