Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

dcopy

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

Usage

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

dcopy( arrays )

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 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/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 ) );