2222
2323import add = require( '@stdlib/complex/float32/base/add' ) ;
2424import assert = require( '@stdlib/complex/float32/base/assert' ) ;
25+ import identity = require( '@stdlib/complex/float32/base/identity' ) ;
2526import mul = require( '@stdlib/complex/float32/base/mul' ) ;
27+ import neg = require( '@stdlib/complex/float32/base/neg' ) ;
28+ import scale = require( '@stdlib/complex/float32/base/scale' ) ;
29+ import sub = require( '@stdlib/complex/float32/base/sub' ) ;
2630
2731/**
2832* Interface describing the `base` namespace.
@@ -37,20 +41,30 @@ interface Namespace {
3741 *
3842 * @example
3943 * var Complex64 = require( '@stdlib/complex/float32/ctor' );
40- * var realf = require( '@stdlib/complex/float32/real' );
41- * var imagf = require( '@stdlib/complex/float32/imag' );
4244 *
4345 * var z = new Complex64( 5.0, 3.0 );
44- * // returns <Complex64>
4546 *
4647 * var out = ns.add( z, z );
47- * // returns <Complex64>
48+ * // returns <Complex64>[ 10.0, 6.0 ]
4849 *
49- * var re = realf( out );
50- * // returns 10.0
50+ * @example
51+ * var Float32Array = require( '@stdlib/array/float32' );
52+ *
53+ * var out = new Float32Array( 2 );
54+ * var v = ns.add.assign( 5.0, 3.0, 5.0, 3.0, out, 1, 0 );
55+ * // returns <Float32Array>[ 10.0, 6.0 ]
5156 *
52- * var im = imagf( out );
53- * // returns 6.0
57+ * var bool = ( out === v );
58+ * // returns true
59+ *
60+ * @example
61+ * var Float32Array = require( '@stdlib/array/float32' );
62+ *
63+ * var z1 = new Float32Array( [ 5.0, 3.0 ] );
64+ * var z2 = new Float32Array( [ 5.0, 3.0 ] );
65+ *
66+ * var out = ns.add.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 );
67+ * // returns <Float32Array>[ 10.0, 6.0 ]
5468 */
5569 add : typeof add ;
5670
@@ -59,6 +73,20 @@ interface Namespace {
5973 */
6074 assert : typeof assert ;
6175
76+ /**
77+ * Evaluates the identity function for single-precision complex floating-point number.
78+ *
79+ * @param z - input value
80+ * @returns input value
81+ *
82+ * @example
83+ * var Complex64 = require( '@stdlib/complex/float32/ctor' );
84+ *
85+ * var v = ns.identity( new Complex64( -1.0, 2.0 ) );
86+ * // returns <Complex64>[ -1.0, 2.0 ]
87+ */
88+ identity : typeof identity ;
89+
6290 /**
6391 * Multiplies two single-precision complex floating-point numbers.
6492 *
@@ -68,23 +96,12 @@ interface Namespace {
6896 *
6997 * @example
7098 * var Complex64 = require( '@stdlib/complex/float32/ctor' );
71- * var realf = require( '@stdlib/complex/float32/real' );
72- * var imagf = require( '@stdlib/complex/float32/imag' );
7399 *
74100 * var z1 = new Complex64( 5.0, 3.0 );
75- * // returns <Complex64>
76- *
77101 * var z2 = new Complex64( -2.0, 1.0 );
78- * // returns <Complex64>
79102 *
80103 * var out = ns.mul( z1, z2 );
81- * // returns <Complex64>
82- *
83- * var re = realf( out );
84- * // returns -13.0
85- *
86- * var im = imagf( out );
87- * // returns -1.0
104+ * // returns <Complex64>[ -13.0, -1.0 ]
88105 *
89106 * @example
90107 * var Float32Array = require( '@stdlib/array/float32' );
@@ -106,6 +123,91 @@ interface Namespace {
106123 * // returns <Float32Array>[ -13.0, -1.0 ]
107124 */
108125 mul : typeof mul ;
126+
127+ /**
128+ * Negates a single-precision complex floating-point number.
129+ *
130+ * @param z - complex number
131+ * @returns result
132+ *
133+ * @example
134+ * var Complex64 = require( '@stdlib/complex/float32/ctor' );
135+ *
136+ * var z = new Complex64( -4.2, 5.5 );
137+ *
138+ * var out = ns.neg( z );
139+ * // returns <Complex64>[ ~4.2, -5.5 ]
140+ *
141+ * @example
142+ * var Complex64 = require( '@stdlib/complex/float32/ctor' );
143+ *
144+ * var z = new Complex64( 0.0, 0.0 );
145+ *
146+ * var out = ns.neg( z );
147+ * // returns <Complex64>[ -0.0, -0.0 ]
148+ *
149+ * @example
150+ * var Complex64 = require( '@stdlib/complex/float32/ctor' );
151+ *
152+ * var z = new Complex64( NaN, NaN );
153+ *
154+ * var out = ns.neg( z );
155+ * // returns <Complex64>[ NaN, NaN ]
156+ */
157+ neg : typeof neg ;
158+
159+ /**
160+ * Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant.
161+ *
162+ * @param alpha - scalar constant
163+ * @param z - complex number
164+ * @returns result
165+ *
166+ * @example
167+ * var Complex64 = require( '@stdlib/complex/float32/ctor' );
168+ *
169+ * var z = new Complex64( 5.0, 3.0 );
170+ *
171+ * var out = ns.scale( 5.0, z );
172+ * // returns <Complex64>[ 25.0, 15.0 ]
173+ *
174+ * @example
175+ * var Float32Array = require( '@stdlib/array/float32' );
176+ *
177+ * var out = new Float32Array( 2 );
178+ * var v = ns.scale.assign( 5.0, 5.0, 3.0, out, 1, 0 );
179+ * // returns <Float32Array>[ 25.0, 15.0 ]
180+ *
181+ * var bool = ( out === v );
182+ * // returns true
183+ *
184+ * @example
185+ * var Float32Array = require( '@stdlib/array/float32' );
186+ *
187+ * var z = new Float32Array( [ 5.0, 3.0 ] );
188+ *
189+ * var out = ns.scale.strided( 5.0, z, 1, 0, new Float32Array( 2 ), 1, 0 );
190+ * // returns <Float32Array>[ 25.0, 15.0 ]
191+ */
192+ scale : typeof scale ;
193+
194+ /**
195+ * Subtracts two single-precision complex floating-point numbers.
196+ *
197+ * @param z1 - complex number
198+ * @param z2 - complex number
199+ * @returns result
200+ *
201+ * @example
202+ * var Complex64 = require( '@stdlib/complex/float32/ctor' );
203+ *
204+ * var z1 = new Complex64( 5.0, 3.0 );
205+ * var z2 = new Complex64( -2.0, 1.0 );
206+ *
207+ * var out = ns.sub( z1, z2 );
208+ * // returns <Complex64>[ 7.0, 2.0 ]
209+ */
210+ sub : typeof sub ;
109211}
110212
111213/**
0 commit comments