Gathering detailed insights and metrics for @stdlib/strided-base-reinterpret-complex128
Gathering detailed insights and metrics for @stdlib/strided-base-reinterpret-complex128
Gathering detailed insights and metrics for @stdlib/strided-base-reinterpret-complex128
Gathering detailed insights and metrics for @stdlib/strided-base-reinterpret-complex128
Reinterpret a Complex128Array as a Float64Array.
npm install @stdlib/strided-base-reinterpret-complex128
Typescript
Module System
Min. Node Version
Node Version
NPM Version
95.3
Supply Chain
95.5
Quality
81.4
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
8,666,665
Last Day
1,300
Last Week
18,036
Last Month
77,287
Last Year
960,294
Apache-2.0 License
1 Stars
53 Commits
3 Watchers
5 Branches
14 Contributors
Updated on May 26, 2025
Minified
Minified + Gzipped
Latest Version
0.2.2
Package Id
@stdlib/strided-base-reinterpret-complex128@0.2.2
Unpacked Size
27.48 kB
Size
7.91 kB
File Count
11
NPM Version
8.19.4
Node Version
16.20.2
Published on
Jul 27, 2024
Cumulative downloads
Total Downloads
Last Day
-22.1%
1,300
Compared to previous day
Last Week
-11.8%
18,036
Compared to previous week
Last Month
-6.4%
77,287
Compared to previous month
Last Year
-86%
960,294
Compared to previous year
1
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
Reinterpret a
Complex128Array
as aFloat64Array
.
1npm install @stdlib/strided-base-reinterpret-complex128
1var reinterpret = require( '@stdlib/strided-base-reinterpret-complex128' );
Returns a Float64Array
view of a Complex128Array
.
1var Complex128Array = require( '@stdlib/array-complex128' ); 2 3var x = new Complex128Array( 10 ); 4 5var view = reinterpret( x, 0 ); 6// returns <Float64Array> 7 8var bool = ( view.buffer === x.buffer ); 9// returns true 10 11var len = view.length; 12// returns 20
The offset
argument specifies the starting index of the returned Float64Array
view relative to the Complex128Array
.
1var Complex128Array = require( '@stdlib/array-complex128' ); 2 3var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); 4 5var view = reinterpret( x, 2 ); 6// returns <Float64Array> 7 8var len = view.length; 9// returns 4 10 11var re = view[ 0 ]; 12// returns 5.0 13 14var im = view[ 1 ]; 15// returns 6.0
1var Complex128Array = require( '@stdlib/array-complex128' ); 2var real = require( '@stdlib/complex-float64-real' ); 3var imag = require( '@stdlib/complex-float64-imag' ); 4var reinterpret = require( '@stdlib/strided-base-reinterpret-complex128' ); 5 6// Define a complex number array: 7var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); 8// returns <Complex128Array> 9 10// Reinterpret as a `float64` array: 11var view = reinterpret( x, 0 ); 12// returns <Float64Array> 13 14// Set view elements: 15view[ 0 ] = 9.0; 16view[ 1 ] = 10.0; 17 18// Get the first element of the complex number array: 19var z = x.get( 0 ); 20// returns <Complex128> 21 22var re = real( z ); 23// returns 9.0 24 25var im = imag( z ); 26// returns 10.0
@stdlib/strided-base/reinterpret-complex
: reinterpret a complex-valued floating-point array as a real-valued floating-point array having the same precision.@stdlib/strided-base/reinterpret-complex64
: reinterpret a Complex64Array as a Float32Array.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.
See LICENSE.
Copyright © 2016-2024. The Stdlib Authors.
No vulnerabilities found.
No security vulnerabilities found.