@stdlib/math-base-ops-cmul
Advanced tools
Comparing version 0.0.7 to 0.1.0
@@ -19,7 +19,7 @@ /* | ||
// TypeScript Version: 2.0 | ||
// TypeScript Version: 4.1 | ||
/// <reference types="@stdlib/types"/> | ||
import { Complex128 } from '@stdlib/types/object'; | ||
import { Complex128 } from '@stdlib/types/complex'; | ||
@@ -26,0 +26,0 @@ /** |
@@ -23,2 +23,3 @@ /** | ||
var Complex128 = require( '@stdlib/complex-float64' ); | ||
var real = require( '@stdlib/complex-real' ); | ||
@@ -64,3 +65,3 @@ var imag = require( '@stdlib/complex-imag' ); | ||
var im = (re1*im2) + (im1*re2); | ||
return new z1.constructor( re, im ); | ||
return new Complex128( re, im ); | ||
} | ||
@@ -67,0 +68,0 @@ |
{ | ||
"options": {}, | ||
"fields": [ | ||
{ | ||
"field": "src", | ||
"resolve": true, | ||
"relative": true | ||
}, | ||
{ | ||
"field": "include", | ||
"resolve": true, | ||
"relative": true | ||
}, | ||
{ | ||
"field": "libraries", | ||
"resolve": false, | ||
"relative": false | ||
}, | ||
{ | ||
"field": "libpath", | ||
"resolve": true, | ||
"relative": false | ||
} | ||
], | ||
"confs": [ | ||
{ | ||
"src": [ | ||
"./src/main.c" | ||
], | ||
"include": [ | ||
"./include" | ||
], | ||
"libraries": [], | ||
"libpath": [], | ||
"dependencies": [] | ||
} | ||
] | ||
"options": { | ||
"task": "build" | ||
}, | ||
"fields": [ | ||
{ | ||
"field": "src", | ||
"resolve": true, | ||
"relative": true | ||
}, | ||
{ | ||
"field": "include", | ||
"resolve": true, | ||
"relative": true | ||
}, | ||
{ | ||
"field": "libraries", | ||
"resolve": false, | ||
"relative": false | ||
}, | ||
{ | ||
"field": "libpath", | ||
"resolve": true, | ||
"relative": false | ||
} | ||
], | ||
"confs": [ | ||
{ | ||
"task": "build", | ||
"src": [ | ||
"./src/main.c" | ||
], | ||
"include": [ | ||
"./include" | ||
], | ||
"libraries": [], | ||
"libpath": [], | ||
"dependencies": [ | ||
"@stdlib/math-base-napi-binary", | ||
"@stdlib/complex-float64", | ||
"@stdlib/complex-reim" | ||
] | ||
}, | ||
{ | ||
"task": "benchmark", | ||
"src": [ | ||
"./src/main.c" | ||
], | ||
"include": [ | ||
"./include" | ||
], | ||
"libraries": [], | ||
"libpath": [], | ||
"dependencies": [ | ||
"@stdlib/complex-float64", | ||
"@stdlib/complex-reim" | ||
] | ||
}, | ||
{ | ||
"task": "examples", | ||
"src": [ | ||
"./src/main.c" | ||
], | ||
"include": [ | ||
"./include" | ||
], | ||
"libraries": [], | ||
"libpath": [], | ||
"dependencies": [ | ||
"@stdlib/complex-float64", | ||
"@stdlib/complex-reim" | ||
] | ||
} | ||
] | ||
} |
{ | ||
"name": "@stdlib/math-base-ops-cmul", | ||
"version": "0.0.7", | ||
"version": "0.1.0", | ||
"description": "Multiply two double-precision complex floating-point numbers.", | ||
@@ -17,2 +17,3 @@ "license": "Apache-2.0", | ||
"main": "./lib", | ||
"gypfile": false, | ||
"directories": { | ||
@@ -22,3 +23,5 @@ "benchmark": "./benchmark", | ||
"example": "./examples", | ||
"include": "./include", | ||
"lib": "./lib", | ||
"src": "./src", | ||
"test": "./test" | ||
@@ -42,16 +45,19 @@ }, | ||
"dependencies": { | ||
"@stdlib/complex-imag": "^0.0.x", | ||
"@stdlib/complex-real": "^0.0.x", | ||
"@stdlib/types": "^0.0.x", | ||
"@stdlib/utils-library-manifest": "^0.0.x" | ||
"@stdlib/complex-float64": "^0.1.0", | ||
"@stdlib/complex-imag": "^0.1.0", | ||
"@stdlib/complex-real": "^0.1.0", | ||
"@stdlib/complex-reim": "^0.1.0", | ||
"@stdlib/math-base-napi-binary": "^0.1.0", | ||
"@stdlib/types": "^0.1.0", | ||
"@stdlib/utils-library-manifest": "^0.1.0" | ||
}, | ||
"devDependencies": { | ||
"@stdlib/bench": "^0.0.x", | ||
"@stdlib/complex-float64": "^0.0.x", | ||
"@stdlib/math-base-assert-is-nan": "^0.0.x", | ||
"@stdlib/random-base-discrete-uniform": "^0.0.x", | ||
"@stdlib/random-base-uniform": "^0.0.x", | ||
"@stdlib/bench": "^0.1.0", | ||
"@stdlib/math-base-assert-is-nan": "^0.1.0", | ||
"@stdlib/random-base-discrete-uniform": "^0.0.6", | ||
"@stdlib/random-base-uniform": "^0.0.6", | ||
"@stdlib/utils-try-require": "^0.1.0", | ||
"tape": "git+https://github.com/kgryte/tape.git#fix/globby", | ||
"istanbul": "^0.4.1", | ||
"tap-spec": "5.x.x" | ||
"tap-min": "git+https://github.com/Planeshifter/tap-min.git" | ||
}, | ||
@@ -89,5 +95,5 @@ "engines": { | ||
"funding": { | ||
"type": "patreon", | ||
"url": "https://www.patreon.com/athan" | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/stdlib" | ||
} | ||
} |
@@ -21,2 +21,13 @@ <!-- | ||
<details> | ||
<summary> | ||
About stdlib... | ||
</summary> | ||
<p>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.</p> | ||
<p>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.</p> | ||
<p>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.</p> | ||
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p> | ||
</details> | ||
# cmul | ||
@@ -139,9 +150,16 @@ | ||
```c | ||
#include <complex.h> | ||
#include "stdlib/complex/float64.h" | ||
#include "stdlib/complex/real.h" | ||
#include "stdlib/complex/imag.h" | ||
double complex z1 = 5.0 + 3.0*I; | ||
double complex z2 = -2.0 + 1.0*I; | ||
stdlib_complex128_t z1 = stdlib_complex128( 5.0, 3.0 ); | ||
stdlib_complex128_t z2 = stdlib_complex128( -2.0, 1.0 ); | ||
double complex out = stdlib_base_cmul( z1, z2 ); | ||
// returns -13.0-1.0*I | ||
stdlib_complex128_t out = stdlib_base_cmul( z1, z2 ); | ||
double re = stdlib_real( out ); | ||
// returns -13.0 | ||
double im = stdlib_imag( out ); | ||
// returns -1.0 | ||
``` | ||
@@ -151,7 +169,7 @@ | ||
- **z1**: `[in] double complex` input value. | ||
- **z2**: `[in] double complex` input value. | ||
- **z1**: `[in] stdlib_complex128_t` input value. | ||
- **z2**: `[in] stdlib_complex128_t` input value. | ||
```c | ||
double complex stdlib_base_cmul( const double complex z1, const double complex z2 ); | ||
stdlib_complex128_t stdlib_base_cmul( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); | ||
``` | ||
@@ -179,15 +197,27 @@ | ||
#include "stdlib/math/base/ops/cmul.h" | ||
#include "stdlib/complex/float64.h" | ||
#include "stdlib/complex/reim.h" | ||
#include <stdio.h> | ||
#include <complex.h> | ||
int main() { | ||
double complex x[] = { 3.14+1.5*I, -3.14-1.5*I, 0.0+0.0*I, 0.0/0.0+0.0/0.0*I }; | ||
int main( void ) { | ||
const stdlib_complex128_t x[] = { | ||
stdlib_complex128( 3.14, 1.5 ), | ||
stdlib_complex128( -3.14, 1.5 ), | ||
stdlib_complex128( 0.0, -0.0 ), | ||
stdlib_complex128( 0.0/0.0, 0.0/0.0 ) | ||
}; | ||
double complex v; | ||
double complex y; | ||
stdlib_complex128_t v; | ||
stdlib_complex128_t y; | ||
double re; | ||
double im; | ||
int i; | ||
for ( i = 0; i < 4; i++ ) { | ||
v = x[ i ]; | ||
stdlib_reim( v, &re, &im ); | ||
printf( "z = %lf + %lfi\n", re, im ); | ||
y = stdlib_base_cmul( v, v ); | ||
printf( "z = %lf + %lfi\ncmul(z, z) = %lf + %lfi\n", creal( v ), cimag( v ), creal( y ), cimag( y ) ); | ||
stdlib_reim( y, &re, &im ); | ||
printf( "cmul(z, z) = %lf + %lfi\n", re, im ); | ||
} | ||
@@ -239,3 +269,3 @@ } | ||
Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors]. | ||
Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors]. | ||
@@ -253,4 +283,4 @@ </section> | ||
[test-image]: https://github.com/stdlib-js/math-base-ops-cmul/actions/workflows/test.yml/badge.svg | ||
[test-url]: https://github.com/stdlib-js/math-base-ops-cmul/actions/workflows/test.yml | ||
[test-image]: https://github.com/stdlib-js/math-base-ops-cmul/actions/workflows/test.yml/badge.svg?branch=v0.1.0 | ||
[test-url]: https://github.com/stdlib-js/math-base-ops-cmul/actions/workflows/test.yml?query=branch:v0.1.0 | ||
@@ -267,2 +297,9 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-ops-cmul/main.svg | ||
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg | ||
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im | ||
[stdlib]: https://github.com/stdlib-js/stdlib | ||
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors | ||
[umd]: https://github.com/umdjs/umd | ||
@@ -274,10 +311,4 @@ [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules | ||
[esm-url]: https://github.com/stdlib-js/math-base-ops-cmul/tree/esm | ||
[branches-url]: https://github.com/stdlib-js/math-base-ops-cmul/blob/main/branches.md | ||
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg | ||
[chat-url]: https://gitter.im/stdlib-js/stdlib/ | ||
[stdlib]: https://github.com/stdlib-js/stdlib | ||
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors | ||
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/math-base-ops-cmul/main/LICENSE | ||
@@ -284,0 +315,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
17
297
311
0
38786
7
+ Added@stdlib/complex-reim@^0.1.0
+ Added@stdlib/array-float32@0.1.1(transitive)
+ Added@stdlib/array-float64@0.1.1(transitive)
+ Added@stdlib/assert-has-float32array-support@0.1.1(transitive)
+ Added@stdlib/assert-has-float64array-support@0.1.1(transitive)
+ Added@stdlib/assert-has-own-property@0.1.1(transitive)
+ Added@stdlib/assert-has-symbol-support@0.1.1(transitive)
+ Added@stdlib/assert-has-tostringtag-support@0.1.1(transitive)
+ Added@stdlib/assert-is-array@0.1.1(transitive)
+ Added@stdlib/assert-is-boolean@0.1.1(transitive)
+ Added@stdlib/assert-is-buffer@0.1.1(transitive)
+ Added@stdlib/assert-is-float32array@0.1.1(transitive)
+ Added@stdlib/assert-is-float64array@0.1.1(transitive)
+ Added@stdlib/assert-is-function@0.1.1(transitive)
+ Added@stdlib/assert-is-number@0.1.1(transitive)
+ Added@stdlib/assert-is-object@0.1.1(transitive)
+ Added@stdlib/assert-is-object-like@0.1.1(transitive)
+ Added@stdlib/assert-is-plain-object@0.1.1(transitive)
+ Added@stdlib/assert-is-regexp@0.1.1(transitive)
+ Added@stdlib/assert-is-string@0.1.1(transitive)
+ Added@stdlib/assert-tools-array-function@0.1.1(transitive)
+ Added@stdlib/boolean-ctor@0.1.1(transitive)
+ Added@stdlib/complex-float32@0.1.1(transitive)
+ Added@stdlib/complex-float64@0.1.1(transitive)
+ Added@stdlib/complex-imag@0.1.1(transitive)
+ Added@stdlib/complex-real@0.1.1(transitive)
+ Added@stdlib/complex-reim@0.1.1(transitive)
+ Added@stdlib/complex-reimf@0.1.1(transitive)
+ Added@stdlib/constants-float64-pinf@0.1.1(transitive)
+ Added@stdlib/error-tools-fmtprodmsg@0.1.1(transitive)
+ Added@stdlib/fs-exists@0.1.1(transitive)
+ Added@stdlib/fs-resolve-parent-path@0.1.1(transitive)
+ Added@stdlib/math-base-napi-binary@0.1.0(transitive)
+ Added@stdlib/number-ctor@0.1.1(transitive)
+ Added@stdlib/number-float64-base-to-float32@0.1.1(transitive)
+ Added@stdlib/object-ctor@0.1.1(transitive)
+ Added@stdlib/process-cwd@0.1.1(transitive)
+ Added@stdlib/regexp-extended-length-path@0.1.1(transitive)
+ Added@stdlib/regexp-function-name@0.1.1(transitive)
+ Added@stdlib/string-base-format-interpolate@0.1.1(transitive)
+ Added@stdlib/string-base-format-tokenize@0.1.1(transitive)
+ Added@stdlib/string-base-lowercase@0.2.1(transitive)
+ Added@stdlib/string-base-replace@0.1.1(transitive)
+ Added@stdlib/string-format@0.1.1(transitive)
+ Added@stdlib/string-replace@0.1.1(transitive)
+ Added@stdlib/symbol-ctor@0.1.1(transitive)
+ Added@stdlib/types@0.1.0(transitive)
+ Added@stdlib/utils-constructor-name@0.1.1(transitive)
+ Added@stdlib/utils-convert-path@0.1.1(transitive)
+ Added@stdlib/utils-define-nonenumerable-read-only-property@0.1.1(transitive)
+ Added@stdlib/utils-define-property@0.1.1(transitive)
+ Added@stdlib/utils-escape-regexp-string@0.1.1(transitive)
+ Added@stdlib/utils-get-prototype-of@0.1.1(transitive)
+ Added@stdlib/utils-global@0.1.1(transitive)
+ Added@stdlib/utils-library-manifest@0.1.1(transitive)
+ Added@stdlib/utils-native-class@0.1.1(transitive)
+ Added@stdlib/utils-type-of@0.1.2(transitive)
- Removed@stdlib/array-float32@0.0.6(transitive)
- Removed@stdlib/assert-has-float32array-support@0.0.8(transitive)
- Removed@stdlib/assert-has-node-buffer-support@0.0.8(transitive)
- Removed@stdlib/assert-has-own-property@0.0.7(transitive)
- Removed@stdlib/assert-has-symbol-support@0.0.8(transitive)
- Removed@stdlib/assert-has-tostringtag-support@0.0.9(transitive)
- Removed@stdlib/assert-is-array@0.0.7(transitive)
- Removed@stdlib/assert-is-boolean@0.0.8(transitive)
- Removed@stdlib/assert-is-buffer@0.0.8(transitive)
- Removed@stdlib/assert-is-float32array@0.0.8(transitive)
- Removed@stdlib/assert-is-function@0.0.8(transitive)
- Removed@stdlib/assert-is-number@0.0.7(transitive)
- Removed@stdlib/assert-is-object@0.0.8(transitive)
- Removed@stdlib/assert-is-object-like@0.0.8(transitive)
- Removed@stdlib/assert-is-plain-object@0.0.7(transitive)
- Removed@stdlib/assert-is-regexp@0.0.7(transitive)
- Removed@stdlib/assert-is-regexp-string@0.0.9(transitive)
- Removed@stdlib/assert-is-string@0.0.8(transitive)
- Removed@stdlib/assert-tools-array-function@0.0.7(transitive)
- Removed@stdlib/buffer-ctor@0.0.7(transitive)
- Removed@stdlib/buffer-from-string@0.0.8(transitive)
- Removed@stdlib/cli-ctor@0.0.3(transitive)
- Removed@stdlib/complex-float32@0.0.7(transitive)
- Removed@stdlib/complex-float64@0.0.8(transitive)
- Removed@stdlib/complex-imag@0.0.7(transitive)
- Removed@stdlib/complex-real@0.0.7(transitive)
- Removed@stdlib/constants-float64-pinf@0.0.8(transitive)
- Removed@stdlib/fs-exists@0.0.8(transitive)
- Removed@stdlib/fs-read-file@0.0.8(transitive)
- Removed@stdlib/fs-resolve-parent-path@0.0.8(transitive)
- Removed@stdlib/number-ctor@0.0.7(transitive)
- Removed@stdlib/number-float64-base-to-float32@0.0.7(transitive)
- Removed@stdlib/process-cwd@0.0.8(transitive)
- Removed@stdlib/process-read-stdin@0.0.7(transitive)
- Removed@stdlib/regexp-eol@0.0.7(transitive)
- Removed@stdlib/regexp-extended-length-path@0.0.7(transitive)
- Removed@stdlib/regexp-function-name@0.0.7(transitive)
- Removed@stdlib/regexp-regexp@0.0.8(transitive)
- Removed@stdlib/streams-node-stdin@0.0.7(transitive)
- Removed@stdlib/string-base-format-interpolate@0.0.4(transitive)
- Removed@stdlib/string-base-format-tokenize@0.0.4(transitive)
- Removed@stdlib/string-format@0.0.3(transitive)
- Removed@stdlib/string-lowercase@0.0.9(transitive)
- Removed@stdlib/string-replace@0.0.11(transitive)
- Removed@stdlib/types@0.0.14(transitive)
- Removed@stdlib/utils-constructor-name@0.0.8(transitive)
- Removed@stdlib/utils-convert-path@0.0.8(transitive)
- Removed@stdlib/utils-define-nonenumerable-read-only-property@0.0.7(transitive)
- Removed@stdlib/utils-define-property@0.0.9(transitive)
- Removed@stdlib/utils-escape-regexp-string@0.0.9(transitive)
- Removed@stdlib/utils-get-prototype-of@0.0.7(transitive)
- Removed@stdlib/utils-global@0.0.7(transitive)
- Removed@stdlib/utils-library-manifest@0.0.8(transitive)
- Removed@stdlib/utils-native-class@0.0.8(transitive)
- Removed@stdlib/utils-next-tick@0.0.8(transitive)
- Removed@stdlib/utils-noop@0.0.14(transitive)
- Removed@stdlib/utils-regexp-from-string@0.0.9(transitive)
- Removed@stdlib/utils-type-of@0.0.8(transitive)
- Removedminimist@1.2.8(transitive)
Updated@stdlib/complex-imag@^0.1.0
Updated@stdlib/complex-real@^0.1.0
Updated@stdlib/types@^0.1.0