@@ -20,7 +20,7 @@ limitations under the License.
2020
2121# csrot
2222
23- > Applies a plane rotation.
23+ > Apply a plane rotation.
2424
2525<section class =" usage " >
2626
@@ -30,40 +30,40 @@ limitations under the License.
3030var csrot = require ( ' @stdlib/blas/base/csrot' );
3131```
3232
33- #### csrot( N, cx , strideX, cy , strideY, c, s )
33+ #### csrot( N, x , strideX, y , strideY, c, s )
3434
3535Applies a plane rotation.
3636
3737``` javascript
3838var Complex64Array = require ( ' @stdlib/array/complex64' );
3939
40- var cx = new Complex64Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
41- var cy = new Complex64Array ( [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] );
40+ var x = new Complex64Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
41+ var y = new Complex64Array ( [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] );
4242
43- csrot ( cx .length , cx , 1 , cy , 1 , 0.8 , 0.6 );
44- // cx => <Complex64Array>[ ~0.8, ~1.6, ~2.4, ~3.2, 4.0, ~4.8, ~5.6, ~6.4 ]
45- // cy => <Complex64Array>[ ~-0.6, ~-1.2, ~-1.8, ~-2.4, -3.0, ~-3.6, ~-4.2, ~-4.8 ]
43+ csrot ( x .length , x , 1 , y , 1 , 0.8 , 0.6 );
44+ // x => <Complex64Array>[ ~0.8, ~1.6, ~2.4, ~3.2, 4.0, ~4.8, ~5.6, ~6.4 ]
45+ // y => <Complex64Array>[ ~-0.6, ~-1.2, ~-1.8, ~-2.4, -3.0, ~-3.6, ~-4.2, ~-4.8 ]
4646```
4747
4848The function has the following parameters:
4949
5050- ** N** : number of indexed elements.
51- - ** cx ** : first input [ ` Complex64Array ` ] [ @stdlib/array/complex64 ] .
52- - ** strideX** : index increment for ` cx ` .
53- - ** cy ** : second input [ ` Complex64Array ` ] [ @stdlib/array/complex64 ] .
54- - ** strideY** : index increment for ` cy ` .
51+ - ** x ** : first input [ ` Complex64Array ` ] [ @stdlib/array/complex64 ] .
52+ - ** strideX** : index increment for ` x ` .
53+ - ** y ** : second input [ ` Complex64Array ` ] [ @stdlib/array/complex64 ] .
54+ - ** strideY** : index increment for ` y ` .
5555
56- The ` N ` and stride parameters determine how values from ` cx ` and ` cy ` are accessed at runtime. For example, to apply a plane rotation to every other element,
56+ The ` N ` and stride parameters determine how values from ` x ` and ` y ` are accessed at runtime. For example, to apply a plane rotation to every other element,
5757
5858``` javascript
5959var Complex64Array = require ( ' @stdlib/array/complex64' );
6060
61- var cx = new Complex64Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
62- var cy = new Complex64Array ( [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] );
61+ var x = new Complex64Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
62+ var y = new Complex64Array ( [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] );
6363
64- csrot ( 2 , cx , 2 , cy , 2 , 0.8 , 0.6 );
65- // cx => <Complex64Array>[ ~0.8, ~1.6, 3.0, 4.0, 4.0, ~4.8, 7.0, 8.0 ]
66- // cy => <Complex64Array>[ ~-0.6, ~-1.2, 0.0, 0.0, -3.0, ~-3.6, 0.0, 0.0 ]
64+ csrot ( 2 , x , 2 , y , 2 , 0.8 , 0.6 );
65+ // x => <Complex64Array>[ ~0.8, ~1.6, 3.0, 4.0, 4.0, ~4.8, 7.0, 8.0 ]
66+ // y => <Complex64Array>[ ~-0.6, ~-1.2, 0.0, 0.0, -3.0, ~-3.6, 0.0, 0.0 ]
6767```
6868
6969Note that indexing is relative to the first index. To introduce an offset, use [ ` typed array ` ] [ mdn-typed-array ] views.
@@ -74,49 +74,49 @@ Note that indexing is relative to the first index. To introduce an offset, use [
7474var Complex64Array = require ( ' @stdlib/array/complex64' );
7575
7676// Initial arrays...
77- var cx0 = new Complex64Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
78- var cy0 = new Complex64Array ( [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] );
77+ var x0 = new Complex64Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
78+ var y0 = new Complex64Array ( [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] );
7979
8080// Create offset views...
81- var cx1 = new Complex64Array ( cx0 .buffer , cx0 .BYTES_PER_ELEMENT * 1 ); // start at 2nd element
82- var cy1 = new Complex64Array ( cy0 .buffer , cy0 .BYTES_PER_ELEMENT * 2 ); // start at 3rd element
81+ var x1 = new Complex64Array ( x0 .buffer , x0 .BYTES_PER_ELEMENT * 1 ); // start at 2nd element
82+ var y1 = new Complex64Array ( y0 .buffer , y0 .BYTES_PER_ELEMENT * 2 ); // start at 3rd element
8383
84- csrot ( 2 , cx1 , - 2 , cy1 , 1 , 0.8 , 0.6 );
85- // cx0 => <Complex64Array>[ 1.0, 2.0, ~2.4, ~3.2, 5.0, 6.0, ~5.6, ~6.4 ]
86- // cy0 => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, ~-4.2, ~-4.8, ~-1.8, ~-2.4 ]
84+ csrot ( 2 , x1 , - 2 , y1 , 1 , 0.8 , 0.6 );
85+ // x0 => <Complex64Array>[ 1.0, 2.0, ~2.4, ~3.2, 5.0, 6.0, ~5.6, ~6.4 ]
86+ // y0 => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, ~-4.2, ~-4.8, ~-1.8, ~-2.4 ]
8787```
8888
89- #### csrot.ndarray( N, cx , strideX, offsetX, cy , strideY, offsetY, c, s )
89+ #### csrot.ndarray( N, x , strideX, offsetX, y , strideY, offsetY, c, s )
9090
9191Applies a plane rotation using alternative indexing semantics.
9292
9393``` javascript
9494var Complex64Array = require ( ' @stdlib/array/complex64' );
9595
96- var cx = new Complex64Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ] );
97- var cy = new Complex64Array ( [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] );
96+ var x = new Complex64Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ] );
97+ var y = new Complex64Array ( [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] );
9898
99- csrot .ndarray ( cx .length , cx , 1 , 0 , cy , 1 , 0 , 0.8 , 0.6 );
100- // cx => <Complex64Array>[ ~0.8, ~1.6, ~2.4, ~3.2, 4.0, ~4.8 ]
101- // cy => <Complex64Array>[ ~-0.6, ~-1.2, ~-1.8, ~-2.4, -3.0, ~-3.6 ]
99+ csrot .ndarray ( x .length , x , 1 , 0 , y , 1 , 0 , 0.8 , 0.6 );
100+ // x => <Complex64Array>[ ~0.8, ~1.6, ~2.4, ~3.2, 4.0, ~4.8 ]
101+ // y => <Complex64Array>[ ~-0.6, ~-1.2, ~-1.8, ~-2.4, -3.0, ~-3.6 ]
102102```
103103
104104The function has the following additional parameters:
105105
106- - ** offsetX** : starting index for ` cx ` .
107- - ** offsetY** : starting index for ` cy ` .
106+ - ** offsetX** : starting index for ` x ` .
107+ - ** offsetY** : starting index for ` y ` .
108108
109109While [ ` typed array ` ] [ mdn-typed-array ] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to apply a plane rotation to every other element starting from the second element,
110110
111111``` javascript
112112var Complex64Array = require ( ' @stdlib/array/complex64' );
113113
114- var cx = new Complex64Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
115- var cy = new Complex64Array ( [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] );
114+ var x = new Complex64Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
115+ var y = new Complex64Array ( [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] );
116116
117- csrot .ndarray ( 2 , cx , 2 , 1 , cy , 2 , 1 , 0.8 , 0.6 );
118- // cx => <Complex64Array>[ 1.0, 2.0, ~2.4, ~3.2, 5.0, 6.0, ~5.6, ~6.4 ]
119- // cy => <Complex64Array>[ 0.0, 0.0, ~-1.8, ~-2.4, 0.0, 0.0, ~-4.2, ~-4.8 ]
117+ csrot .ndarray ( 2 , x , 2 , 1 , y , 2 , 1 , 0.8 , 0.6 );
118+ // x => <Complex64Array>[ 1.0, 2.0, ~2.4, ~3.2, 5.0, 6.0, ~5.6, ~6.4 ]
119+ // y => <Complex64Array>[ 0.0, 0.0, ~-1.8, ~-2.4, 0.0, 0.0, ~-4.2, ~-4.8 ]
120120```
121121
122122</section >
@@ -127,7 +127,7 @@ csrot.ndarray( 2, cx, 2, 1, cy, 2, 1, 0.8, 0.6 );
127127
128128## Notes
129129
130- - If ` N <= 0 ` , both functions leave ` cx ` and ` cy ` unchanged.
130+ - If ` N <= 0 ` , both functions leave ` x ` and ` y ` unchanged.
131131- ` csrot() ` corresponds to the [ BLAS] [ blas ] level 1 function [ ` csrot ` ] [ csrot ] .
132132
133133</section >
@@ -154,17 +154,17 @@ function rand() {
154154}
155155
156156// Generate random input arrays:
157- var cx = filledarrayBy ( 10 , ' complex64' , rand );
158- var cxc = ccopy ( cx .length , cx , 1 , zeros ( cx .length , ' complex64' ), 1 );
157+ var x = filledarrayBy ( 10 , ' complex64' , rand );
158+ var xc = ccopy ( x .length , x , 1 , zeros ( x .length , ' complex64' ), 1 );
159159
160- var cy = filledarrayBy ( 10 , ' complex64' , rand );
161- var cyc = ccopy ( cy .length , cy , 1 , zeros ( cy .length , ' complex64' ), 1 );
160+ var y = filledarrayBy ( 10 , ' complex64' , rand );
161+ var yc = ccopy ( y .length , y , 1 , zeros ( y .length , ' complex64' ), 1 );
162162
163163// Apply a plane rotation:
164- csrot ( cx .length , cx , 1 , cy , 1 , 0.8 , 0.6 );
164+ csrot ( x .length , x , 1 , y , 1 , 0.8 , 0.6 );
165165
166166// Print the results:
167- logEach ( ' (%s,%s) => (%s,%s)' , cxc, cyc, cx, cy );
167+ logEach ( ' (%s,%s) => (%s,%s)' , xc, yc, x, y );
168168```
169169
170170</section >
@@ -211,15 +211,15 @@ c_csrot( 2, (void *)x, 1, (void *)y, 1, 0.8f, 0.6f );
211211The function accepts the following arguments:
212212
213213- **N**: `[in] CBLAS_INT` number of indexed elements.
214- - **CX **: `[inout] void*` first input array.
215- - **strideX**: `[in] CBLAS_INT` index increment for `CX `.
216- - **CY **: `[inout] void*` second input array.
217- - **strideY**: `[in] CBLAS_INT` index increment for `CY `.
214+ - **X **: `[inout] void*` first input array.
215+ - **strideX**: `[in] CBLAS_INT` index increment for `X `.
216+ - **Y **: `[inout] void*` second input array.
217+ - **strideY**: `[in] CBLAS_INT` index increment for `Y `.
218218- **c**: `[in] float` cosine of the angle of rotation.
219219- **s**: `[in] float` sine of the angle of rotation.
220220
221221```c
222- void c_csrot( const CBLAS_INT N, void *CX , const CBLAS_INT strideX, void *CY , const CBLAS_INT strideY, const float c, const float s );
222+ void c_csrot( const CBLAS_INT N, void *X , const CBLAS_INT strideX, void *Y , const CBLAS_INT strideY, const float c, const float s );
223223```
224224
225225#### c_csrot_ndarray( N, \* X, strideX, offsetX, \* Y, strideY, offsetY, c, s )
@@ -236,17 +236,17 @@ c_csrot_ndarray( 2, (void *)x, 1, 0, (void *)y, 1, 0, 0.8f, 0.6f );
236236The function accepts the following arguments:
237237
238238- **N**: `[in] CBLAS_INT` number of indexed elements.
239- - **CX **: `[inout] void*` first input array.
240- - **strideX**: `[in] CBLAS_INT` index increment for `CX `.
241- - **offsetX**: `[in] CBLAS_INT` starting index for `CX `.
242- - **CY **: `[inout] void*` second input array.
243- - **strideY**: `[in] CBLAS_INT` index increment for `CY `.
244- - **offsetY**: `[in] CBLAS_INT` starting index for `CY `.
239+ - **X **: `[inout] void*` first input array.
240+ - **strideX**: `[in] CBLAS_INT` index increment for `X `.
241+ - **offsetX**: `[in] CBLAS_INT` starting index for `X `.
242+ - **Y **: `[inout] void*` second input array.
243+ - **strideY**: `[in] CBLAS_INT` index increment for `Y `.
244+ - **offsetY**: `[in] CBLAS_INT` starting index for `Y `.
245245- **c**: `[in] float` cosine of the angle of rotation.
246246- **s**: `[in] float` sine of the angle of rotation.
247247
248248```c
249- void c_csrot_ndarray( const CBLAS_INT N, void *CX , const CBLAS_INT strideX, const CBLAS_INT offsetX, void *CY , const CBLAS_INT strideY, const CBLAS_INT offsetY, const float c, const float s );
249+ void c_csrot_ndarray( const CBLAS_INT N, void *X , const CBLAS_INT strideX, const CBLAS_INT offsetX, void *Y , const CBLAS_INT strideY, const CBLAS_INT offsetY, const float c, const float s );
250250```
251251
252252</section >
0 commit comments