Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 5 additions & 45 deletions lib/node_modules/@stdlib/strided/base/zmap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ Applies a unary function to a double-precision complex floating-point strided in

```javascript
var Complex128Array = require( '@stdlib/array/complex128' );
var real = require( '@stdlib/complex/float64/real' );
var imag = require( '@stdlib/complex/float64/imag' );
var cceil = require( '@stdlib/math/base/special/cceil' );

var x = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] );
Expand All @@ -52,13 +50,7 @@ var y = new Complex128Array( x.length );
zmap( x.length, x, 1, y, 1, cceil );

var v = y.get( 0 );
// returns <Complex128>

var re = real( v );
// returns -2.0

var im = imag( v );
// returns 2.0
// returns <Complex128>[ -2.0, 2.0 ]
```

The function accepts the following arguments:
Expand All @@ -74,8 +66,6 @@ The `N` and stride parameters determine which elements in the strided arrays are

```javascript
var Complex128Array = require( '@stdlib/array/complex128' );
var real = require( '@stdlib/complex/float64/real' );
var imag = require( '@stdlib/complex/float64/imag' );
var cceil = require( '@stdlib/math/base/special/cceil' );

var x = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] );
Expand All @@ -84,21 +74,13 @@ var y = new Complex128Array( x.length );
zmap( 2, x, 2, y, -1, cceil );

var v = y.get( 0 );
// returns <Complex128>

var re = real( v );
// returns 5.0

var im = imag( v );
// returns 0.0
// returns <Complex128>[ 5.0, 0.0 ]
```

Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/complex128] views.

```javascript
var Complex128Array = require( '@stdlib/array/complex128' );
var real = require( '@stdlib/complex/float64/real' );
var imag = require( '@stdlib/complex/float64/imag' );
var cceil = require( '@stdlib/math/base/special/cceil' );

// Initial arrays...
Expand All @@ -112,13 +94,7 @@ var y1 = new Complex128Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3
zmap( 2, x1, -2, y1, 1, cceil );

var v = y0.get( 2 );
// returns <Complex128>

var re = real( v );
// returns -1.0

var im = imag( v );
// returns 4.0
// returns <Complex128>[ -1.0, 4.0 ]
```

#### zmap.ndarray( N, x, strideX, offsetX, y, strideY, offsetY, fcn )
Expand All @@ -127,8 +103,6 @@ Applies a unary function to a double-precision complex floating-point strided in

```javascript
var Complex128Array = require( '@stdlib/array/complex128' );
var real = require( '@stdlib/complex/float64/real' );
var imag = require( '@stdlib/complex/float64/imag' );
var cceil = require( '@stdlib/math/base/special/cceil' );

var x = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] );
Expand All @@ -137,13 +111,7 @@ var y = new Complex128Array( x.length );
zmap.ndarray( x.length, x, 1, 0, y, 1, 0, cceil );

var v = y.get( 0 );
// returns <Complex128>

var re = real( v );
// returns -2.0

var im = imag( v );
// returns 2.0
// returns <Complex128>[ -2.0, 2.0 ]
```

The function accepts the following additional arguments:
Expand All @@ -155,8 +123,6 @@ While [`typed array`][@stdlib/array/complex128] views mandate a view offset base

```javascript
var Complex128Array = require( '@stdlib/array/complex128' );
var real = require( '@stdlib/complex/float64/real' );
var imag = require( '@stdlib/complex/float64/imag' );
var cceil = require( '@stdlib/math/base/special/cceil' );

var x = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] );
Expand All @@ -165,13 +131,7 @@ var y = new Complex128Array( x.length );
zmap.ndarray( 2, x, 2, 1, y, -1, y.length-1, cceil );

var v = y.get( y.length-1 );
// returns <Complex128>

var re = real( v );
// returns 4.0

var im = imag( v );
// returns -5.0
// returns <Complex128>[ 4.0, -5.0 ]
```

</section>
Expand Down
30 changes: 5 additions & 25 deletions lib/node_modules/@stdlib/strided/base/zmap/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,13 @@
> var y = new {{alias:@stdlib/array/complex128}}( x.length );
> {{alias}}( x.length, x, 1, y, 1, {{alias:@stdlib/complex/float64/base/identity}} );
> var v = y.get( 0 )
<Complex128>
> var re = {{alias:@stdlib/complex/float64/real}}( v )
1.0
> var im = {{alias:@stdlib/complex/float64/imag}}( v )
2.0
<Complex128>[ 1.0, 2.0 ]

// Using `N` and stride parameters:
> y = new {{alias:@stdlib/array/complex128}}( x.length );
> {{alias}}( 2, x, 2, y, -1, {{alias:@stdlib/complex/float64/base/identity}} );
> v = y.get( 0 )
<Complex128>
> re = {{alias:@stdlib/complex/float64/real}}( v )
5.0
> im = {{alias:@stdlib/complex/float64/imag}}( v )
6.0
<Complex128>[ 5.0, 6.0 ]

// Using view offsets:
> var x0 = new {{alias:@stdlib/array/complex128}}( xbuf );
Expand All @@ -66,11 +58,7 @@
> var y1 = new {{alias:@stdlib/array/complex128}}( y0.buffer, y0.BYTES_PER_ELEMENT*2 );
> {{alias}}( 2, x1, -2, y1, 1, {{alias:@stdlib/complex/float64/base/identity}} );
> v = y1.get( 0 )
<Complex128>
> re = {{alias:@stdlib/complex/float64/real}}( v )
7.0
> im = {{alias:@stdlib/complex/float64/imag}}( v )
8.0
<Complex128>[ 7.0, 8.0 ]


{{alias}}.ndarray( N, x, strideX, offsetX, y, strideY, offsetY, fcn )
Expand Down Expand Up @@ -121,22 +109,14 @@
> var y = new {{alias:@stdlib/array/complex128}}( x.length );
> {{alias}}.ndarray( x.length, x, 1, 0, y, 1, 0, {{alias:@stdlib/complex/float64/base/identity}} );
> var v = y.get( 0 )
<Complex128>
> var re = {{alias:@stdlib/complex/float64/real}}( v )
1.0
> var im = {{alias:@stdlib/complex/float64/imag}}( v )
2.0
<Complex128>[ 1.0, 2.0 ]

// Advanced indexing:
> x = new {{alias:@stdlib/array/complex128}}( xbuf );
> y = new {{alias:@stdlib/array/complex128}}( x.length );
> {{alias}}.ndarray( 2, x, 2, 1, y, -1, y.length-1, {{alias:@stdlib/complex/float64/base/identity}} );
> v = y.get( y.length-1 )
<Complex128>
> re = {{alias:@stdlib/complex/float64/real}}( v )
3.0
> im = {{alias:@stdlib/complex/float64/imag}}( v )
4.0
<Complex128>[ 3.0, 4.0 ]

See Also
--------
Expand Down
32 changes: 4 additions & 28 deletions lib/node_modules/@stdlib/strided/base/zmap/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ interface Routine {
* zmap( x.length, x, 1, y, 1, scale );
*
* var v = y.get( 0 );
* // returns <Complex128>
*
* var re = real( v );
* // returns 10.0
*
* var im = imag( v );
* // returns 10.0
* // returns <Complex128>[ 10.0, 10.0 ]
*/
( N: number, x: Complex128Array, strideX: number, y: Complex128Array, strideY: number, fcn: Unary ): Complex128Array;

Expand Down Expand Up @@ -105,13 +99,7 @@ interface Routine {
* zmap.ndarray( x.length, x, 1, 0, y, 1, 0, scale );
*
* var v = y.get( 0 );
* // returns <Complex128>
*
* var re = real( v );
* // returns 10.0
*
* var im = imag( v );
* // returns 10.0
* // returns <Complex128>[ 10.0, 10.0 ]
*/
ndarray( N: number, x: Complex128Array, strideX: number, offsetX: number, y: Complex128Array, strideY: number, offsetY: number, fcn: Unary ): Complex128Array;
}
Expand Down Expand Up @@ -145,13 +133,7 @@ interface Routine {
* zmap( x.length, x, 1, y, 1, scale );
*
* var v = y.get( 0 );
* // returns <Complex128>
*
* var re = real( v );
* // returns 10.0
*
* var im = imag( v );
* // returns 10.0
* // returns <Complex128>[ 10.0, 10.0 ]
*
* @example
* var Complex128Array = require( '@stdlib/array/complex128' );
Expand All @@ -171,13 +153,7 @@ interface Routine {
* zmap.ndarray( x.length, x, 1, 0, y, 1, 0, scale );
*
* var v = y.get( 0 );
* // returns <Complex128>
*
* var re = real( v );
* // returns 10.0
*
* var im = imag( v );
* // returns 10.0
* // returns <Complex128>[ 10.0, 10.0 ]
*/
declare var zmap: Routine;

Expand Down
16 changes: 2 additions & 14 deletions lib/node_modules/@stdlib/strided/base/zmap/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,7 @@
* zmap( x.length, x, 1, y, 1, scale );
*
* var v = y.get( 0 );
* // returns <Complex128>
*
* var re = real( v );
* // returns 10.0
*
* var im = imag( v );
* // returns 10.0
* // returns <Complex128>[ 10.0, 10.0 ]
*
* @example
* var Complex128Array = require( '@stdlib/array/complex128' );
Expand All @@ -69,13 +63,7 @@
* zmap.ndarray( x.length, x, 1, 0, y, 1, 0, scale );
*
* var v = y.get( 0 );
* // returns <Complex128>
*
* var re = real( v );
* // returns 10.0
*
* var im = imag( v );
* // returns 10.0
* // returns <Complex128>[ 10.0, 10.0 ]
*/

// MODULES //
Expand Down
8 changes: 1 addition & 7 deletions lib/node_modules/@stdlib/strided/base/zmap/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ var ndarray = require( './ndarray.js' );
* zmap( x.length, x, 1, y, 1, scale );
*
* var v = y.get( 0 );
* // returns <Complex128>
*
* var re = real( v );
* // returns 10.0
*
* var im = imag( v );
* // returns 10.0
* // returns <Complex128>[ 10.0, 10.0 ]
*/
function zmap( N, x, strideX, y, strideY, fcn ) {
return ndarray( N, x, strideX, stride2offset( N, strideX ), y, strideY, stride2offset( N, strideY ), fcn ); // eslint-disable-line max-len
Expand Down
8 changes: 1 addition & 7 deletions lib/node_modules/@stdlib/strided/base/zmap/lib/ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,7 @@
* zmap( x.length, x, 1, 0, y, 1, 0, scale );
*
* var v = y.get( 0 );
* // returns <Complex128>
*
* var re = real( v );
* // returns 10.0
*
* var im = imag( v );
* // returns 10.0
* // returns <Complex128>[ 10.0, 10.0 ]
*/
function zmap( N, x, strideX, offsetX, y, strideY, offsetY, fcn ) {
var ix;
Expand Down