8000 GitHub - stdlib-js/complex-float64-base-scale at deno
[go: up one dir, main page]

Skip to content

Scale a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant.

License

Notifications You must be signed in to change notification settings

stdlib-js/complex-float64-base-scale

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About stdlib...

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!

scale

NPM version Build Status Coverage Status

Scale a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant.

Usage

import scale from 'https://cdn.jsdelivr.net/gh/stdlib-js/complex-float64-base-scale@deno/mod.js';

You can also import the following named exports from the package:

import { assign, strided } from 'https://cdn.jsdelivr.net/gh/stdlib-js/complex-float64-base-scale@deno/mod.js';

scale( alpha, z )

Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant.

import Complex128 from 'https://cdn.jsdelivr.net/gh/stdlib-js/complex-float64-ctor@deno/mod.js';

var z = new Complex128( 5.0, 3.0 );

var v = scale( 5.0, z );
// returns <Complex128>[ 25.0, 15.0 ]

The function supports the following parameters:

scale.assign( alpha, re1, im1, out, strideOut, offsetOut )

Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant and assigns results to a provided output array.

import Float64Array from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-float64@deno/mod.js';

var out = new Float64Array( 2 );
var v = scale.assign( 5.0, 5.0, 3.0, out, 1, 0 );
// returns <Float64Array>[ 25.0, 15.0 ]

var bool = ( out === v );
// returns true

The function supports the following parameters:

  • alpha: real-valued scalar constant.
  • re: real component of the complex number.
  • im: imaginary component of the complex number.
  • out: output array.
  • strideOut: stride length for out.
  • offsetOut: starting index for out.

scale.strided( alpha, z, sz, oz, out, so, oo )

Scales a double-precision complex floating-point number stored in a real-valued strided array view by a real-valued double-precision floating-point scalar constant and assigns results to a provided strided output array.

import Float64Array from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-float64@deno/mod.js';

var z = new Float64Array( [ 5.0, 3.0 ] );
var out = new Float64Array( 2 );

var v = scale.strided( 5.0, z, 1, 0, out, 1, 0 );
// returns <Float64Array>[ 25.0, 15.0 ]

var bool = ( out === v );
// returns true

The function supports the following parameters:

  • alpha: real-valued scalar constant.
  • z: complex number strided array view.
  • sz: stride length for z.
  • oz: starting index for z.
  • out: output array.
  • so: stride length for out.
  • oo: starting index for out.

Examples

import Complex128Array from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-complex128@deno/mod.js';
import discreteUniform from 'https://cdn.jsdelivr.net/gh/stdlib-js/random-array-discrete-uniform@deno/mod.js';
import logEachMap from 'https://cdn.jsdelivr.net/gh/stdlib-js/console-log-each-map@deno/mod.js';
import scale from 'https://cdn.jsdelivr.net/gh/stdlib-js/complex-float64-base-scale@deno/mod.js';

// Generate an array of random values:
var values = new Complex128Array( discreteUniform( 200, -50, 50 ) );

// Scale each by a scalar constant:
logEachMap( '%0.1f * (%s) = %s', 5.0, values, scale );

Notice

This package is part of stdlib, a standard library 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-2025. The Stdlib Authors.

About

Scale a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0