@stdlib/array-complex128
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Complex128Array

NPM version Build Status Coverage Status dependencies

128-bit complex number array.

Installation

npm install @stdlib/array-complex128

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

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2021. The Stdlib Authors.

Package Sidebar

Install

npm i @stdlib/array-complex128@0.0.3

Homepage

stdlib.io

Version

0.0.3

License

Apache-2.0

Unpacked Size

87.8 kB

Total Files

12

Last publish

Collaborators

  • stdlib-bot
  • kgryte
  • planeshifter
  • rreusser