Skip to content

Latest commit

 

History

History
121 lines (75 loc) · 3.15 KB

File metadata and controls

121 lines (75 loc) · 3.15 KB

zcopy

Copy values from a one-dimensional double-precision complex floating-point ndarray x into a one-dimensional double-precision complex floating-point ndarray y.

Usage

var zcopy = require( '@stdlib/blas/base/ndarray/zcopy' );

zcopy( arrays )

Copies values from a one-dimensional double-precision complex floating-point ndarray x into a one-dimensional double-precision complex floating-point ndarray y.

var Complex128Array = require( '@stdlib/array/complex128' );
var ndarray = require( '@stdlib/ndarray/base/ctor' );

var xbuf = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
var x = new ndarray( 'complex128', xbuf, [ 3 ], [ 1 ], 0, 'row-major' );

var ybuf = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
var y = new ndarray( 'complex128', ybuf, [ 3 ], [ 1 ], 0, 'row-major' );

var z = zcopy( [ x, y ] );
// returns <ndarray>[ <Complex128>[ 1.0, 2.0 ], <Complex128>[ 3.0, 4.0 ], <Complex128>[ 5.0, 6.0 ] ]

var bool = ( y === z );
// returns true

The function has the following parameters:

  • arrays: array-like object containing an input ndarray and an output ndarray.

Examples

var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var Complex128Array = require( '@stdlib/array/complex128' );
var ndarray = require( '@stdlib/ndarray/base/ctor' );
var ndarray2array = require( '@stdlib/ndarray/to-array' );
var zcopy = require( '@stdlib/blas/base/ndarray/zcopy' );

var opts = {
    'dtype': 'float64'
};

var xbuf = new Complex128Array( discreteUniform( 10, 0, 100, opts ) );
var x = new ndarray( 'complex128', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
console.log( ndarray2array( x ) );

var ybuf = new Complex128Array( discreteUniform( xbuf.length, 0, 10, opts ) );
var y = new ndarray( 'complex128', ybuf, [ ybuf.length ], [ 1 ], 0, 'row-major' );
console.log( ndarray2array( y ) );

var out = zcopy( [ x, y ] );
console.log( ndarray2array( out ) );