diff --git a/lib/node_modules/@stdlib/complex/realf/README.md b/lib/node_modules/@stdlib/complex/realf/README.md deleted file mode 100644 index 982be317348..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/README.md +++ /dev/null @@ -1,233 +0,0 @@ - - -# realf - -> Return the real component of a single-precision complex floating-point number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var realf = require( '@stdlib/complex/realf' ); -``` - -#### realf( z ) - -Returns the **real** component 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 re = realf( z ); -// returns 5.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 realf = require( '@stdlib/complex/realf' ); - -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 ); - console.log( 'realf(%s) = %d', z.toString(), realf( z ) ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/realf.h" -``` - -#### stdlib_realf( z ) - -Returns the real component 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 = stdlib_realf( z ); -// returns 5.0f -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex64_t` single-precision complex floating-point number. - -```c -float stdlib_realf( const stdlib_complex64_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/realf.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 ) - }; - - int i; - for ( i = 0; i < 4; i++ ) { - printf( "realf(v) = %f\n", stdlib_realf( x[ i ] ) ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/lib/node_modules/@stdlib/complex/realf/benchmark/benchmark.js b/lib/node_modules/@stdlib/complex/realf/benchmark/benchmark.js deleted file mode 100644 index af83422f38d..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/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 isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var pkg = require( './../package.json' ).name; -var realf = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var re; - var z; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = new Complex64( randu(), randu() ); - re = realf( z ); - if ( isnanf( re ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnanf( re ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/lib/node_modules/@stdlib/complex/realf/benchmark/c/Makefile b/lib/node_modules/@stdlib/complex/realf/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad067..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/benchmark/c/Makefile +++ /dev/null @@ -1,126 +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 C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# 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/realf/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/complex/realf/benchmark/c/benchmark.c deleted file mode 100644 index 67e2e54280d..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/benchmark/c/benchmark.c +++ /dev/null @@ -1,139 +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 `crealf`. -*/ -#include -#include -#include -#include -#include - -#define NAME "realf" -#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() { - float complex z; - double elapsed; - float re; - float im; - float v; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_float(); - im = rand_float(); - z = re + im*I; - v = crealf( z ); - if ( v != v ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( v != v ) { - 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::%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/realf/benchmark/c/native/Makefile b/lib/node_modules/@stdlib/complex/realf/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c205..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/benchmark/c/native/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/realf/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/complex/realf/benchmark/c/native/benchmark.c deleted file mode 100644 index ca7ab08493d..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,142 +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 `realf`. -*/ -#include "stdlib/complex/realf.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include -#include -#include - -#define NAME "realf" -#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; - float v; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_float(); - im = rand_float(); - z = stdlib_complex64( re, im ); - v = stdlib_realf( z ); - if ( v != v ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( v != v ) { - 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/realf/benchmark/julia/REQUIRE b/lib/node_modules/@stdlib/complex/realf/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e192e4..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/lib/node_modules/@stdlib/complex/realf/benchmark/julia/benchmark.jl b/lib/node_modules/@stdlib/complex/realf/benchmark/julia/benchmark.jl deleted file mode 100755 index fad394fc1ba..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/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 = "realf"; -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 real( 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/realf/docs/repl.txt b/lib/node_modules/@stdlib/complex/realf/docs/repl.txt deleted file mode 100644 index 5bd7c7e7d0c..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/docs/repl.txt +++ /dev/null @@ -1,24 +0,0 @@ - -{{alias}}( z ) - Returns the real component of a single-precision complex floating-point - number. - - Parameters - ---------- - z: Complex64 - Complex number. - - Returns - ------- - re: number - Real component. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > var re = {{alias}}( z ) - 5.0 - - See Also - -------- - diff --git a/lib/node_modules/@stdlib/complex/realf/docs/types/index.d.ts b/lib/node_modules/@stdlib/complex/realf/docs/types/index.d.ts deleted file mode 100644 index e14069b3344..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/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 component of a single-precision complex floating-point number. -* -* @param z - complex number -* @returns real component -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var re = realf( z ); -* // returns 5.0 -*/ -declare function realf( z: Complex64 ): number; - - -// EXPORTS // - -export = realf; diff --git a/lib/node_modules/@stdlib/complex/realf/docs/types/test.ts b/lib/node_modules/@stdlib/complex/realf/docs/types/test.ts deleted file mode 100644 index 537ade28418..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/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 realf = require( './index' ); - - -// TESTS // - -// The function returns a number... -{ - realf( new Complex64( 5.0, 3.0 ) ); // $ExpectType number -} - -// The compiler throws an error if the function is provided an argument that is not a complex number... -{ - realf( 'abc' ); // $ExpectError - realf( 123 ); // $ExpectError - realf( true ); // $ExpectError - realf( false ); // $ExpectError - realf( [] ); // $ExpectError - realf( {} ); // $ExpectError - realf( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - realf(); // $ExpectError - realf( new Complex64( 5.0, 3.0 ), 123 ); // $ExpectError -} diff --git a/lib/node_modules/@stdlib/complex/realf/examples/c/Makefile b/lib/node_modules/@stdlib/complex/realf/examples/c/Makefile deleted file mode 100644 index 70c91f4e131..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/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/realf/examples/c/example.c b/lib/node_modules/@stdlib/complex/realf/examples/c/example.c deleted file mode 100644 index 7c120b0280f..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/examples/c/example.c +++ /dev/null @@ -1,35 +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/realf.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 ) - }; - - int i; - for ( i = 0; i < 4; i++ ) { - printf( "realf(v) = %f\n", stdlib_realf( x[ i ] ) ); - } -} diff --git a/lib/node_modules/@stdlib/complex/realf/examples/index.js b/lib/node_modules/@stdlib/complex/realf/examples/index.js deleted file mode 100644 index 69094b28521..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/examples/index.js +++ /dev/null @@ -1,36 +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 realf = require( './../lib' ); - -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 ); - console.log( 'realf(%s) = %d', z.toString(), realf( z ) ); -} diff --git a/lib/node_modules/@stdlib/complex/realf/include/stdlib/complex/realf.h b/lib/node_modules/@stdlib/complex/realf/include/stdlib/complex/realf.h deleted file mode 100644 index 72b33403cd9..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/include/stdlib/complex/realf.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_REALF_H -#define STDLIB_COMPLEX_REALF_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 component of a single-precision complex floating-point number. -*/ -float stdlib_realf( const stdlib_complex64_t z ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_REALF_H diff --git a/lib/node_modules/@stdlib/complex/realf/lib/index.js b/lib/node_modules/@stdlib/complex/realf/lib/index.js deleted file mode 100644 index b443d7d0a92..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/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 component of a single-precision complex floating-point number. -* -* @module @stdlib/complex/realf -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var realf = require( '@stdlib/complex/realf' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var re = realf( z ); -* // returns 5.0 -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/node_modules/@stdlib/complex/realf/lib/main.js b/lib/node_modules/@stdlib/complex/realf/lib/main.js deleted file mode 100644 index 6ac25985806..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/lib/main.js +++ /dev/null @@ -1,42 +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'; - -/** -* Returns the real component of a single-precision complex floating-point number. -* -* @param {Complex} z - complex number -* @returns {number} real component -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var re = realf( z ); -* // returns 5.0 -*/ -function realf( z ) { - return z.re; -} - - -// EXPORTS // - -module.exports = realf; diff --git a/lib/node_modules/@stdlib/complex/realf/manifest.json b/lib/node_modules/@stdlib/complex/realf/manifest.json deleted file mode 100644 index 35ffd47300e..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/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/realf/package.json b/lib/node_modules/@stdlib/complex/realf/package.json deleted file mode 100644 index 7c74d380e3d..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/realf", - "version": "0.0.0", - "description": "Return the real component 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", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "real", - "re", - "imaginary", - "imag", - "im", - "number" - ] -} diff --git a/lib/node_modules/@stdlib/complex/realf/src/main.c b/lib/node_modules/@stdlib/complex/realf/src/main.c deleted file mode 100644 index 2e3351c3561..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/src/main.c +++ /dev/null @@ -1,42 +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/realf.h" -#include "stdlib/complex/float32/ctor.h" - -/** -* Returns the real component of a single-precision complex floating-point number. -* -* @param z single-precision complex floating-point number -* @return real component -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* -* stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); -* -* // ... -* -* float re = stdlib_realf( z ); -* // returns 5.0f -*/ -float stdlib_realf( const stdlib_complex64_t z ) { - stdlib_complex64_parts_t v; - v.value = z; // cppcheck-suppress unreadVariable - return v.parts[ 0 ]; -} diff --git a/lib/node_modules/@stdlib/complex/realf/test/test.js b/lib/node_modules/@stdlib/complex/realf/test/test.js deleted file mode 100644 index c207411e0ea..00000000000 --- a/lib/node_modules/@stdlib/complex/realf/test/test.js +++ /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. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof realf, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns the real component of a complex number', function test( t ) { - var re; - var z; - - z = new Complex64( 3.0, -3.0 ); - re = realf( z ); - t.strictEqual( re, 3.0, 'returns expected value' ); - - t.end(); -});