diff --git a/CHANGELOG.md b/CHANGELOG.md index e8a60b4..49bb62b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@
-## Unreleased (2024-07-16) +## Unreleased (2024-07-17)
@@ -22,6 +22,8 @@
+- [`8d4c46b`](https://github.com/stdlib-js/stdlib/commit/8d4c46b10ca912401e0ff0caa37a17cd3c443c2f) - **refactor:** update paths _(by Athan Reines)_ +- [`18b3c79`](https://github.com/stdlib-js/stdlib/commit/18b3c79c5035c7082618b7379cd6576e64393a96) - **refactor:** update paths _(by Athan Reines)_ - [`ad760a9`](https://github.com/stdlib-js/stdlib/commit/ad760a922086631226d8f759a0d467c707fbc0fb) - **refactor:** update paths _(by Athan Reines)_ - [`87fdfa1`](https://github.com/stdlib-js/stdlib/commit/87fdfa106f4c75b60a3c79c7fb4ca08f5c172862) - **refactor:** update paths _(by Athan Reines)_ - [`cecc11a`](https://github.com/stdlib-js/stdlib/commit/cecc11af413b6065ed9a61d30d547fc07f656173) - **feat:** add `complex/float32/conj` _(by Athan Reines)_ diff --git a/README.md b/README.md index ec5b930..be03c1d 100644 --- a/README.md +++ b/README.md @@ -170,8 +170,8 @@ Returns the [complex conjugate][complex-conjugate] of a single-precision complex ```c #include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/realf.h" -#include "stdlib/complex/imagf.h" +#include "stdlib/complex/float32/real.h" +#include "stdlib/complex/float32/imag.h" stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); @@ -179,10 +179,10 @@ stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); stdlib_complex64_t v = stdlib_complex64_conj( z ); -float re = stdlib_realf( v ); +float re = stdlib_complex64_real( v ); // returns 5.0f -float im = stdlib_imagf( v ); +float im = stdlib_complex64_imag( v ); // returns -2.0f ``` @@ -214,8 +214,8 @@ stdlib_complex64_t stdlib_complex64_conj( const stdlib_complex64_t z ); ```c #include "stdlib/complex/float32/conj.h" -#include "stdlib/complex/realf.h" -#include "stdlib/complex/imagf.h" +#include "stdlib/complex/float32/real.h" +#include "stdlib/complex/float32/imag.h" #include "stdlib/complex/float32/ctor.h" #include @@ -233,7 +233,7 @@ int main( void ) { for ( i = 0; i < 4; i++ ) { z = x[ i ]; v = stdlib_complex64_conj( z ); - printf( "conj(%f + %fi) = %f + %fi\n", stdlib_realf( z ), stdlib_imagf( z ), stdlib_realf( v ), stdlib_imagf( v ) ); + printf( "conj(%f + %fi) = %f + %fi\n", stdlib_complex64_real( z ), stdlib_complex64_imag( z ), stdlib_complex64_real( v ), stdlib_complex64_imag( v ) ); } } ``` @@ -263,8 +263,8 @@ int main( void ) { ## See Also - [`@stdlib/complex-float64/conj`][@stdlib/complex/float64/conj]: return the complex conjugate of a double-precision complex floating-point number. -- [`@stdlib/complex-imagf`][@stdlib/complex/imagf]: return the imaginary component of a single-precision complex floating-point number. -- [`@stdlib/complex-realf`][@stdlib/complex/realf]: return the real component of a single-precision complex floating-point number. +- [`@stdlib/complex-float32/imag`][@stdlib/complex/float32/imag]: return the imaginary component of a single-precision complex floating-point number. +- [`@stdlib/complex-float32/real`][@stdlib/complex/float32/real]: return the real component of a single-precision complex floating-point number. - [`@stdlib/complex-float32/reim`][@stdlib/complex/float32/reim]: return the real and imaginary components of a single-precision complex floating-point number.
@@ -349,9 +349,9 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. [@stdlib/complex/float64/conj]: https://github.com/stdlib-js/complex-float64-conj -[@stdlib/complex/imagf]: https://github.com/stdlib-js/complex-imagf +[@stdlib/complex/float32/imag]: https://github.com/stdlib-js/complex-float32-imag -[@stdlib/complex/realf]: https://github.com/stdlib-js/complex-realf +[@stdlib/complex/float32/real]: https://github.com/stdlib-js/complex-float32-real [@stdlib/complex/float32/reim]: https://github.com/stdlib-js/complex-float32-reim diff --git a/benchmark/c/native/benchmark.c b/benchmark/c/native/benchmark.c index 9839db5..14fe0ac 100644 --- a/benchmark/c/native/benchmark.c +++ b/benchmark/c/native/benchmark.c @@ -18,8 +18,8 @@ #include "stdlib/complex/float32/conj.h" #include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/realf.h" -#include "stdlib/complex/imagf.h" +#include "stdlib/complex/float32/real.h" +#include "stdlib/complex/float32/imag.h" #include #include #include @@ -108,14 +108,14 @@ double benchmark() { im = rand_float(); z = stdlib_complex64( re, im ); v = stdlib_complex64_conj( z ); - re = stdlib_realf( v ); + re = stdlib_complex64_real( v ); if ( re != re ) { printf( "should not return NaN\n" ); break; } } elapsed = tic() - t; - im = stdlib_imagf( v ); + im = stdlib_complex64_imag( v ); if ( im != im ) { printf( "should not return NaN\n" ); } diff --git a/dist/index.js.map b/dist/index.js.map index d8f0128..6319977 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the complex conjugate of a single-precision complex floating-point number.\n*\n* @param {Complex64} z - complex number\n* @returns {Complex64} complex conjugate\n*\n* @example\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-realf' );\n* var imagf = require( '@stdlib/complex-imagf' );\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var v = conj( z );\n* // returns \n*\n* var re = realf( v );\n* // returns 5.0\n*\n* var im = imagf( v );\n* // returns -3.0\n*/\nfunction conj( z ) {\n\treturn new z.constructor( z.re, -z.im );\n}\n\n\n// EXPORTS //\n\nmodule.exports = conj;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the complex conjugate of a single-precision complex floating-point number.\n*\n* @module @stdlib/complex-float32-conj\n*\n* @example\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-realf' );\n* var imagf = require( '@stdlib/complex-imagf' );\n* var conj = require( '@stdlib/complex-float32-conj' );\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var v = conj( z );\n* // returns \n*\n* var re = realf( v );\n* // returns 5.0\n*\n* var im = imagf( v );\n* // returns -3.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the complex conjugate of a single-precision complex floating-point number.\n*\n* @param {Complex64} z - complex number\n* @returns {Complex64} complex conjugate\n*\n* @example\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var v = conj( z );\n* // returns \n*\n* var re = realf( v );\n* // returns 5.0\n*\n* var im = imagf( v );\n* // returns -3.0\n*/\nfunction conj( z ) {\n\treturn new z.constructor( z.re, -z.im );\n}\n\n\n// EXPORTS //\n\nmodule.exports = conj;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the complex conjugate of a single-precision complex floating-point number.\n*\n* @module @stdlib/complex-float32-conj\n*\n* @example\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n* var conj = require( '@stdlib/complex-float32-conj' );\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var v = conj( z );\n* // returns \n*\n* var re = realf( v );\n* // returns 5.0\n*\n* var im = imagf( v );\n* // returns -3.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cA0CA,SAASC,EAAMC,EAAI,CAClB,OAAO,IAAIA,EAAE,YAAaA,EAAE,GAAI,CAACA,EAAE,EAAG,CACvC,CAKAF,EAAO,QAAUC,ICJjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", "names": ["require_main", "__commonJSMin", "exports", "module", "conj", "z", "main"] } diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index b40b780..9557a8f 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -28,8 +28,8 @@ import Complex64 = require( '@stdlib/complex-float32-ctor' ); * * @example * var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-realf' ); -* var imagf = require( '@stdlib/complex-imagf' ); +* var realf = require( '@stdlib/complex-float32-real' ); +* var imagf = require( '@stdlib/complex-float32-imag' ); * * var z = new Complex64( 5.0, 3.0 ); * diff --git a/examples/c/example.c b/examples/c/example.c index 25ddff6..b828b3c 100644 --- a/examples/c/example.c +++ b/examples/c/example.c @@ -17,8 +17,8 @@ */ #include "stdlib/complex/float32/conj.h" -#include "stdlib/complex/realf.h" -#include "stdlib/complex/imagf.h" +#include "stdlib/complex/float32/real.h" +#include "stdlib/complex/float32/imag.h" #include "stdlib/complex/float32/ctor.h" #include @@ -36,6 +36,6 @@ int main( void ) { for ( i = 0; i < 4; i++ ) { z = x[ i ]; v = stdlib_complex64_conj( z ); - printf( "conj(%f + %fi) = %f + %fi\n", stdlib_realf( z ), stdlib_imagf( z ), stdlib_realf( v ), stdlib_imagf( v ) ); + printf( "conj(%f + %fi) = %f + %fi\n", stdlib_complex64_real( z ), stdlib_complex64_imag( z ), stdlib_complex64_real( v ), stdlib_complex64_imag( v ) ); } } diff --git a/examples/index.js b/examples/index.js index 34b4d3b..1d8274d 100644 --- a/examples/index.js +++ b/examples/index.js @@ -34,7 +34,7 @@ var x = filledarrayBy( 100, 'complex64', random ); // Compute the complex conjugate of each complex number... var z; var i; -for ( i = 0; i < 100; i++ ) { +for ( i = 0; i < x.length; i++ ) { z = x.get( i ); console.log( 'conj(%s) = %s', z.toString(), conj( z ).toString() ); } diff --git a/lib/index.js b/lib/index.js index 0b4e0ef..6e49714 100644 --- a/lib/index.js +++ b/lib/index.js @@ -25,8 +25,8 @@ * * @example * var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-realf' ); -* var imagf = require( '@stdlib/complex-imagf' ); +* var realf = require( '@stdlib/complex-float32-real' ); +* var imagf = require( '@stdlib/complex-float32-imag' ); * var conj = require( '@stdlib/complex-float32-conj' ); * * var z = new Complex64( 5.0, 3.0 ); diff --git a/lib/main.js b/lib/main.js index 435f084..769810d 100644 --- a/lib/main.js +++ b/lib/main.js @@ -26,8 +26,8 @@ * * @example * var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-realf' ); -* var imagf = require( '@stdlib/complex-imagf' ); +* var realf = require( '@stdlib/complex-float32-real' ); +* var imagf = require( '@stdlib/complex-float32-imag' ); * * var z = new Complex64( 5.0, 3.0 ); * diff --git a/manifest.json b/manifest.json index 60da88b..85b48d3 100644 --- a/manifest.json +++ b/manifest.json @@ -51,8 +51,8 @@ "libpath": [], "dependencies": [ "@stdlib/complex-float32-ctor", - "@stdlib/complex-realf", - "@stdlib/complex-imagf" + "@stdlib/complex-float32-real", + "@stdlib/complex-float32-imag" ] }, { @@ -67,8 +67,8 @@ "libpath": [], "dependencies": [ "@stdlib/complex-float32-ctor", - "@stdlib/complex-realf", - "@stdlib/complex-imagf" + "@stdlib/complex-float32-real", + "@stdlib/complex-float32-imag" ] } ] diff --git a/package.json b/package.json index 2e1246a..1e34d0f 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,8 @@ "devDependencies": { "@stdlib/array-filled-by": "^0.2.1", "@stdlib/assert-is-complex64": "^0.2.1", - "@stdlib/complex-imagf": "^0.2.1", - "@stdlib/complex-realf": "^0.2.1", + "@stdlib/complex-float32-imag": "github:stdlib-js/complex-float32-imag#main", + "@stdlib/complex-float32-real": "github:stdlib-js/complex-float32-real#main", "@stdlib/random-base-discrete-uniform": "^0.2.1", "@stdlib/random-base-randu": "^0.2.1", "tape": "git+https://github.com/kgryte/tape.git#fix/globby", diff --git a/src/main.c b/src/main.c index e5fb456..cd0c93b 100644 --- a/src/main.c +++ b/src/main.c @@ -27,8 +27,8 @@ * * @example * #include "stdlib/complex/float32/ctor.h" -* #include "stdlib/complex/realf.h" -* #include "stdlib/complex/imagf.h" +* #include "stdlib/complex/float32/real.h" +* #include "stdlib/complex/float32/imag.h" * * stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); * @@ -36,10 +36,10 @@ * * stdlib_complex64_t v = stdlib_complex64_conj( z ); * -* float re = stdlib_realf( v ); +* float re = stdlib_complex64_real( v ); * // returns 5.0f * -* float im = stdlib_imagf( v ); +* float im = stdlib_complex64_imag( v ); * // returns -2.0f */ stdlib_complex64_t stdlib_complex64_conj( const stdlib_complex64_t z ) {