Copy values from a one-dimensional double-precision floating-point ndarray
xinto a one-dimensional double-precision floating-point ndarrayy.
var dcopy = require( '@stdlib/blas/base/ndarray/dcopy' );Copies values from a one-dimensional double-precision floating-point ndarray x into a one-dimensional double-precision floating-point ndarray y.
var Float64Vector = require( '@stdlib/ndarray/vector/float64' );
var x = new Float64Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
var y = new Float64Vector( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] );
var z = dcopy( [ x, y ] );
// returns <ndarray>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]
var bool = ( z === y );
// returns trueThe function has the following parameters:
-
arrays: array-like object containing the following ndarrays:
- a one-dimensional input ndarray.
- a one-dimensional output ndarray.
var discreteUniform = require( '@stdlib/random/discrete-uniform' );
var ndarray2array = require( '@stdlib/ndarray/to-array' );
var dcopy = require( '@stdlib/blas/base/ndarray/dcopy' );
var opts = {
'dtype': 'float64'
};
var x = discreteUniform( [ 10 ], 0, 100, opts );
console.log( ndarray2array( x ) );
var y = discreteUniform( [ 10 ], 0, 10, opts );
console.log( ndarray2array( y ) );
var out = dcopy( [ x, y ] );
console.log( ndarray2array( out ) );