@@ -30,40 +30,40 @@ limitations under the License.
30
30
var csrot = require ( ' @stdlib/blas/base/csrot' );
31
31
```
32
32
33
- #### csrot( N, cx , strideX, cy , strideY, c, s )
33
+ #### csrot( N, x , strideX, y , strideY, c, s )
34
34
35
35
Applies a plane rotation.
36
36
37
37
``` javascript
38
38
var Complex64Array = require ( ' @stdlib/array/complex64' );
39
39
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 ] );
42
42
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 ]
46
46
```
47
47
48
48
The function has the following parameters:
49
49
50
50
- ** 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 ` .
55
55
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,
57
57
58
58
``` javascript
59
59
var Complex64Array = require ( ' @stdlib/array/complex64' );
60
60
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 ] );
63
63
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 ]
67
67
```
68
68
69
69
Note 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 [
74
74
var Complex64Array = require ( ' @stdlib/array/complex64' );
75
75
76
76
// 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 ] );
79
79
80
80
// 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
83
83
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 ]
87
87
```
88
88
89
- #### csrot.ndarray( N, cx , strideX, offsetX, cy , strideY, offsetY, c, s )
89
+ #### csrot.ndarray( N, x , strideX, offsetX, y , strideY, offsetY, c, s )
90
90
91
91
Applies a plane rotation using alternative indexing semantics.
92
92
93
93
``` javascript
94
94
var Complex64Array = require ( ' @stdlib/array/complex64' );
95
95
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 ] );
98
98
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 ]
102
102
```
103
103
104
104
The function has the following additional parameters:
105
105
106
- - ** offsetX** : starting index for ` cx ` .
107
- - ** offsetY** : starting index for ` cy ` .
106
+ - ** offsetX** : starting index for ` x ` .
107
+ - ** offsetY** : starting index for ` y ` .
108
108
109
109
While [ ` 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,
110
110
111
111
``` javascript
112
112
var Complex64Array = require ( ' @stdlib/array/complex64' );
113
113
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 ] );
116
116
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 ]
120
120
```
121
121
122
122
</section >
@@ -127,7 +127,7 @@ csrot.ndarray( 2, cx, 2, 1, cy, 2, 1, 0.8, 0.6 );
127
127
128
128
## Notes
129
129
130
- - If ` N <= 0 ` , both functions leave ` cx ` and ` cy ` unchanged.
130
+ - If ` N <= 0 ` , both functions leave ` x ` and ` y ` unchanged.
131
131
- ` csrot() ` corresponds to the [ BLAS] [ blas ] level 1 function [ ` csrot ` ] [ csrot ] .
132
132
133
133
</section >
@@ -154,17 +154,17 @@ function rand() {
154
154
}
155
155
156
156
// 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 );
159
159
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 );
162
162
163
163
// 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 );
165
165
166
166
// Print the results:
167
- logEach ( ' (%s,%s) => (%s,%s)' , cxc, cyc, cx, cy );
167
+ logEach ( ' (%s,%s) => (%s,%s)' , xc, yc, x, y );
168
168
```
169
169
170
170
</section >
@@ -211,15 +211,15 @@ c_csrot( 2, (void *)x, 1, (void *)y, 1, 0.8f, 0.6f );
211
211
The function accepts the following arguments:
212
212
213
213
- **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 `.
218
218
- **c**: `[in] float` cosine of the angle of rotation.
219
219
- **s**: `[in] float` sine of the angle of rotation.
220
220
221
221
```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 );
223
223
```
224
224
225
225
#### 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 );
236
236
The function accepts the following arguments:
237
237
238
238
- **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 `.
245
245
- **c**: `[in] float` cosine of the angle of rotation.
246
246
- **s**: `[in] float` sine of the angle of rotation.
247
247
248
248
```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 );
250
250
```
251
251
252
252
</section >
0 commit comments