time-to-botec/js/node_modules/@stdlib/array/complex128
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs/types feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

Complex128Array

128-bit complex number array.

Usage

var Complex128Array = require( '@stdlib/array/complex128' );

Complex128Array()

Creates a 128-bit complex number array.

var arr = new Complex128Array();
// returns <Complex128Array>

Examples

var Complex128 = require( '@stdlib/complex/float64' );
var Float64Array = require( '@stdlib/array/float64' );
var Complex128Array = require( '@stdlib/array/complex128' );

var arr;
var out;

// Create a complex array by specifying a length:
out = new Complex128Array( 3 );
console.log( out );

// Create a complex array from an array of complex numbers:
arr = [
    new Complex128( 1.0, -1.0 ),
    new Complex128( -3.14, 3.14 ),
    new Complex128( 0.5, 0.5 )
];
out = new Complex128Array( arr );
console.log( out );

// Create a complex array from an interleaved typed array:
arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] );
out = new Complex128Array( arr );
console.log( out );

// Create a complex array from an array buffer:
arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] );
out = new Complex128Array( arr.buffer );
console.log( out );

// Create a complex array from an array buffer view:
arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] );
out = new Complex128Array( arr.buffer, 16, 2 );
console.log( out );