Fill a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by
1starting from one.
var coneTo = require( '@stdlib/blas/ext/base/ndarray/cone-to' );Fills a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by 1 starting from one.
var Complex64Array = require( '@stdlib/array/complex64' );
var ndarray = require( '@stdlib/ndarray/base/ctor' );
var xbuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
var x = new ndarray( 'complex64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' );
var out = coneTo( [ x ] );
// returns <ndarray>[ <Complex64>[ 1.0, 0.0 ], <Complex64>[ 2.0, 0.0 ], <Complex64>[ 3.0, 0.0 ], <Complex64>[ 4.0, 0.0 ] ]The function has the following parameters:
- arrays: array-like object containing a one-dimensional input ndarray.
- The input ndarray is modified in-place (i.e., the input ndarray is mutated).
var zeros = require( '@stdlib/array/zeros' );
var ndarray = require( '@stdlib/ndarray/base/ctor' );
var ndarray2array = require( '@stdlib/ndarray/to-array' );
var coneTo = require( '@stdlib/blas/ext/base/ndarray/cone-to' );
var xbuf = zeros( 10, 'complex64' );
var x = new ndarray( 'complex64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
console.log( ndarray2array( x ) );
coneTo( [ x ] );
console.log( ndarray2array( x ) );