@@ -30,33 +30,33 @@ limitations under the License.
3030var scasum = require ( ' @stdlib/blas/base/scasum' );
3131```
3232
33- #### scasum( N, cx , strideX )
33+ #### scasum( N, x , strideX )
3434
3535Computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector.
3636
3737``` javascript
3838var Complex64Array = require ( ' @stdlib/array/complex64' );
3939
40- var cx = new Complex64Array ( [ 0.3 , 0.1 , 0.5 , 0.0 , 0.0 , 0.5 , 0.0 , 0.2 ] );
40+ var x = new Complex64Array ( [ 0.3 , 0.1 , 0.5 , 0.0 , 0.0 , 0.5 , 0.0 , 0.2 ] );
4141
42- var out = scasum ( 4 , cx , 1 );
42+ var out = scasum ( 4 , x , 1 );
4343// returns ~1.6
4444```
4545
4646The function has the following parameters:
4747
4848- ** N** : number of indexed elements.
49- - ** cx ** : input [ ` Complex64Array ` ] [ @stdlib/array/complex64 ] .
50- - ** strideX** : index increment for ` cx ` .
49+ - ** x ** : input [ ` Complex64Array ` ] [ @stdlib/array/complex64 ] .
50+ - ** strideX** : index increment for ` x ` .
5151
5252The ` 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
5555var Complex64Array = require ( ' @stdlib/array/complex64' );
5656
57- var cx = new Complex64Array ( [ - 2.0 , 1.0 , 3.0 , - 5.0 , 4.0 , 0.0 , - 1.0 , - 3.0 ] );
57+ var x = new Complex64Array ( [ - 2.0 , 1.0 , 3.0 , - 5.0 , 4.0 , 0.0 , - 1.0 , - 3.0 ] );
5858
59- var out = scasum ( 2 , cx , 2 );
59+ var out = scasum ( 2 , x , 2 );
6060// returns 7.0
6161```
6262
@@ -66,26 +66,26 @@ Note that indexing is relative to the first index. To introduce an offset, use [
6666var Complex64Array = require ( ' @stdlib/array/complex64' );
6767
6868// Initial array:
69- var cx0 = new Complex64Array ( [ 1.0 , - 2.0 , 3.0 , - 4.0 , 5.0 , - 6.0 ] );
69+ var x0 = new Complex64Array ( [ 1.0 , - 2.0 , 3.0 , - 4.0 , 5.0 , - 6.0 ] );
7070
7171// Create an offset view:
72- var cx1 = new Complex64Array ( cx0 .buffer , cx0 .BYTES_PER_ELEMENT * 1 ); // start at 2nd element
72+ var x1 = new Complex64Array ( x0 .buffer , x0 .BYTES_PER_ELEMENT * 1 ); // start at 2nd element
7373
7474// Compute the L2-out:
75- var out = scasum ( 2 , cx1 , 1 );
75+ var out = scasum ( 2 , x1 , 1 );
7676// returns 18.0
7777```
7878
79- #### scasum.ndarray( N, cx , strideX, offset )
79+ #### scasum.ndarray( N, x , strideX, offset )
8080
8181Computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector using alternative indexing semantics.
8282
8383``` javascript
8484var Complex64Array = require ( ' @stdlib/array/complex64' );
8585
86- var cx = new Complex64Array ( [ 0.3 , 0.1 , 0.5 , 0.0 , 0.0 , 0.5 , 0.0 , 0.2 ] );
86+ var x = new Complex64Array ( [ 0.3 , 0.1 , 0.5 , 0.0 , 0.0 , 0.5 , 0.0 , 0.2 ] );
8787
88- var out = scasum .ndarray ( 4 , cx , 1 , 0 );
88+ var out = scasum .ndarray ( 4 , x , 1 , 0 );
8989// returns ~1.6
9090```
9191
@@ -98,9 +98,9 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the
9898``` javascript
9999var Complex64Array = require ( ' @stdlib/array/complex64' );
100100
101- var cx = new Complex64Array ( [ 1.0 , - 2.0 , 3.0 , - 4.0 , 5.0 , - 6.0 ] );
101+ var x = new Complex64Array ( [ 1.0 , - 2.0 , 3.0 , - 4.0 , 5.0 , - 6.0 ] );
102102
103- var out = scasum .ndarray ( 2 , cx , 1 , 1 );
103+ var out = scasum .ndarray ( 2 , x , 1 , 1 );
104104// returns 18.0
105105```
106106
@@ -135,11 +135,11 @@ function rand() {
135135 return new Complex64 ( discreteUniform ( 0 , 10 ), discreteUniform ( - 5 , 5 ) );
136136}
137137
138- var cx = filledarrayBy ( 10 , ' complex64' , rand );
139- console .log ( cx .toString () );
138+ var x = filledarrayBy ( 10 , ' complex64' , rand );
139+ console .log ( x .toString () );
140140
141141// Compute the sum of the absolute values of real and imaginary components:
142- var out = scasum ( cx .length , cx , 1 );
142+ var out = scasum ( x .length , x , 1 );
143143console .log ( out );
144144```
145145
@@ -173,47 +173,47 @@ console.log( out );
173173#include " stdlib/blas/base/scasum.h"
174174```
175175
176- #### c_scasum( N, \* CX , strideX )
176+ #### c_scasum( N, \* X , strideX )
177177
178178Computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector.
179179
180180``` c
181- const float cx [] = { 0.3f, 0.1f, 0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.2f };
181+ const float X [] = { 0.3f, 0.1f, 0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.2f };
182182
183- float out = c_scasum( 4, (void * )cx , 1 );
183+ float out = c_scasum( 4, (void * )X , 1 );
184184// returns 1.6f
185185```
186186
187187The function accepts the following arguments:
188188
189189- **N**: `[in] CBLAS_INT` number of indexed elements.
190- - **CX **: `[in] void*` input array.
191- - **strideX**: `[in] CBLAS_INT` index increment for `CX `.
190+ - **X **: `[in] void*` input array.
191+ - **strideX**: `[in] CBLAS_INT` index increment for `X `.
192192
193193```c
194- float c_scasum( const CBLAS_INT N, const void *CX , const CBLAS_INT strideX );
194+ float c_scasum( const CBLAS_INT N, const void *X , const CBLAS_INT strideX );
195195```
196196
197- #### c_scasum_ndarray( N, \* CX , strideX, offsetX )
197+ #### c_scasum_ndarray( N, \* X , strideX, offsetX )
198198
199199Computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector using alternative indexing semantics.
200200
201201``` c
202- const float cx [] = { 0.3f, 0.1f, 0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.2f };
202+ const float X [] = { 0.3f, 0.1f, 0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.2f };
203203
204- float out = c_scasum_ndarray( 4, (void * )cx , 1, 0 );
204+ float out = c_scasum_ndarray( 4, (void * )X , 1, 0 );
205205// returns 1.6f
206206```
207207
208208The function accepts the following arguments:
209209
210210- **N**: `[in] CBLAS_INT` number of indexed elements.
211- - **CX **: `[in] void*` input array.
212- - **strideX**: `[in] CBLAS_INT` index increment for `CX `.
213- - **offsetX**: `[in] CBLAS_INT` starting index for `CX `.
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- float c_scasum_ndarray( const CBLAS_INT N, const void *CX , const CBLAS_INT strideX, const CBLAS_INT offsetX );
216+ float c_scasum_ndarray( const CBLAS_INT N, const void *X , const CBLAS_INT strideX, const CBLAS_INT offsetX );
217217```
218218
219219</section >
@@ -240,7 +240,7 @@ float c_scasum_ndarray( const CBLAS_INT N, const void *CX, const CBLAS_INT strid
240240
241241int main ( void ) {
242242 // Create a strided array of interleaved real and imaginary components:
243- const float cx [ ] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
243+ const float X [ ] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
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 sum of the absolute values of real and imaginary components:
252- float out = c_scasum( N, (void *)cx , strideX );
252+ float out = c_scasum( N, (void *)X , strideX );
253253
254254 // Print the result:
255255 printf( "out: %f\n", out );
256256
257257 // Compute the sum of the absolute values of real and imaginary components using alternative indexing semantics:
258- out = c_scasum_ndarray( N, (void *)cx , -strideX, N-1 );
258+ out = c_scasum_ndarray( N, (void *)X , -strideX, N-1 );
259259
260260 // Print the result:
261261 printf( "out: %f\n", out );
0 commit comments