Gathering detailed insights and metrics for @stdlib/strided-base-reinterpret-complex64
Gathering detailed insights and metrics for @stdlib/strided-base-reinterpret-complex64
Gathering detailed insights and metrics for @stdlib/strided-base-reinterpret-complex64
Gathering detailed insights and metrics for @stdlib/strided-base-reinterpret-complex64
Reinterpret a Complex64Array as a Float32Array.
npm install @stdlib/strided-base-reinterpret-complex64
Typescript
Module System
Min. Node Version
Node Version
NPM Version
95.2
Supply Chain
95
Quality
81.3
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
8,667,267
Last Day
1,304
Last Week
18,051
Last Month
77,356
Last Year
960,657
Apache-2.0 License
1 Stars
48 Commits
3 Watchers
5 Branches
14 Contributors
Updated on May 26, 2025
Minified
Minified + Gzipped
Latest Version
0.2.1
Package Id
@stdlib/strided-base-reinterpret-complex64@0.2.1
Unpacked Size
26.58 kB
Size
7.74 kB
File Count
11
NPM Version
8.19.4
Node Version
16.20.2
Published on
Jul 27, 2024
Cumulative downloads
Total Downloads
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
Complex64Array
as aFloat32Array
.
1npm install @stdlib/strided-base-reinterpret-complex64
1var reinterpret = require( '@stdlib/strided-base-reinterpret-complex64' );
Returns a Float32Array
view of a Complex64Array
.
1var Complex64Array = require( '@stdlib/array-complex64' ); 2 3var x = new Complex64Array( 10 ); 4 5var view = reinterpret( x, 0 ); 6// returns <Float32Array> 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 Float32Array
view relative to the Complex64Array
.
1var Complex64Array = require( '@stdlib/array-complex64' ); 2 3var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); 4 5var view = reinterpret( x, 2 ); 6// returns <Float32Array> 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 Complex64Array = require( '@stdlib/array-complex64' ); 2var real = require( '@stdlib/complex-float64-real' ); 3var imag = require( '@stdlib/complex-float64-imag' ); 4var reinterpret = require( '@stdlib/strided-base-reinterpret-complex64' ); 5 6// Define a complex number array: 7var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); 8// returns <Complex64Array> 9 10// Reinterpret as a `float32` array: 11var view = reinterpret( x, 0 ); 12// returns <Float32Array> 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 <Complex64> 21 22var re = real( z ); 23// returns 9.0 24 25var im = imag( z ); 26// returns 10.0
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.
Last Day
-21.7%
1,304
Compared to previous day
Last Week
-11.8%
18,051
Compared to previous week
Last Month
-6.4%
77,356
Compared to previous month
Last Year
-85.9%
960,657
Compared to previous year