Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions lib/node_modules/@stdlib/blas/base/ndarray/zscal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,11 @@ Multiplies a one-dimensional double-precision complex floating-point ndarray by

```javascript
var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
var Complex128 = require( '@stdlib/complex/float64/ctor' );
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
var Complex128Tensor0D = require( '@stdlib/ndarray/tensor0d/complex128' );

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

var alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
'dtype': 'complex128'
});
var alpha = new Complex128Tensor0D( 2.0, 0.0 );

var y = zscal( [ x, alpha ] );
// returns <ndarray>[ <Complex128>[ 2.0, 4.0 ], <Complex128>[ 6.0, 8.0 ], <Complex128>[ 10.0, 12.0 ] ]
Expand Down Expand Up @@ -84,8 +81,7 @@ The function has the following parameters:
```javascript
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
var Complex128 = require( '@stdlib/complex/float64/ctor' );
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
var Complex128Tensor0D = require( '@stdlib/ndarray/tensor0d/complex128' );
var ndarray2array = require( '@stdlib/ndarray/to-array' );
var zscal = require( '@stdlib/blas/base/ndarray/zscal' );

Expand All @@ -96,9 +92,7 @@ var opts = {
var x = new Complex128Vector( discreteUniform( 10, 0, 100, opts ) );
console.log( ndarray2array( x ) );

var alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
'dtype': 'complex128'
});
var alpha = new Complex128Tensor0D( 2.0, 0.0 );

var out = zscal( [ x, alpha ] );
console.log( ndarray2array( out ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,13 @@ var uniform = require( '@stdlib/random/array/uniform' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var real = require( '@stdlib/complex/float64/real' );
var pow = require( '@stdlib/math/base/special/pow' );
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
var Complex128Tensor0D = require( '@stdlib/ndarray/tensor0d/complex128' );
var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
var Complex128 = require( '@stdlib/complex/float64/ctor' );
var format = require( '@stdlib/string/format' );
var pkg = require( './../package.json' ).name;
var zscal = require( './../lib' );


// VARIABLES //

var options = {
'dtype': 'complex128'
};


// FUNCTIONS //

/**
Expand All @@ -59,7 +51,7 @@ function createBenchmark( len ) {
});
x = new Complex128Vector( xbuf.buffer );

alpha = scalar2ndarray( new Complex128( 0.8, 0.6 ), options );
alpha = new Complex128Tensor0D( 0.8, 0.6 );

return benchmark;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
Examples
--------
> var x = new {{alias:@stdlib/ndarray/vector/complex128}}( [ 4.0, 2.0, -3.0, 5.0 ] );
> var ca = new {{alias:@stdlib/complex/float64/ctor}}( 2.0, 0.0 );
> var alpha = {{alias:@stdlib/ndarray/from-scalar}}( ca, { 'dtype': 'complex128' } );
> var Complex128Tensor0D = {{alias:@stdlib/ndarray/tensor0d/complex128}};
> var alpha = new Complex128Tensor0D( 2.0, 0.0 );

> {{alias}}( [ x, alpha ] );
> x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,11 @@ import { complex128ndarray } from '@stdlib/types/ndarray';
*
* @example
* var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
* var Complex128Tensor0D = require( '@stdlib/ndarray/tensor0d/complex128' );
*
* var x = new Complex128Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
*
* var alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
* 'dtype': 'complex128'
* });
* var alpha = new Complex128Tensor0D( 2.0, 0.0 );
*
* var y = zscal( [ x, alpha ] );
* // returns <ndarray>[ <Complex128>[ 2.0, 4.0 ], <Complex128>[ 6.0, 8.0 ], <Complex128>[ 10.0, 12.0 ] ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
var Complex128 = require( '@stdlib/complex/float64/ctor' );
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
var Complex128Tensor0D = require( '@stdlib/ndarray/tensor0d/complex128' );
var ndarray2array = require( '@stdlib/ndarray/to-array' );
var zscal = require( './../lib' );

Expand All @@ -32,9 +31,7 @@ var opts = {
var x = new Complex128Vector( discreteUniform( 10, 0, 100, opts ) );
console.log( ndarray2array( x ) );

var alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
'dtype': 'complex128'
});
var alpha = new Complex128Tensor0D( 2.0, 0.0 );

var out = zscal( [ x, alpha ] );
console.log( ndarray2array( out ) );
7 changes: 2 additions & 5 deletions lib/node_modules/@stdlib/blas/base/ndarray/zscal/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@
*
* @example
* var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
* var Complex128Tensor0D = require( '@stdlib/ndarray/tensor0d/complex128' );
* var zscal = require( '@stdlib/blas/base/ndarray/zscal' );
*
* var x = new Complex128Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
*
* var alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
* 'dtype': 'complex128'
* });
* var alpha = new Complex128Tensor0D( 2.0, 0.0 );
*
* var y = zscal( [ x, alpha ] );
* // returns <ndarray>[ <Complex128>[ 2.0, 4.0 ], <Complex128>[ 6.0, 8.0 ], <Complex128>[ 10.0, 12.0 ] ]
Expand Down
7 changes: 2 additions & 5 deletions lib/node_modules/@stdlib/blas/base/ndarray/zscal/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,11 @@ var strided = require( '@stdlib/blas/base/zscal' ).ndarray;
*
* @example
* var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
* var Complex128Tensor0D = require( '@stdlib/ndarray/tensor0d/complex128' );
*
* var x = new Complex128Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
*
* var alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
* 'dtype': 'complex128'
* });
* var alpha = new Complex128Tensor0D( 2.0, 0.0 );
*
* var y = zscal( [ x, alpha ] );
* // returns <ndarray>[ <Complex128>[ 2.0, 4.0 ], <Complex128>[ 6.0, 8.0 ], <Complex128>[ 10.0, 12.0 ] ]
Expand Down
27 changes: 7 additions & 20 deletions lib/node_modules/@stdlib/blas/base/ndarray/zscal/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
var tape = require( 'tape' );
var isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' );
var Complex128Array = require( '@stdlib/array/complex128' );
var Complex128 = require( '@stdlib/complex/float64/ctor' );
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
var Complex128Tensor0D = require( '@stdlib/ndarray/tensor0d/complex128' );
var ndarray = require( '@stdlib/ndarray/base/ctor' );
var getData = require( '@stdlib/ndarray/data-buffer' );
var zscal = require( './../lib' );
Expand Down Expand Up @@ -76,9 +75,7 @@ tape( 'the function multiplies a one-dimensional ndarray by a scalar constant',
6.0 // 3
]);
x = vector( xbuf, 3, 1, 0 );
alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
'dtype': 'complex128'
});
alpha = new Complex128Tensor0D( 2.0, 0.0 );

v = zscal( [ x, alpha ] );

Expand All @@ -100,9 +97,7 @@ tape( 'the function multiplies a one-dimensional ndarray by a scalar constant',
4.0 // 2
]);
x = vector( xbuf, 2, 1, 0 );
alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
'dtype': 'complex128'
});
alpha = new Complex128Tensor0D( 2.0, 0.0 );

v = zscal( [ x, alpha ] );

Expand All @@ -127,9 +122,7 @@ tape( 'if provided an empty ndarray, the function returns the input ndarray unch

xbuf = new Complex128Array( [] );
x = vector( xbuf, 0, 1, 0 );
alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
'dtype': 'complex128'
});
alpha = new Complex128Tensor0D( 2.0, 0.0 );

v = zscal( [ x, alpha ] );

Expand Down Expand Up @@ -160,9 +153,7 @@ tape( 'the function supports one-dimensional ndarrays having non-unit strides',
6.0 // 2
]);
x = vector( xbuf, 3, 2, 0 );
alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
'dtype': 'complex128'
});
alpha = new Complex128Tensor0D( 2.0, 0.0 );

v = zscal( [ x, alpha ] );

Expand Down Expand Up @@ -203,9 +194,7 @@ tape( 'the function supports one-dimensional ndarrays having negative strides',
6.0 // 0
]);
x = vector( xbuf, 3, -2, 4 );
alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
'dtype': 'complex128'
});
alpha = new Complex128Tensor0D( 2.0, 0.0 );

v = zscal( [ x, alpha ] );

Expand Down Expand Up @@ -252,9 +241,7 @@ tape( 'the function supports one-dimensional ndarrays having non-zero offsets',
8.0 // 3
]);
x = vector( xbuf, 4, 2, 1 );
alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
'dtype': 'complex128'
});
alpha = new Complex128Tensor0D( 2.0, 0.0 );

v = zscal( [ x, alpha ] );

Expand Down