Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

ccopy

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

Usage

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

ccopy( arrays )

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

var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );

var x = new Complex64Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
var y = new Complex64Vector( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );

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

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

The function has the following parameters:

  • arrays: array-like object containing the following ndarrays:

    • a one-dimensional input ndarray.
    • a one-dimensional output ndarray.

Examples

var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
var ndarray2array = require( '@stdlib/ndarray/to-array' );
var ccopy = require( '@stdlib/blas/base/ndarray/ccopy' );

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

var x = new Complex64Vector( discreteUniform( 10, 0, 100, opts ) );
console.log( ndarray2array( x ) );

var y = new Complex64Vector( discreteUniform( 10, 0, 10, opts ) );
console.log( ndarray2array( y ) );

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