From fd52b0da91cb5aa49d287b0ee984fd1e0063e6ab Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Sat, 25 May 2024 15:42:14 -0700 Subject: [PATCH] remove: remove `complex/base/assert/is-same-value-zero` This commit removes `@stdlib/complex/base/assert/is-same-value-zero` in favor of `@stdlib/complex/float64/base/assert/is-same-value-zero`. BREAKING CHANGE: remove `complex/base/assert/is-same-value-zero` To migrate, users should update their require/import paths to use `@stdlib/complex/float64/base/assert/is-same-value-zero` which provides the same API and implementation. Ref: https://github.com/stdlib-js/stdlib/issues/2260 --- .../base/assert/is-same-value-zero/README.md | 247 ------------------ .../is-same-value-zero/benchmark/benchmark.js | 63 ----- .../assert/is-same-value-zero/docs/repl.txt | 31 --- .../is-same-value-zero/docs/types/index.d.ts | 48 ---- .../is-same-value-zero/docs/types/test.ts | 67 ----- .../is-same-value-zero/examples/c/Makefile | 146 ----------- .../is-same-value-zero/examples/c/example.c | 38 --- .../is-same-value-zero/examples/index.js | 37 --- .../complex/base/assert/is_same_value_zero.h | 41 --- .../assert/is-same-value-zero/lib/index.js | 44 ---- .../assert/is-same-value-zero/lib/main.js | 62 ----- .../assert/is-same-value-zero/manifest.json | 61 ----- .../assert/is-same-value-zero/package.json | 74 ------ .../base/assert/is-same-value-zero/src/main.c | 52 ---- .../assert/is-same-value-zero/test/test.js | 150 ----------- 15 files changed, 1161 deletions(-) delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/README.md delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/benchmark/benchmark.js delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/docs/repl.txt delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/docs/types/index.d.ts delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/docs/types/test.ts delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/examples/c/Makefile delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/examples/c/example.c delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/examples/index.js delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/include/stdlib/complex/base/assert/is_same_value_zero.h delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/lib/index.js delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/lib/main.js delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/manifest.json delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/package.json delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/src/main.c delete mode 100644 lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/test/test.js diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/README.md b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/README.md deleted file mode 100644 index 09c79c8ec0e..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/README.md +++ /dev/null @@ -1,247 +0,0 @@ - - -# isSameValueZero - -> Test whether two double-precision complex floating-point numbers are the same value. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isSameValueZero = require( '@stdlib/complex/base/assert/is-same-value-zero' ); -``` - -#### isSameValueZero( z1, z2 ) - -Tests whether two double-precision complex floating-point numbers are the same value. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); - -var out = isSameValueZero( z1, z2 ); -// returns true -``` - -In contrast to the strict equality operator `===`, the function treats `NaNs` as the same value. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( NaN, NaN ); -var z2 = new Complex128( NaN, NaN ); - -var out = isSameValueZero( z1, z2 ); -// returns true -``` - -In contrast to the [SameValue Algorithm][@stdlib/complex/base/assert/is-same-value] (as specified in ECMAScript 5), the function does not distinguish between `+0` and `-0`. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( -0.0, 0.0 ); -var z2 = new Complex128( 0.0, -0.0 ); - -var out = isSameValueZero( z1, z2 ); -// returns true -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isSameValueZero = require( '@stdlib/complex/base/assert/is-same-value-zero' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -var out = isSameValueZero( z1, z2 ); -// returns true - -z1 = new Complex128( -5.0, -3.0 ); -z2 = new Complex128( 5.0, 3.0 ); -out = isSameValueZero( z1, z2 ); -// returns false - -z1 = new Complex128( NaN, 3.0 ); -z2 = new Complex128( NaN, 3.0 ); -out = isSameValueZero( z1, z2 ); -// returns true -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/base/assert/is_same_value_zero.h" -``` - -#### stdlib_base_complex128_is_same_value_zero( z1, z2 ) - -Tests whether two double-precision complex floating-point numbers are the same value. - -```c -#include "stdlib/complex/float64/ctor.h" -#include - -stdlib_complex128_t z1 = stdlib_complex128( 5.0, 2.0 ); -stdlib_complex128_t z2 = stdlib_complex128( 5.0, 2.0 ); - -bool v = stdlib_base_complex128_is_same_value_zero( z1, z2 ); -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex128_t` first double-precision complex floating-point number. -- **z2**: `[in] stdlib_complex128_t` second double-precision complex floating-point number. - -```c -bool stdlib_base_complex128_is_same_value_zero( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/base/assert/is_same_value_zero.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex128_t z[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex128_is_same_value_zero( z[ i ], z[ i ] ); - printf( "Same value? %s\n", ( v ) ? "True" : "False" ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/benchmark/benchmark.js b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/benchmark/benchmark.js deleted file mode 100644 index 84c0ef2c9b3..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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 Complex128 = require( '@stdlib/complex/float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isSameValueZero = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ) - ]; - z2 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isSameValueZero( z1[ i%z1.length ], z2[ i%z2.length ] ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/docs/repl.txt b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/docs/repl.txt deleted file mode 100644 index 7300b728d67..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/docs/repl.txt +++ /dev/null @@ -1,31 +0,0 @@ - -{{alias}}( z1, z2 ) - Tests whether two double-precision complex floating-point numbers are the - same value. - - The function differs from the `===` operator in that the function treats - `NaNs` as the same value. - - Parameters - ---------- - z1: Complex128 - First complex number. - - z2: Complex128 - Second complex number. - - Returns - ------- - out: boolean - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float64}}( 5.0, 3.0 ); - > var z2 = new {{alias:@stdlib/complex/float64}}( 5.0, 3.0 ); - > var v = {{alias}}( z1, z2 ) - true - - See Also - -------- - diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/docs/types/index.d.ts b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/docs/types/index.d.ts deleted file mode 100644 index 18ad306081f..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/docs/types/index.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 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 Complex128 = require( '@stdlib/complex/float64/ctor' ); - -/** -* Tests whether two double-precision complex floating-point numbers are the same value. -* -* ## Notes -* -* - In contrast to the strict equality operator `===`, `NaNs` are treated as the same value. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @returns boolean indicating if both complex numbers are the same value -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, 3.0 ); -* -* var v = isSameValueZero( z1, z2 ); -* // returns true -*/ -declare function isSameValueZero( z1: Complex128, z2: Complex128 ): boolean; - - -// EXPORTS // - -export = isSameValueZero; diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/docs/types/test.ts b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/docs/types/test.ts deleted file mode 100644 index 76b719f9dce..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/docs/types/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 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 Complex128 = require( '@stdlib/complex/float64/ctor' ); -import isSameValueZero = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isSameValueZero( z1, z2 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex128( 5.0, 3.0 ); - - isSameValueZero( 'abc', z2 ); // $ExpectError - isSameValueZero( 123, z2 ); // $ExpectError - isSameValueZero( true, z2 ); // $ExpectError - isSameValueZero( false, z2 ); // $ExpectError - isSameValueZero( [], z2 ); // $ExpectError - isSameValueZero( {}, z2 ); // $ExpectError - isSameValueZero( ( x: number ): number => x, z2 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - - isSameValueZero( z1, 'abc' ); // $ExpectError - isSameValueZero( z1, 123 ); // $ExpectError - isSameValueZero( z1, true ); // $ExpectError - isSameValueZero( z1, false ); // $ExpectError - isSameValueZero( z1, [] ); // $ExpectError - isSameValueZero( z1, {} ); // $ExpectError - isSameValueZero( z1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isSameValueZero(); // $ExpectError - isSameValueZero( z1 ); // $ExpectError - isSameValueZero( z1, z2, {} ); // $ExpectError -} diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/examples/c/Makefile b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/examples/c/Makefile deleted file mode 100644 index 6aed70daf16..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2024 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/base/assert/is-same-value-zero/examples/c/example.c b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/examples/c/example.c deleted file mode 100644 index eb4c75eccb5..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/examples/c/example.c +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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/base/assert/is_same_value_zero.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex128_t z[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex128_is_same_value_zero( z[ i ], z[ i ] ); - printf( "Same value? %s\n", ( v ) ? "True" : "False" ); - } -} diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/examples/index.js b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/examples/index.js deleted file mode 100644 index 47f2213eaad..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/examples/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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 Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isSameValueZero = require( './../lib' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -console.log( isSameValueZero( z1, z2 ) ); -// => true - -z1 = new Complex128( -5.0, -3.0 ); -z2 = new Complex128( 5.0, 3.0 ); -console.log( isSameValueZero( z1, z2 ) ); -// => false - -z1 = new Complex128( NaN, 3.0 ); -z2 = new Complex128( NaN, 3.0 ); -console.log( isSameValueZero( z1, z2 ) ); -// => true diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/include/stdlib/complex/base/assert/is_same_value_zero.h b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/include/stdlib/complex/base/assert/is_same_value_zero.h deleted file mode 100644 index 549d6ebe4b7..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/include/stdlib/complex/base/assert/is_same_value_zero.h +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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_BASE_ASSERT_IS_SAME_VALUE_ZERO_H -#define STDLIB_COMPLEX_BASE_ASSERT_IS_SAME_VALUE_ZERO_H - -#include "stdlib/complex/float64/ctor.h" -#include - -/* -* 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 - -/** -* Tests whether two double-precision complex floating-point numbers are the same value. -*/ -bool stdlib_base_complex128_is_same_value_zero( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_BASE_ASSERT_IS_SAME_VALUE_ZERO_H diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/lib/index.js b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/lib/index.js deleted file mode 100644 index d57b87d92d9..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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'; - -/** -* Test whether two double-precision complex floating-point numbers are the same value. -* -* @module @stdlib/complex/base/assert/is-same-value-zero -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var isSameValueZero = require( '@stdlib/complex/base/assert/is-same-value-zero' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, 3.0 ); -* -* var v = isSameValueZero( z1, z2 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/lib/main.js b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/lib/main.js deleted file mode 100644 index 3d1ddb89760..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/lib/main.js +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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 isSame = require( '@stdlib/number/float64/base/assert/is-same-value-zero' ); -var reim = require( '@stdlib/complex/reim' ); - - -// MAIN // - -/** -* Tests whether two double-precision complex floating-point numbers are the same value. -* -* ## Notes -* -* - The function implements the SameValueZero Algorithm used by `TypedArray` and `ArrayBuffer` constructors, `Map` and `Set` operations, `String.prototype.includes`, and `Array.prototype.includes` since ES2016. -* - In contrast to the strict equality operator `===`, `NaNs` are considered the same value. -* -* @param {Complex128} z1 - first complex number -* @param {Complex128} z2 - second complex number -* @returns {boolean} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, 3.0 ); -* -* var v = isSameValueZero( z1, z2 ); -* // returns true -*/ -function isSameValueZero( z1, z2 ) { - var parts1 = reim( z1 ); - var parts2 = reim( z2 ); - return ( - isSame( parts1[ 0 ], parts2[ 0 ] ) && - isSame( parts1[ 1 ], parts2[ 1 ] ) - ); -} - - -// EXPORTS // - -module.exports = isSameValueZero; diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/manifest.json b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/manifest.json deleted file mode 100644 index b7d12f79554..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/manifest.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/reim", - "@stdlib/number/float64/base/assert/is-same-value-zero" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/reim", - "@stdlib/number/float64/base/assert/is-same-value-zero" - ] - } - ] -} diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/package.json b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/package.json deleted file mode 100644 index 69bfbd23bcc..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "@stdlib/complex/base/assert/is-same-value-zero", - "version": "0.0.0", - "description": "Test whether two double-precision complex floating-point numbers are the same value.", - "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", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "same", - "issame", - "issamevalue" - ] -} diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/src/main.c b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/src/main.c deleted file mode 100644 index 689d5adba36..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/src/main.c +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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/base/assert/is_same_value_zero.h" -#include "stdlib/number/float64/base/assert/is_same_value_zero.h" -#include "stdlib/complex/reim.h" -#include "stdlib/complex/float64/ctor.h" -#include - -/** -* Tests whether two double-precision complex floating-point numbers are the same value. -* -* @param z1 first double-precision complex floating-point number -* @param z2 second double-precision complex floating-point number -* @return boolean indicating if both complex numbers are the same value -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include -* -* stdlib_complex128_t z1 = stdlib_complex128( 5.0, 2.0 ); -* stdlib_complex128_t z2 = stdlib_complex128( 5.0, 2.0 ); -* -* bool v = stdlib_base_complex128_is_same_value_zero( z1, z2 ); -*/ -bool stdlib_base_complex128_is_same_value_zero( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ) { - double re1; - double re2; - double im1; - double im2; - stdlib_reim( z1, &re1, &im1 ); - stdlib_reim( z2, &re2, &im2 ); - return ( - stdlib_base_float64_is_same_value_zero( re1, re2 ) && - stdlib_base_float64_is_same_value_zero( im1, im2 ) - ); -} diff --git a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/test/test.js b/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/test/test.js deleted file mode 100644 index e8a23a7ba92..00000000000 --- a/lib/node_modules/@stdlib/complex/base/assert/is-same-value-zero/test/test.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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 Complex128 = require( '@stdlib/complex/float64/ctor' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isSameValueZero = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isSameValueZero, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (finite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 0.0, 0.0 ); - z2 = new Complex128( 0.0, 0.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( -0.0, 0.0 ); - z2 = new Complex128( 0.0, 0.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 0.0, -0.0 ); - z2 = new Complex128( -0.0, 0.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 0.0, -0.0 ); - z2 = new Complex128( 0.0, -0.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( -5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, -3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, -3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (infinite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( PINF, NINF ); - t.strictEqual( isSameValueZero( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex128( PINF, NINF ); - z2 = new Complex128( PINF, NINF ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( NINF, 3.0 ); - z2 = new Complex128( PINF, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, 3.0 ); - z2 = new Complex128( NINF, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, -3.0 ); - z2 = new Complex128( PINF, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, 3.0 ); - z2 = new Complex128( PINF, -3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, PINF ); - z2 = new Complex128( 5.0, NINF ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (NaNs)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( NaN, NaN ); - t.strictEqual( isSameValueZero( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - t.end(); -});