From 47530f71e0b6f10b8289949516f12919d5031511 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Tue, 16 Jul 2024 03:17:42 -0700 Subject: [PATCH] remove: remove `complex/reimf` This commit removes `@stdlib/complex/reimf` in favor of `@stdlib/complex/float32/reim`. BREAKING CHANGE: remove `complex/reimf` To migrate, users should update their require/import paths to use `@stdlib/complex/float32/reim` which provides the same API and implementation. Ref: https://github.com/stdlib-js/stdlib/issues/2260 --- .../@stdlib/complex/reimf/README.md | 242 ------------------ .../complex/reimf/benchmark/benchmark.js | 52 ---- .../complex/reimf/benchmark/c/Makefile | 146 ----------- .../complex/reimf/benchmark/c/benchmark.c | 141 ---------- .../complex/reimf/benchmark/julia/REQUIRE | 2 - .../reimf/benchmark/julia/benchmark.jl | 144 ----------- .../@stdlib/complex/reimf/docs/repl.txt | 24 -- .../complex/reimf/docs/types/index.d.ts | 44 ---- .../@stdlib/complex/reimf/docs/types/test.ts | 45 ---- .../@stdlib/complex/reimf/examples/c/Makefile | 146 ----------- .../complex/reimf/examples/c/example.c | 38 --- .../@stdlib/complex/reimf/examples/index.js | 38 --- .../reimf/include/stdlib/complex/reimf.h | 40 --- .../@stdlib/complex/reimf/lib/index.js | 43 ---- .../@stdlib/complex/reimf/lib/main.js | 52 ---- .../@stdlib/complex/reimf/manifest.json | 40 --- .../@stdlib/complex/reimf/package.json | 67 ----- .../@stdlib/complex/reimf/src/main.c | 46 ---- .../@stdlib/complex/reimf/test/test.js | 49 ---- 19 files changed, 1399 deletions(-) delete mode 100644 lib/node_modules/@stdlib/complex/reimf/README.md delete mode 100644 lib/node_modules/@stdlib/complex/reimf/benchmark/benchmark.js delete mode 100644 lib/node_modules/@stdlib/complex/reimf/benchmark/c/Makefile delete mode 100644 lib/node_modules/@stdlib/complex/reimf/benchmark/c/benchmark.c delete mode 100644 lib/node_modules/@stdlib/complex/reimf/benchmark/julia/REQUIRE delete mode 100755 lib/node_modules/@stdlib/complex/reimf/benchmark/julia/benchmark.jl delete mode 100644 lib/node_modules/@stdlib/complex/reimf/docs/repl.txt delete mode 100644 lib/node_modules/@stdlib/complex/reimf/docs/types/index.d.ts delete mode 100644 lib/node_modules/@stdlib/complex/reimf/docs/types/test.ts delete mode 100644 lib/node_modules/@stdlib/complex/reimf/examples/c/Makefile delete mode 100644 lib/node_modules/@stdlib/complex/reimf/examples/c/example.c delete mode 100644 lib/node_modules/@stdlib/complex/reimf/examples/index.js delete mode 100644 lib/node_modules/@stdlib/complex/reimf/include/stdlib/complex/reimf.h delete mode 100644 lib/node_modules/@stdlib/complex/reimf/lib/index.js delete mode 100644 lib/node_modules/@stdlib/complex/reimf/lib/main.js delete mode 100644 lib/node_modules/@stdlib/complex/reimf/manifest.json delete mode 100644 lib/node_modules/@stdlib/complex/reimf/package.json delete mode 100644 lib/node_modules/@stdlib/complex/reimf/src/main.c delete mode 100644 lib/node_modules/@stdlib/complex/reimf/test/test.js diff --git a/lib/node_modules/@stdlib/complex/reimf/README.md b/lib/node_modules/@stdlib/complex/reimf/README.md deleted file mode 100644 index bc2bc767a17..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/README.md +++ /dev/null @@ -1,242 +0,0 @@ - - -# reimf - -> Return the real and imaginary components of a single-precision complex floating-point number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var reimf = require( '@stdlib/complex/reimf' ); -``` - -#### reimf( z ) - -Returns the **real** and **imaginary** components of a single-precision complex floating-point number. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z = new Complex64( 5.0, 3.0 ); -var out = reimf( z ); -// returns [ 5.0, 3.0 ] -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var reimf = require( '@stdlib/complex/reimf' ); - -var out; -var re; -var im; -var z; -var i; - -for ( i = 0; i < 100; i++ ) { - re = round( (randu()*100.0) - 50.0 ); - im = round( (randu()*50.0) - 25.0 ); - z = new Complex64( re, im ); - out = reimf( z ); - console.log( '%s => %d, %d', z.toString(), out[ 0 ], out[ 1 ] ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/reimf.h" -``` - -#### stdlib_reimf( z, \*re, \*im ) - -Returns the real and imaginary components of a single-precision complex floating-point number. - -```c -#include "stdlib/complex/float32/ctor.h" - -stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); - -// ... - -float re; -float im; - -stdlib_reimf( z, &re, &im ); -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex64_t` single-precision complex floating-point number. -- **re**: `[out] float*` destination for real component. -- **im**: `[out] float*` destination for imaginary component. - -```c -void stdlib_reimf( const stdlib_complex64_t z, float *re, float *im ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/reimf.h" -#include "stdlib/complex/float32/ctor.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - stdlib_reimf( x[ i ], &re, &im ); - printf( "reimf(v) = %f, %f\n", re, im ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/lib/node_modules/@stdlib/complex/reimf/benchmark/benchmark.js b/lib/node_modules/@stdlib/complex/reimf/benchmark/benchmark.js deleted file mode 100644 index 3cff4e29c43..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/benchmark/benchmark.js +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isArrayLike = require( '@stdlib/assert/is-array-like' ); -var pkg = require( './../package.json' ).name; -var reimf = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var arr; - var z; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = new Complex64( randu(), randu() ); - arr = reimf( z ); - if ( arr.length === 0 ) { - b.fail( 'should not be empty' ); - } - } - b.toc(); - if ( !isArrayLike( arr ) ) { - b.fail( 'should return an array' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/lib/node_modules/@stdlib/complex/reimf/benchmark/c/Makefile b/lib/node_modules/@stdlib/complex/reimf/benchmark/c/Makefile deleted file mode 100644 index 7f6bbc4c205..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/benchmark/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/lib/node_modules/@stdlib/complex/reimf/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/complex/reimf/benchmark/c/benchmark.c deleted file mode 100644 index 9cc05a520f6..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/benchmark/c/benchmark.c +++ /dev/null @@ -1,141 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/** -* Benchmark `reimf`. -*/ -#include "stdlib/complex/reimf.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include -#include -#include - -#define NAME "reimf" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -void print_version() { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -double tic() { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1]. -* -* @return random number -*/ -float rand_float() { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -double benchmark() { - stdlib_complex64_t z; - double elapsed; - float re; - float im; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_float(); - im = rand_float(); - z = stdlib_complex64( re, im ); - stdlib_reimf( z, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/lib/node_modules/@stdlib/complex/reimf/benchmark/julia/REQUIRE b/lib/node_modules/@stdlib/complex/reimf/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e192e4..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/lib/node_modules/@stdlib/complex/reimf/benchmark/julia/benchmark.jl b/lib/node_modules/@stdlib/complex/reimf/benchmark/julia/benchmark.jl deleted file mode 100755 index b31821562ef..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "reimf"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark reim( ComplexF32( rand(), rand() ) ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/lib/node_modules/@stdlib/complex/reimf/docs/repl.txt b/lib/node_modules/@stdlib/complex/reimf/docs/repl.txt deleted file mode 100644 index 81df69923f8..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/docs/repl.txt +++ /dev/null @@ -1,24 +0,0 @@ - -{{alias}}( z ) - Returns the real and imaginary components of a single-precision complex - floating-point number. - - Parameters - ---------- - z: Complex64 - Complex number. - - Returns - ------- - out: Float32Array - Array containing the real and imaginary components, respectively. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > var out = {{alias}}( z ) - [ 5.0, 3.0 ] - - See Also - -------- - diff --git a/lib/node_modules/@stdlib/complex/reimf/docs/types/index.d.ts b/lib/node_modules/@stdlib/complex/reimf/docs/types/index.d.ts deleted file mode 100644 index c7700306be4..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/docs/types/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Returns the real and imaginary components of a single-precision complex floating-point number. -* -* @param z - complex number -* @returns real and imaginary components -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = reimf( z ); -* // returns [ 5.0, 3.0 ] -*/ -declare function reimf( z: Complex64 ): Float32Array; - - -// EXPORTS // - -export = reimf; diff --git a/lib/node_modules/@stdlib/complex/reimf/docs/types/test.ts b/lib/node_modules/@stdlib/complex/reimf/docs/types/test.ts deleted file mode 100644 index f8cc6b2b70d..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/docs/types/test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( '@stdlib/complex/float32/ctor' ); -import reimf = require( './index' ); - - -// TESTS // - -// The function returns a floating-point typed array... -{ - reimf( new Complex64( 5.0, 3.0 ) ); // $ExpectType Float32Array -} - -// The compiler throws an error if the function is provided an argument that is not a complex number... -{ - reimf( 'abc' ); // $ExpectError - reimf( 123 ); // $ExpectError - reimf( true ); // $ExpectError - reimf( false ); // $ExpectError - reimf( [] ); // $ExpectError - reimf( {} ); // $ExpectError - reimf( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - reimf(); // $ExpectError - reimf( new Complex64( 5.0, 3.0 ), 123 ); // $ExpectError -} diff --git a/lib/node_modules/@stdlib/complex/reimf/examples/c/Makefile b/lib/node_modules/@stdlib/complex/reimf/examples/c/Makefile deleted file mode 100644 index 70c91f4e131..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/lib/node_modules/@stdlib/complex/reimf/examples/c/example.c b/lib/node_modules/@stdlib/complex/reimf/examples/c/example.c deleted file mode 100644 index 661f77909f4..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/examples/c/example.c +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/reimf.h" -#include "stdlib/complex/float32/ctor.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - stdlib_reimf( x[ i ], &re, &im ); - printf( "reimf(v) = %f, %f\n", re, im ); - } -} diff --git a/lib/node_modules/@stdlib/complex/reimf/examples/index.js b/lib/node_modules/@stdlib/complex/reimf/examples/index.js deleted file mode 100644 index 4f77ad305b8..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/examples/index.js +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var reimf = require( './../lib' ); - -var out; -var re; -var im; -var z; -var i; - -for ( i = 0; i < 100; i++ ) { - re = round( (randu()*100.0) - 50.0 ); - im = round( (randu()*50.0) - 25.0 ); - z = new Complex64( re, im ); - out = reimf( z ); - console.log( '%s => %d, %d', z.toString(), out[ 0 ], out[ 1 ] ); -} diff --git a/lib/node_modules/@stdlib/complex/reimf/include/stdlib/complex/reimf.h b/lib/node_modules/@stdlib/complex/reimf/include/stdlib/complex/reimf.h deleted file mode 100644 index 8e2bdcb61c0..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/include/stdlib/complex/reimf.h +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_REIMF_H -#define STDLIB_COMPLEX_REIMF_H - -#include "stdlib/complex/float32/ctor.h" - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Returns the real and imaginary components of a single-precision complex floating-point number. -*/ -void stdlib_reimf( const stdlib_complex64_t z, float *re, float *im ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_REIMF_H diff --git a/lib/node_modules/@stdlib/complex/reimf/lib/index.js b/lib/node_modules/@stdlib/complex/reimf/lib/index.js deleted file mode 100644 index 8186970039d..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/lib/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Return the real and imaginary components of a single-precision complex floating-point number. -* -* @module @stdlib/complex/reimf -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var reimf = require( '@stdlib/complex/reimf' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = reimf( z ); -* // returns [ 5.0, 3.0 ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/node_modules/@stdlib/complex/reimf/lib/main.js b/lib/node_modules/@stdlib/complex/reimf/lib/main.js deleted file mode 100644 index 99533011594..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/lib/main.js +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Float32Array = require( '@stdlib/array/float32' ); - - -// MAIN // - -/** -* Returns the real and imaginary components of a single-precision complex floating-point number. -* -* @param {Complex64} z - complex number -* @returns {Float32Array} real and imaginary components -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = reimf( z ); -* // returns [ 5.0, 3.0 ] -*/ -function reimf( z ) { - var out = new Float32Array( 2 ); - out[ 0 ] = z.re; - out[ 1 ] = z.im; - return out; -} - - -// EXPORTS // - -module.exports = reimf; diff --git a/lib/node_modules/@stdlib/complex/reimf/manifest.json b/lib/node_modules/@stdlib/complex/reimf/manifest.json deleted file mode 100644 index 35ffd47300e..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/manifest.json +++ /dev/null @@ -1,40 +0,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": [ - "@stdlib/complex/float32/ctor" - ] - } - ] -} diff --git a/lib/node_modules/@stdlib/complex/reimf/package.json b/lib/node_modules/@stdlib/complex/reimf/package.json deleted file mode 100644 index 26a6ddd8fa3..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/reimf", - "version": "0.0.0", - "description": "Return the real and imaginary components of a single-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "mathematics", - "math", - "complex", - "cmplx", - "real", - "re", - "imaginary", - "imag", - "im", - "number" - ] -} diff --git a/lib/node_modules/@stdlib/complex/reimf/src/main.c b/lib/node_modules/@stdlib/complex/reimf/src/main.c deleted file mode 100644 index e718f4857b5..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/src/main.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/reimf.h" -#include "stdlib/complex/float32/ctor.h" - -/** -* Returns the real and imaginary components of a single-precision complex floating-point number. -* -* @param z single-precision complex floating-point number -* @param re destination for real component -* @param im destination for imaginary component -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* -* stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); -* -* // ... -* -* float re; -* float im; -* -* stdlib_reimf( z, &re, &im ); -*/ -void stdlib_reimf( const stdlib_complex64_t z, float *re, float *im ) { - stdlib_complex64_parts_t v; - v.value = z; // cppcheck-suppress unreadVariable - *re = v.parts[ 0 ]; - *im = v.parts[ 1 ]; -} diff --git a/lib/node_modules/@stdlib/complex/reimf/test/test.js b/lib/node_modules/@stdlib/complex/reimf/test/test.js deleted file mode 100644 index 77eded1e3e8..00000000000 --- a/lib/node_modules/@stdlib/complex/reimf/test/test.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var Float32Array = require( '@stdlib/array/float32' ); -var reimf = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof reimf, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns the real and imaginary components of a complex number', function test( t ) { - var expected; - var out; - var z; - - z = new Complex64( 3.14, -3.14 ); - out = reimf( z ); - expected = new Float32Array( [ 3.14, -3.14 ] ); - t.strictEqual( out[ 0 ], expected[ 0 ], 'returns expected value' ); - t.strictEqual( out[ 1 ], expected[ 1 ], 'returns expected value' ); - - t.end(); -});