diff --git a/lib/node_modules/@stdlib/complex/docs/types/index.d.ts b/lib/node_modules/@stdlib/complex/docs/types/index.d.ts index a9c441e90ac..df8536aeb45 100644 --- a/lib/node_modules/@stdlib/complex/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/complex/docs/types/index.d.ts @@ -22,22 +22,12 @@ import base = require( '@stdlib/complex/base' ); import complex = require( '@stdlib/complex/cmplx' ); -import complexCtors = require( '@stdlib/complex/ctors' ); -import complexDataType = require( '@stdlib/complex/dtype' ); -import complexDataTypes = require( '@stdlib/complex/dtypes' ); -import conjf = require( '@stdlib/complex/float32/conj' ); -import Complex64 = require( '@stdlib/complex/float32/ctor' ); -import imagf = require( '@stdlib/complex/float32/imag' ); -import realf = require( '@stdlib/complex/float32/real' ); -import reimf = require( '@stdlib/complex/float32/reim' ); -import reviveComplex64 = require( '@stdlib/complex/float32/reviver' ); -import conj = require( '@stdlib/complex/float64/conj' ); -import Complex128 = require( '@stdlib/complex/float64/ctor' ); -import imag = require( '@stdlib/complex/float64/imag' ); -import real = require( '@stdlib/complex/float64/real' ); -import reim = require( '@stdlib/complex/float64/reim' ); -import reviveComplex128 = require( '@stdlib/complex/float64/reviver' ); -import complexPromotionRules = require( '@stdlib/complex/promotion-rules' ); +import ctors = require( '@stdlib/complex/ctors' ); +import dtype = require( '@stdlib/complex/dtype' ); +import dtypes = require( '@stdlib/complex/dtypes' ); +import float32 = require( '@stdlib/complex/float32' ); +import float64 = require( '@stdlib/complex/float64' ); +import promotionRules = require( '@stdlib/complex/promotion-rules' ); import reviveComplex = require( '@stdlib/complex/reviver' ); /** @@ -70,14 +60,14 @@ interface Namespace { * @returns constructor or null * * @example - * var ctor = ns.complexCtors( 'complex128' ); + * var ctor = ns.ctors( 'complex128' ); * // returns * * @example - * var ctor = ns.complexCtors( 'float' ); + * var ctor = ns.ctors( 'float' ); * // returns null */ - complexCtors: typeof complexCtors; + ctors: typeof ctors; /** * Returns the data type of a complex number. @@ -92,13 +82,13 @@ interface Namespace { * @example * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * - * var dt = ns.complexDataType( new Complex64( 1.0, 2.0 ) ); + * var dt = ns.dtype( new Complex64( 1.0, 2.0 ) ); * // returns 'complex64' * - * var dt = ns.complexDataType( 'beep' ); + * var dt = ns.dtype( 'beep' ); * // returns null */ - complexDataType: typeof complexDataType; + dtype: typeof dtype; /** * Returns a list of complex number data types. @@ -106,198 +96,20 @@ interface Namespace { * @returns list of complex number data types * * @example - * var list = ns.complexDataTypes(); + * var list = ns.dtypes(); * // e.g., returns [ 'complex64', 'complex128' ] */ - complexDataTypes: typeof complexDataTypes; + dtypes: typeof dtypes; /** - * Returns the complex conjugate of a single-precision complex floating-point number. - * - * @param z - complex number - * @returns complex conjugate - * - * @example - * var Complex64 = require( '@stdlib/complex/float32/ctor' ); - * var realf = require( '@stdlib/complex/float32/real' ); - * var imagf = require( '@stdlib/complex/float32/imag' ); - * - * var z = new Complex64( 5.0, 3.0 ); - * - * var v = ns.conjf( z ); - * // returns - * - * var re = realf( v ); - * // returns 5.0 - * - * var im = imagf( v ); - * // returns -3.0 - */ - conjf: typeof conjf; - - /** - * 64-bit complex number. - */ - Complex64: typeof Complex64; - - /** - * Returns the imaginary component of a single-precision complex floating-point number. - * - * @param z - complex number - * @returns imaginary component - * - * @example - * var Complex64 = require( '@stdlib/complex/float32/ctor' ); - * - * var z = new Complex64( 5.0, 3.0 ); - * - * var im = ns.imagf( z ); - * // returns 3.0 - */ - imagf: typeof imagf; - - /** - * 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 = ns.realf( z ); - * // returns 5.0 - */ - realf: typeof realf; - - /** - * 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 = ns.reimf( z ); - * // returns [ 5.0, 3.0 ] - */ - reimf: typeof reimf; - - /** - * Revives a JSON-serialized 64-bit complex number. - * - * @param key - key - * @param value - value - * @returns value or 64-bit complex number - * - * @example - * var parseJSON = require( '@stdlib/utils/parse-json' ); - * - * var str = '{"type":"Complex64","re":5,"im":3}'; - * - * var z = parseJSON( str, ns.reviveComplex64 ); - * // returns + * Single-precision complex number functions. */ - reviveComplex64: typeof reviveComplex64; + float32: typeof float32; /** - * Returns the complex conjugate of a double-precision complex floating-point number. - * - * @param z - complex number - * @returns complex conjugate - * - * @example - * var Complex128 = require( '@stdlib/complex/float64/ctor' ); - * var real = require( '@stdlib/complex/float64/real' ); - * var imag = require( '@stdlib/complex/float64/imag' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var v = ns.conj( z ); - * // returns - * - * var re = real( v ); - * // returns 5.0 - * - * var im = imag( v ); - * // returns -3.0 - */ - conj: typeof conj; - - /** - * 128-bit complex number. - */ - Complex128: typeof Complex128; - - /** - * Returns the imaginary component of a double-precision complex floating-point number. - * - * @param z - complex number - * @returns imaginary component - * - * @example - * var Complex128 = require( '@stdlib/complex/float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var im = ns.imag( z ); - * // returns 3.0 - */ - imag: typeof imag; - - /** - * Returns the real component of a double-precision complex floating-point number. - * - * @param z - complex number - * @returns real component - * - * @example - * var Complex128 = require( '@stdlib/complex/float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var re = ns.real( z ); - * // returns 5.0 - */ - real: typeof real; - - /** - * Returns the real and imaginary components of a double-precision complex floating-point number. - * - * @param z - complex number - * @returns real and imaginary components - * - * @example - * var Complex128 = require( '@stdlib/complex/float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var out = ns.reim( z ); - * // returns [ 5.0, 3.0 ] - */ - reim: typeof reim; - - /** - * Revives a JSON-serialized 128-bit complex number. - * - * @param key - key - * @param value - value - * @returns value or 128-bit complex number - * - * @example - * var parseJSON = require( '@stdlib/utils/parse-json' ); - * - * var str = '{"type":"Complex128","re":5,"im":3}'; - * - * var z = parseJSON( str, ns.reviveComplex128 ); - * // returns + * Double-precision complex number functions. */ - reviveComplex128: typeof reviveComplex128; + float64: typeof float64; /** * Returns a type promotion table displaying complex number data types with the smallest size and closest "kind" to which data types can be safely cast. @@ -307,10 +119,10 @@ interface Namespace { * @returns promotion rule table * * @example - * var table = ns.complexPromotionRules(); + * var table = ns.promotionRules(); * // returns {...} */ - complexPromotionRules: typeof complexPromotionRules; + promotionRules: typeof promotionRules; /** * Revives a JSON-serialized complex number. diff --git a/lib/node_modules/@stdlib/complex/float32/base/assert/docs/types/index.d.ts b/lib/node_modules/@stdlib/complex/float32/base/assert/docs/types/index.d.ts index eeaea25d58f..292a8bac7ed 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/assert/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/complex/float32/base/assert/docs/types/index.d.ts @@ -21,19 +21,100 @@ /* eslint-disable max-lines */ import isEqual = require( '@stdlib/complex/float32/base/assert/is-equal' ); +import isNotEqual = require( '@stdlib/complex/float32/base/assert/is-not-equal' ); +import isSameValue = require( '@stdlib/complex/float32/base/assert/is-same-value' ); +import isSameValueZero = require( '@stdlib/complex/float32/base/assert/is-same-value-zero' ); /** -* Interface describing the namespace. +* Interface describing the `assert` namespace. */ interface Namespace { /** - * TODO + * Tests whether two single-precision complex floating-point numbers are equal. + * + * @param z1 - first complex number + * @param z2 - second complex number + * @returns boolean indicating if both complex numbers are equal + * + * @example + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var z1 = new Complex64( 5.0, 3.0 ); + * var z2 = new Complex64( 5.0, 3.0 ); + * + * var v = ns.isEqual( z1, z2 ); + * // returns true */ isEqual: typeof isEqual; + + /** + * Tests whether two single-precision complex floating-point numbers are not equal. + * + * @param z1 - first complex number + * @param z2 - second complex number + * @returns boolean indicating if both complex numbers are not equal + * + * @example + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var z1 = new Complex64( 5.0, 3.0 ); + * var z2 = new Complex64( 5.0, -3.0 ); + * + * var v = ns.isNotEqual( z1, z2 ); + * // returns true + */ + isNotEqual: typeof isNotEqual; + + /** + * Tests whether two single-precision complex floating-point numbers are the same value. + * + * ## Notes + * + * - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5. + * - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same. + * + * [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12 + * + * @param z1 - first complex number + * @param z2 - second complex number + * @returns boolean indicating if both complex numbers are the same value + * + * @example + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var z1 = new Complex64( 5.0, 3.0 ); + * var z2 = new Complex64( 5.0, 3.0 ); + * + * var v = ns.isSameValue( z1, z2 ); + * // returns true + */ + isSameValue: typeof isSameValue; + + /** + * Tests whether two single-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 Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var z1 = new Complex64( 5.0, 3.0 ); + * var z2 = new Complex64( 5.0, 3.0 ); + * + * var v = ns.isSameValueZero( z1, z2 ); + * // returns true + */ + isSameValueZero: typeof isSameValueZero; } /** -* Base (i.e., lower-level) single-precision complex floating-point number assertion functions. +* Base (i.e., lower-level) single-precision complex number assertion functions. */ declare var ns: Namespace; diff --git a/lib/node_modules/@stdlib/complex/float32/base/docs/types/index.d.ts b/lib/node_modules/@stdlib/complex/float32/base/docs/types/index.d.ts index b4eeda64af1..e99b622a3aa 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/complex/float32/base/docs/types/index.d.ts @@ -21,19 +21,76 @@ /* eslint-disable max-lines */ import add = require( '@stdlib/complex/float32/base/add' ); +import assert = require( '@stdlib/complex/float32/base/assert' ); +import mul = require( '@stdlib/complex/float32/base/mul' ); /** -* Interface describing the namespace. +* Interface describing the `base` namespace. */ interface Namespace { /** - * TODO + * Adds two single-precision complex floating-point numbers. + * + * @param z1 - complex number + * @param z2 - complex number + * @returns result + * + * @example + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * var realf = require( '@stdlib/complex/float32/real' ); + * var imagf = require( '@stdlib/complex/float32/imag' ); + * + * var z = new Complex64( 5.0, 3.0 ); + * // returns + * + * var out = ns.add( z, z ); + * // returns + * + * var re = realf( out ); + * // returns 10.0 + * + * var im = imagf( out ); + * // returns 6.0 */ add: typeof add; + + /** + * Base (i.e., lower-level) single-precision complex number assertion functions. + */ + assert: typeof assert; + + /** + * Multiplies two single-precision complex floating-point numbers. + * + * @param z1 - complex number + * @param z2 - complex number + * @returns result + * + * @example + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * var realf = require( '@stdlib/complex/float32/real' ); + * var imagf = require( '@stdlib/complex/float32/imag' ); + * + * var z1 = new Complex64( 5.0, 3.0 ); + * // returns + * + * var z2 = new Complex64( -2.0, 1.0 ); + * // returns + * + * var out = ns.mul( z1, z2 ); + * // returns + * + * var re = realf( out ); + * // returns -13.0 + * + * var im = imagf( out ); + * // returns -1.0 + */ + mul: typeof mul; } /** -* Base (i.e., lower-level) single-precision complex floating-point number functions. +* Base (i.e., lower-level) single-precision complex number functions. */ declare var ns: Namespace; diff --git a/lib/node_modules/@stdlib/complex/float32/docs/types/index.d.ts b/lib/node_modules/@stdlib/complex/float32/docs/types/index.d.ts index 03f26e4906f..cd8538b2f20 100644 --- a/lib/node_modules/@stdlib/complex/float32/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/complex/float32/docs/types/index.d.ts @@ -20,20 +20,136 @@ /* eslint-disable max-lines */ +import base = require( '@stdlib/complex/float32/base' ); +import conj = require( '@stdlib/complex/float32/conj' ); +import Complex64 = require( '@stdlib/complex/float32/ctor' ); import imag = require( '@stdlib/complex/float32/imag' ); +import parseComplex64 = require( '@stdlib/complex/float32/parse' ); +import real = require( '@stdlib/complex/float32/real' ); +import reim = require( '@stdlib/complex/float32/reim' ); +import reviveComplex64 = require( '@stdlib/complex/float32/reviver' ); /** -* Interface describing the namespace. +* Interface describing the `float32` namespace. */ interface Namespace { /** - * TODO + * Base (i.e., lower-level) single-precision complex number functions. + */ + base: typeof base; + + /** + * Returns the complex conjugate of a single-precision complex floating-point number. + * + * @param z - complex number + * @returns complex conjugate + * + * @example + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * var realf = require( '@stdlib/complex/float32/real' ); + * var imagf = require( '@stdlib/complex/float32/imag' ); + * + * var z = new Complex64( 5.0, 3.0 ); + * + * var v = ns.conj( z ); + * // returns + * + * var re = realf( v ); + * // returns 5.0 + * + * var im = imagf( v ); + * // returns -3.0 + */ + conj: typeof conj; + + /** + * 64-bit complex number. + */ + Complex64: typeof Complex64; + + /** + * Returns the imaginary component of a single-precision complex floating-point number. + * + * @param z - complex number + * @returns imaginary component + * + * @example + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var z = new Complex64( 5.0, 3.0 ); + * + * var im = ns.imag( z ); + * // returns 3.0 */ imag: typeof imag; + + /** + * Parse a string representation of a 64-bit complex number. + * + * @param str - string representation of a complex number + * @returns Complex64 instance + * @throws must provide a string recognized as a complex number + * + * @example + * var str = '5 + 3i'; + * + * var z = ns.parseComplex64( str ); + * // returns + */ + parseComplex64: typeof parseComplex64; + + /** + * 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 = ns.real( z ); + * // returns 5.0 + */ + real: typeof real; + + /** + * 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 = ns.reim( z ); + * // returns [ 5.0, 3.0 ] + */ + reim: typeof reim; + + /** + * Revives a JSON-serialized 64-bit complex number. + * + * @param key - key + * @param value - value + * @returns value or 64-bit complex number + * + * @example + * var parseJSON = require( '@stdlib/utils/parse-json' ); + * + * var str = '{"type":"Complex64","re":5,"im":3}'; + * + * var z = parseJSON( str, ns.reviveComplex64 ); + * // returns + */ + reviveComplex64: typeof reviveComplex64; } /** -* Single-precision complex floating-point number functions. +* Single-precision complex number functions. */ declare var ns: Namespace; diff --git a/lib/node_modules/@stdlib/complex/float64/base/assert/docs/types/index.d.ts b/lib/node_modules/@stdlib/complex/float64/base/assert/docs/types/index.d.ts index 2c004c03855..c6157ed97dd 100644 --- a/lib/node_modules/@stdlib/complex/float64/base/assert/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/complex/float64/base/assert/docs/types/index.d.ts @@ -21,19 +21,100 @@ /* eslint-disable max-lines */ import isEqual = require( '@stdlib/complex/float64/base/assert/is-equal' ); +import isNotEqual = require( '@stdlib/complex/float64/base/assert/is-not-equal' ); +import isSameValue = require( '@stdlib/complex/float64/base/assert/is-same-value' ); +import isSameValueZero = require( '@stdlib/complex/float64/base/assert/is-same-value-zero' ); /** -* Interface describing the namespace. +* Interface describing the `assert` namespace. */ interface Namespace { /** - * TODO + * Tests whether two double-precision complex floating-point numbers are equal. + * + * @param z1 - first complex number + * @param z2 - second complex number + * @returns boolean indicating if both complex numbers are equal + * + * @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 = ns.isEqual( z1, z2 ); + * // returns true */ isEqual: typeof isEqual; + + /** + * Tests whether two double-precision complex floating-point numbers are not equal. + * + * @param z1 - first complex number + * @param z2 - second complex number + * @returns boolean indicating if both complex numbers are not equal + * + * @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 = ns.isNotEqual( z1, z2 ); + * // returns true + */ + isNotEqual: typeof isNotEqual; + + /** + * Tests whether two double-precision complex floating-point numbers are the same value. + * + * ## Notes + * + * - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5. + * - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same. + * + * [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12 + * + * @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 = ns.isSameValue( z1, z2 ); + * // returns true + */ + isSameValue: typeof isSameValue; + + /** + * 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 = ns.isSameValueZero( z1, z2 ); + * // returns true + */ + isSameValueZero: typeof isSameValueZero; } /** -* Base (i.e., lower-level) double-precision complex floating-point number assertion functions. +* Base (i.e., lower-level) double-precision complex number assertion functions. */ declare var ns: Namespace; diff --git a/lib/node_modules/@stdlib/complex/float64/base/docs/types/index.d.ts b/lib/node_modules/@stdlib/complex/float64/base/docs/types/index.d.ts index 429ee5d98b9..f2865d3cdf6 100644 --- a/lib/node_modules/@stdlib/complex/float64/base/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/complex/float64/base/docs/types/index.d.ts @@ -21,19 +21,76 @@ /* eslint-disable max-lines */ import add = require( '@stdlib/complex/float64/base/add' ); +import assert = require( '@stdlib/complex/float64/base/assert' ); +import mul = require( '@stdlib/complex/float64/base/mul' ); /** -* Interface describing the namespace. +* Interface describing the `base` namespace. */ interface Namespace { /** - * TODO + * Adds two double-precision complex floating-point numbers. + * + * @param z1 - complex number + * @param z2 - complex number + * @returns result + * + * @example + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * var real = require( '@stdlib/complex/float64/real' ); + * var imag = require( '@stdlib/complex/float64/imag' ); + * + * var z = new Complex128( 5.0, 3.0 ); + * // returns + * + * var out = ns.add( z, z ); + * // returns + * + * var re = real( out ); + * // returns 10.0 + * + * var im = imag( out ); + * // returns 6.0 */ add: typeof add; + + /** + * Base (i.e., lower-level) double-precision complex number assertion functions. + */ + assert: typeof assert; + + /** + * Multiplies two double-precision complex floating-point numbers. + * + * @param z1 - complex number + * @param z2 - complex number + * @returns result + * + * @example + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * var real = require( '@stdlib/complex/float64/real' ); + * var imag = require( '@stdlib/complex/float64/imag' ); + * + * var z1 = new Complex128( 5.0, 3.0 ); + * // returns + * + * var z2 = new Complex128( -2.0, 1.0 ); + * // returns + * + * var out = ns.mul( z1, z2 ); + * // returns + * + * var re = real( out ); + * // returns -13.0 + * + * var im = imag( out ); + * // returns -1.0 + */ + mul: typeof mul; } /** -* Base (i.e., lower-level) double-precision complex floating-point number functions. +* Base (i.e., lower-level) double-precision complex number functions. */ declare var ns: Namespace; diff --git a/lib/node_modules/@stdlib/complex/float64/docs/types/index.d.ts b/lib/node_modules/@stdlib/complex/float64/docs/types/index.d.ts index f083837bc9a..67a3f27879b 100644 --- a/lib/node_modules/@stdlib/complex/float64/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/complex/float64/docs/types/index.d.ts @@ -20,20 +20,136 @@ /* eslint-disable max-lines */ +import base = require( '@stdlib/complex/float64/base' ); +import conj = require( '@stdlib/complex/float64/conj' ); +import Complex128 = require( '@stdlib/complex/float64/ctor' ); import imag = require( '@stdlib/complex/float64/imag' ); +import parseComplex128 = require( '@stdlib/complex/float64/parse' ); +import real = require( '@stdlib/complex/float64/real' ); +import reim = require( '@stdlib/complex/float64/reim' ); +import reviveComplex128 = require( '@stdlib/complex/float64/reviver' ); /** -* Interface describing the namespace. +* Interface describing the `float64` namespace. */ interface Namespace { /** - * TODO + * Base (i.e., lower-level) double-precision complex number functions. + */ + base: typeof base; + + /** + * Returns the complex conjugate of a double-precision complex floating-point number. + * + * @param z - complex number + * @returns complex conjugate + * + * @example + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * var real = require( '@stdlib/complex/float64/real' ); + * var imag = require( '@stdlib/complex/float64/imag' ); + * + * var z = new Complex128( 5.0, 3.0 ); + * + * var v = ns.conj( z ); + * // returns + * + * var re = real( v ); + * // returns 5.0 + * + * var im = imag( v ); + * // returns -3.0 + */ + conj: typeof conj; + + /** + * 128-bit complex number. + */ + Complex128: typeof Complex128; + + /** + * Returns the imaginary component of a double-precision complex floating-point number. + * + * @param z - complex number + * @returns imaginary component + * + * @example + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * + * var z = new Complex128( 5.0, 3.0 ); + * + * var im = ns.imag( z ); + * // returns 3.0 */ imag: typeof imag; + + /** + * Parse a string representation of a 128-bit complex number. + * + * @param str - string representation of a complex number + * @returns Complex128 instance + * @throws must provide a string recognized as a complex number + * + * @example + * var str = '5 + 3i'; + * + * var z = ns.parseComplex128( str ); + * // returns + */ + parseComplex128: typeof parseComplex128; + + /** + * Returns the real component of a double-precision complex floating-point number. + * + * @param z - complex number + * @returns real component + * + * @example + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * + * var z = new Complex128( 5.0, 3.0 ); + * + * var re = ns.real( z ); + * // returns 5.0 + */ + real: typeof real; + + /** + * Returns the real and imaginary components of a double-precision complex floating-point number. + * + * @param z - complex number + * @returns real and imaginary components + * + * @example + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * + * var z = new Complex128( 5.0, 3.0 ); + * + * var out = ns.reim( z ); + * // returns [ 5.0, 3.0 ] + */ + reim: typeof reim; + + /** + * Revives a JSON-serialized 128-bit complex number. + * + * @param key - key + * @param value - value + * @returns value or 128-bit complex number + * + * @example + * var parseJSON = require( '@stdlib/utils/parse-json' ); + * + * var str = '{"type":"Complex128","re":5,"im":3}'; + * + * var z = parseJSON( str, ns.reviveComplex128 ); + * // returns + */ + reviveComplex128: typeof reviveComplex128; } /** -* Double-precision complex floating-point number functions. +* Double-precision complex number functions. */ declare var ns: Namespace; diff --git a/lib/node_modules/@stdlib/math/base/ops/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/ops/docs/types/index.d.ts index 9f54a5aa166..7cb29ee2330 100644 --- a/lib/node_modules/@stdlib/math/base/ops/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/ops/docs/types/index.d.ts @@ -20,16 +20,16 @@ /* eslint-disable max-lines */ +import caddf = require( '@stdlib/complex/float32/base/add' ); +import cmulf = require( '@stdlib/complex/float32/base/mul' ); +import cadd = require( '@stdlib/complex/float64/base/add' ); +import cmul = require( '@stdlib/complex/float64/base/mul' ); import add = require( '@stdlib/math/base/ops/add' ); import add3 = require( '@stdlib/math/base/ops/add3' ); import add4 = require( '@stdlib/math/base/ops/add4' ); import add5 = require( '@stdlib/math/base/ops/add5' ); import addf = require( '@stdlib/math/base/ops/addf' ); -import cadd = require( '@stdlib/complex/float64/base/add' ); -import caddf = require( '@stdlib/complex/float32/base/add' ); import cdiv = require( '@stdlib/math/base/ops/cdiv' ); -import cmul = require( '@stdlib/complex/float64/base/mul' ); -import cmulf = require( '@stdlib/complex/float32/base/mul' ); import cneg = require( '@stdlib/math/base/ops/cneg' ); import cnegf = require( '@stdlib/math/base/ops/cnegf' ); import csub = require( '@stdlib/math/base/ops/csub' ); @@ -49,6 +49,116 @@ import umuldw = require( '@stdlib/math/base/ops/umuldw' ); * Interface describing the `ops` namespace. */ interface Namespace { + /** + * Adds two single-precision complex floating-point numbers. + * + * @param z1 - complex number + * @param z2 - complex number + * @returns result + * + * @example + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * var realf = require( '@stdlib/complex/float32/real' ); + * var imagf = require( '@stdlib/complex/float32/imag' ); + * + * var z = new Complex64( 5.0, 3.0 ); + * // returns + * + * var out = ns.caddf( z, z ); + * // returns + * + * var re = realf( out ); + * // returns 10.0 + * + * var im = imagf( out ); + * // returns 6.0 + */ + caddf: typeof caddf; + + /** + * Multiplies two single-precision complex floating-point numbers. + * + * @param z1 - complex number + * @param z2 - complex number + * @returns result + * + * @example + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * var realf = require( '@stdlib/complex/float32/real' ); + * var imagf = require( '@stdlib/complex/float32/imag' ); + * + * var z1 = new Complex64( 5.0, 3.0 ); + * // returns + * + * var z2 = new Complex64( -2.0, 1.0 ); + * // returns + * + * var out = ns.cmulf( z1, z2 ); + * // returns + * + * var re = realf( out ); + * // returns -13.0 + * + * var im = imagf( out ); + * // returns -1.0 + */ + cmulf: typeof cmulf; + + /** + * Adds two double-precision complex floating-point numbers. + * + * @param z1 - complex number + * @param z2 - complex number + * @returns result + * + * @example + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * var real = require( '@stdlib/complex/float64/real' ); + * var imag = require( '@stdlib/complex/float64/imag' ); + * + * var z = new Complex128( 5.0, 3.0 ); + * // returns + * + * var out = ns.cadd( z, z ); + * // returns + * + * var re = real( out ); + * // returns 10.0 + * + * var im = imag( out ); + * // returns 6.0 + */ + cadd: typeof cadd; + + /** + * Multiplies two double-precision complex floating-point numbers. + * + * @param z1 - complex number + * @param z2 - complex number + * @returns result + * + * @example + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * var real = require( '@stdlib/complex/float64/real' ); + * var imag = require( '@stdlib/complex/float64/imag' ); + * + * var z1 = new Complex128( 5.0, 3.0 ); + * // returns + * + * var z2 = new Complex128( -2.0, 1.0 ); + * // returns + * + * var out = ns.cmul( z1, z2 ); + * // returns + * + * var re = real( out ); + * // returns -13.0 + * + * var im = imag( out ); + * // returns -1.0 + */ + cmul: typeof cmul; + /** * Computes the sum of two double-precision floating-point numbers `x` and `y`. * @@ -200,58 +310,6 @@ interface Namespace { */ addf: typeof addf; - /** - * Adds two double-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex128 = require( '@stdlib/complex/float64/ctor' ); - * var real = require( '@stdlib/complex/float64/real' ); - * var imag = require( '@stdlib/complex/float64/imag' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * // returns - * - * var out = ns.cadd( z, z ); - * // returns - * - * var re = real( out ); - * // returns 10.0 - * - * var im = imag( out ); - * // returns 6.0 - */ - cadd: typeof cadd; - - /** - * Adds two single-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex64 = require( '@stdlib/complex/float32/ctor' ); - * var realf = require( '@stdlib/complex/float32/real' ); - * var imagf = require( '@stdlib/complex/float32/imag' ); - * - * var z = new Complex64( 5.0, 3.0 ); - * // returns - * - * var out = ns.caddf( z, z ); - * // returns - * - * var re = realf( out ); - * // returns 10.0 - * - * var im = imagf( out ); - * // returns 6.0 - */ - caddf: typeof caddf; - /** * Divides two double-precision complex floating-point numbers. * @@ -281,64 +339,6 @@ interface Namespace { */ cdiv: typeof cdiv; - /** - * Multiplies two double-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex128 = require( '@stdlib/complex/float64/ctor' ); - * var real = require( '@stdlib/complex/float64/real' ); - * var imag = require( '@stdlib/complex/float64/imag' ); - * - * var z1 = new Complex128( 5.0, 3.0 ); - * // returns - * - * var z2 = new Complex128( -2.0, 1.0 ); - * // returns - * - * var out = ns.cmul( z1, z2 ); - * // returns - * - * var re = real( out ); - * // returns -13.0 - * - * var im = imag( out ); - * // returns -1.0 - */ - cmul: typeof cmul; - - /** - * Multiplies two single-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex64 = require( '@stdlib/complex/float32/ctor' ); - * var realf = require( '@stdlib/complex/float32/real' ); - * var imagf = require( '@stdlib/complex/float32/imag' ); - * - * var z1 = new Complex64( 5.0, 3.0 ); - * // returns - * - * var z2 = new Complex64( -2.0, 1.0 ); - * // returns - * - * var out = ns.cmulf( z1, z2 ); - * // returns - * - * var re = realf( out ); - * // returns -13.0 - * - * var im = imagf( out ); - * // returns -1.0 - */ - cmulf: typeof cmulf; - /** * Negates a double-precision complex floating-point number. *