|
20 | 20 |
|
21 | 21 | /* eslint-disable max-lines */ |
22 | 22 |
|
| 23 | +import base = require( '@stdlib/complex-float64-base' ); |
| 24 | +import conj = require( '@stdlib/complex-float64-conj' ); |
| 25 | +import Complex128 = require( '@stdlib/complex-float64-ctor' ); |
23 | 26 | import imag = require( '@stdlib/complex-float64-imag' ); |
| 27 | +import parseComplex128 = require( '@stdlib/complex-float64-parse' ); |
| 28 | +import real = require( '@stdlib/complex-float64-real' ); |
| 29 | +import reim = require( '@stdlib/complex-float64-reim' ); |
| 30 | +import reviveComplex128 = require( '@stdlib/complex-float64-reviver' ); |
24 | 31 |
|
25 | 32 | /** |
26 | | -* Interface describing the namespace. |
| 33 | +* Interface describing the `float64` namespace. |
27 | 34 | */ |
28 | 35 | interface Namespace { |
29 | 36 | /** |
30 | | - * TODO |
| 37 | + * Base (i.e., lower-level) double-precision complex number functions. |
| 38 | + */ |
| 39 | + base: typeof base; |
| 40 | + |
| 41 | + /** |
| 42 | + * Returns the complex conjugate of a double-precision complex floating-point number. |
| 43 | + * |
| 44 | + * @param z - complex number |
| 45 | + * @returns complex conjugate |
| 46 | + * |
| 47 | + * @example |
| 48 | + * var Complex128 = require( '@stdlib/complex-float64-ctor' ); |
| 49 | + * var real = require( '@stdlib/complex-float64-real' ); |
| 50 | + * var imag = require( '@stdlib/complex-float64-imag' ); |
| 51 | + * |
| 52 | + * var z = new Complex128( 5.0, 3.0 ); |
| 53 | + * |
| 54 | + * var v = ns.conj( z ); |
| 55 | + * // returns <Complex128> |
| 56 | + * |
| 57 | + * var re = real( v ); |
| 58 | + * // returns 5.0 |
| 59 | + * |
| 60 | + * var im = imag( v ); |
| 61 | + * // returns -3.0 |
| 62 | + */ |
| 63 | + conj: typeof conj; |
| 64 | + |
| 65 | + /** |
| 66 | + * 128-bit complex number. |
| 67 | + */ |
| 68 | + Complex128: typeof Complex128; |
| 69 | + |
| 70 | + /** |
| 71 | + * Returns the imaginary component of a double-precision complex floating-point number. |
| 72 | + * |
| 73 | + * @param z - complex number |
| 74 | + * @returns imaginary component |
| 75 | + * |
| 76 | + * @example |
| 77 | + * var Complex128 = require( '@stdlib/complex-float64-ctor' ); |
| 78 | + * |
| 79 | + * var z = new Complex128( 5.0, 3.0 ); |
| 80 | + * |
| 81 | + * var im = ns.imag( z ); |
| 82 | + * // returns 3.0 |
31 | 83 | */ |
32 | 84 | imag: typeof imag; |
| 85 | + |
| 86 | + /** |
| 87 | + * Parse a string representation of a 128-bit complex number. |
| 88 | + * |
| 89 | + * @param str - string representation of a complex number |
| 90 | + * @returns Complex128 instance |
| 91 | + * @throws must provide a string recognized as a complex number |
| 92 | + * |
| 93 | + * @example |
| 94 | + * var str = '5 + 3i'; |
| 95 | + * |
| 96 | + * var z = ns.parseComplex128( str ); |
| 97 | + * // returns <Complex128> |
| 98 | + */ |
| 99 | + parseComplex128: typeof parseComplex128; |
| 100 | + |
| 101 | + /** |
| 102 | + * Returns the real component of a double-precision complex floating-point number. |
| 103 | + * |
| 104 | + * @param z - complex number |
| 105 | + * @returns real component |
| 106 | + * |
| 107 | + * @example |
| 108 | + * var Complex128 = require( '@stdlib/complex-float64-ctor' ); |
| 109 | + * |
| 110 | + * var z = new Complex128( 5.0, 3.0 ); |
| 111 | + * |
| 112 | + * var re = ns.real( z ); |
| 113 | + * // returns 5.0 |
| 114 | + */ |
| 115 | + real: typeof real; |
| 116 | + |
| 117 | + /** |
| 118 | + * Returns the real and imaginary components of a double-precision complex floating-point number. |
| 119 | + * |
| 120 | + * @param z - complex number |
| 121 | + * @returns real and imaginary components |
| 122 | + * |
| 123 | + * @example |
| 124 | + * var Complex128 = require( '@stdlib/complex-float64-ctor' ); |
| 125 | + * |
| 126 | + * var z = new Complex128( 5.0, 3.0 ); |
| 127 | + * |
| 128 | + * var out = ns.reim( z ); |
| 129 | + * // returns <Float64Array>[ 5.0, 3.0 ] |
| 130 | + */ |
| 131 | + reim: typeof reim; |
| 132 | + |
| 133 | + /** |
| 134 | + * Revives a JSON-serialized 128-bit complex number. |
| 135 | + * |
| 136 | + * @param key - key |
| 137 | + * @param value - value |
| 138 | + * @returns value or 128-bit complex number |
| 139 | + * |
| 140 | + * @example |
| 141 | + * var parseJSON = require( '@stdlib/utils-parse-json' ); |
| 142 | + * |
| 143 | + * var str = '{"type":"Complex128","re":5,"im":3}'; |
| 144 | + * |
| 145 | + * var z = parseJSON( str, ns.reviveComplex128 ); |
| 146 | + * // returns <Complex128> |
| 147 | + */ |
| 148 | + reviveComplex128: typeof reviveComplex128; |
33 | 149 | } |
34 | 150 |
|
35 | 151 | /** |
36 | | -* Double-precision complex floating-point number functions. |
| 152 | +* Double-precision complex number functions. |
37 | 153 | */ |
38 | 154 | declare var ns: Namespace; |
39 | 155 |
|
|
0 commit comments