Skip to content
Merged
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/cscal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,11 @@ Multiplies a one-dimensional single-precision complex floating-point ndarray by

```javascript
var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
var Complex64Tensor0D = require( '@stdlib/ndarray/tensor0d/complex64' );

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

var alpha = scalar2ndarray( new Complex64( 2.0, 0.0 ), {
'dtype': 'complex64'
});
var alpha = new Complex64Tensor0D( 2.0, 0.0 );

var y = cscal( [ x, alpha ] );
// returns <ndarray>[ <Complex64>[ 2.0, 4.0 ], <Complex64>[ 6.0, 8.0 ], <Complex64>[ 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 Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
var Complex64Tensor0D = require( '@stdlib/ndarray/tensor0d/complex64' );
var ndarray2array = require( '@stdlib/ndarray/to-array' );
var cscal = require( '@stdlib/blas/base/ndarray/cscal' );

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

var alpha = scalar2ndarray( new Complex64( 2.0, 0.0 ), {
'dtype': 'complex64'
});
var alpha = new Complex64Tensor0D( 2.0, 0.0 );

var out = cscal( [ 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 isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var realf = require( '@stdlib/complex/float32/real' );
var pow = require( '@stdlib/math/base/special/pow' );
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
var Complex64Tensor0D = require( '@stdlib/ndarray/tensor0d/complex64' );
var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var format = require( '@stdlib/string/format' );
var pkg = require( './../package.json' ).name;
var cscal = require( './../lib' );


// VARIABLES //

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


// FUNCTIONS //

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

alpha = scalar2ndarray( new Complex64( 0.8, 0.6 ), options );
alpha = new Complex64Tensor0D( 0.8, 0.6 );

return benchmark;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
Examples
--------
> var x = new {{alias:@stdlib/ndarray/vector/complex64}}( [ 4.0, 2.0, -3.0, 5.0 ] );
> var ca = new {{alias:@stdlib/complex/float32/ctor}}( 2.0, 0.0 );
> var alpha = {{alias:@stdlib/ndarray/from-scalar}}( ca, { 'dtype': 'complex64' } );
> var alpha = new {{alias:@stdlib/ndarray/tensor0d/complex64}}( 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 { complex64ndarray } from '@stdlib/types/ndarray';
*
* @example
* var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
* var Complex64Tensor0D = require( '@stdlib/ndarray/tensor0d/complex64' );
*
* var x = new Complex64Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
*
* var alpha = scalar2ndarray( new Complex64( 2.0, 0.0 ), {
* 'dtype': 'complex64'
* });
* var alpha = new Complex64Tensor0D( 2.0, 0.0 );
*
* var y = cscal( [ x, alpha ] );
* // returns <ndarray>[ <Complex64>[ 2.0, 4.0 ], <Complex64>[ 6.0, 8.0 ], <Complex64>[ 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 Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
var Complex64Tensor0D = require( '@stdlib/ndarray/tensor0d/complex64' );
var ndarray2array = require( '@stdlib/ndarray/to-array' );
var cscal = require( './../lib' );

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

var alpha = scalar2ndarray( new Complex64( 2.0, 0.0 ), {
'dtype': 'complex64'
});
var alpha = new Complex64Tensor0D( 2.0, 0.0 );

var out = cscal( [ x, alpha ] );
console.log( ndarray2array( out ) );
7 changes: 2 additions & 5 deletions lib/node_modules/@stdlib/blas/base/ndarray/cscal/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@
*
* @example
* var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
* var Complex64Tensor0D = require( '@stdlib/ndarray/tensor0d/complex64' );
* var cscal = require( '@stdlib/blas/base/ndarray/cscal' );
*
* var x = new Complex64Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
*
* var alpha = scalar2ndarray( new Complex64( 2.0, 0.0 ), {
* 'dtype': 'complex64'
* });
* var alpha = new Complex64Tensor0D( 2.0, 0.0 );
*
* var y = cscal( [ x, alpha ] );
* // returns <ndarray>[ <Complex64>[ 2.0, 4.0 ], <Complex64>[ 6.0, 8.0 ], <Complex64>[ 10.0, 12.0 ] ]
Expand Down
7 changes: 2 additions & 5 deletions lib/node_modules/@stdlib/blas/base/ndarray/cscal/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/cscal' ).ndarray;
*
* @example
* var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
* var Complex64Tensor0D = require( '@stdlib/ndarray/tensor0d/complex64' );
*
* var x = new Complex64Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
*
* var alpha = scalar2ndarray( new Complex64( 2.0, 0.0 ), {
* 'dtype': 'complex64'
* });
* var alpha = new Complex64Tensor0D( 2.0, 0.0 );
*
* var y = cscal( [ x, alpha ] );
* // returns <ndarray>[ <Complex64>[ 2.0, 4.0 ], <Complex64>[ 6.0, 8.0 ], <Complex64>[ 10.0, 12.0 ] ]
Expand Down
27 changes: 7 additions & 20 deletions lib/node_modules/@stdlib/blas/base/ndarray/cscal/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
var tape = require( 'tape' );
var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' );
var Complex64Array = require( '@stdlib/array/complex64' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
var Complex64Tensor0D = require( '@stdlib/ndarray/tensor0d/complex64' );
var ndarray = require( '@stdlib/ndarray/base/ctor' );
var getData = require( '@stdlib/ndarray/data-buffer' );
var cscal = 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 Complex64( 2.0, 0.0 ), {
'dtype': 'complex64'
});
alpha = new Complex64Tensor0D( 2.0, 0.0 );

v = cscal( [ 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 Complex64( 2.0, 0.0 ), {
'dtype': 'complex64'
});
alpha = new Complex64Tensor0D( 2.0, 0.0 );

v = cscal( [ x, alpha ] );

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

xbuf = new Complex64Array( [] );
x = vector( xbuf, 0, 1, 0 );
alpha = scalar2ndarray( new Complex64( 2.0, 0.0 ), {
'dtype': 'complex64'
});
alpha = new Complex64Tensor0D( 2.0, 0.0 );

v = cscal( [ 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 Complex64( 2.0, 0.0 ), {
'dtype': 'complex64'
});
alpha = new Complex64Tensor0D( 2.0, 0.0 );

v = cscal( [ 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 Complex64( 2.0, 0.0 ), {
'dtype': 'complex64'
});
alpha = new Complex64Tensor0D( 2.0, 0.0 );

v = cscal( [ 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 Complex64( 2.0, 0.0 ), {
'dtype': 'complex64'
});
alpha = new Complex64Tensor0D( 2.0, 0.0 );

v = cscal( [ x, alpha ] );

Expand Down