@@ -37,28 +37,18 @@ Scales values from `zx` by `za`.
3737``` javascript
3838var Complex128Array = require ( ' @stdlib/array/complex128' );
3939var Complex128 = require ( ' @stdlib/complex/float64/ctor' );
40- var real = require ( ' @stdlib/complex/float64/real' );
41- var imag = require ( ' @stdlib/complex/float64/imag' );
4240
4341var zx = new Complex128Array ( [ 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 ] );
4442var za = new Complex128 ( 2.0 , 0.0 );
4543
4644zscal ( 3 , za, zx, 1 );
47-
48- var z = zx .get ( 0 );
49- // returns <Complex128>
50-
51- var re = real ( z );
52- // returns 2.0
53-
54- var im = imag ( z );
55- // returns 2.0
45+ // zx => <Complex128Array>[ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ]
5646```
5747
5848The function has the following parameters:
5949
6050- ** N** : number of indexed elements.
61- - ** za** : scalar [ ` Complex128 ` ] [ @stdlib/complex/float64/ctor ] constant.
51+ - ** za** : scalar [ ` Complex128 ` ] [ @stdlib/complex/float64/ctor ] constant.
6252- ** zx** : input [ ` Complex128Array ` ] [ @stdlib/array/complex128 ] .
6353- ** strideX** : index increment for ` zx ` .
6454
@@ -67,22 +57,12 @@ The `N` and stride parameters determine how values from `zx` are scaled by `za`.
6757``` javascript
6858var Complex128Array = require ( ' @stdlib/array/complex128' );
6959var Complex128 = require ( ' @stdlib/complex/float64/ctor' );
70- var real = require ( ' @stdlib/complex/float64/real' );
71- var imag = require ( ' @stdlib/complex/float64/imag' );
7260
7361var zx = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
7462var za = new Complex128 ( 2.0 , 0.0 );
7563
7664zscal ( 2 , za, zx, 2 );
77-
78- var z = zx .get ( 2 );
79- // returns <Complex128>
80-
81- var re = real ( z );
82- // returns 10.0
83-
84- var im = imag ( z );
85- // returns 12.0
65+ // zx => <Complex128Array>[ 2.0, 4.0, 3.0, 4.0, 10.0, 12.0, 7.0, 8.0 ]
8666```
8767
8868Note that indexing is relative to the first index. To introduce an offset, use [ ` typed array ` ] [ mdn-typed-array ] views.
@@ -92,8 +72,6 @@ Note that indexing is relative to the first index. To introduce an offset, use [
9272``` javascript
9373var Complex128Array = require ( ' @stdlib/array/complex128' );
9474var Complex128 = require ( ' @stdlib/complex/float64/ctor' );
95- var real = require ( ' @stdlib/complex/float64/real' );
96- var imag = require ( ' @stdlib/complex/float64/imag' );
9775
9876// Initial array:
9977var zx0 = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
@@ -106,15 +84,7 @@ var zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start a
10684
10785// Scales every other value from `zx1` by `za`...
10886zscal ( 3 , za, zx1, 1 );
109-
110- var z = zx0 .get ( 1 );
111- // returns <Complex128>
112-
113- var re = real ( z );
114- // returns -2.0
115-
116- var im = imag ( z );
117- // returns 14.0
87+ // zx0 => <Complex128Array>[ 1.0, 2.0, -2.0, 14.0, -2.0, 22.0, -2.0, 30.0 ]
11888```
11989
12090#### zscal.ndarray( N, za, zx, strideX, offsetX )
@@ -124,22 +94,12 @@ Scales values from `zx` by `za` using alternative indexing semantics.
12494``` javascript
12595var Complex128Array = require ( ' @stdlib/array/complex128' );
12696var Complex128 = require ( ' @stdlib/complex/float64/ctor' );
127- var real = require ( ' @stdlib/complex/float64/real' );
128- var imag = require ( ' @stdlib/complex/float64/imag' );
12997
13098var zx = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ] );
13199var za = new Complex128 ( 2.0 , 2.0 );
132100
133101zscal .ndarray ( 3 , za, zx, 1 , 0 );
134-
135- var z = zx .get ( 0 );
136- // returns <Complex128>
137-
138- var re = real ( z );
139- // returns -2.0
140-
141- var im = imag ( z );
142- // returns 6.0
102+ // zx => <Complex128Array>[ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ]
143103```
144104
145105The function has the following additional parameters:
@@ -151,22 +111,12 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the
151111``` javascript
152112var Complex128Array = require ( ' @stdlib/array/complex128' );
153113var Complex128 = require ( ' @stdlib/complex/float64/ctor' );
154- var real = require ( ' @stdlib/complex/float64/real' );
155- var imag = require ( ' @stdlib/complex/float64/imag' );
156114
157115var zx = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
158116var za = new Complex128 ( 2.0 , 2.0 );
159117
160118zscal .ndarray ( 2 , za, zx, 2 , 1 );
161-
162- var z = zx .get ( 3 );
163- // returns <Complex128>
164-
165- var re = real ( z );
166- // returns -2.0
167-
168- var im = imag ( z );
169- // returns 30.0
119+ // zx => <Complex128Array>[ 1.0, 2.0, -2.0, 14.0, 5.0, 6.0, -2.0, 30.0 ]
170120```
171121
172122</section >
0 commit comments