Skip to content

Commit 9b9d336

Browse files
committed
Auto-generated commit
1 parent 9171008 commit 9b9d336

6 files changed

Lines changed: 26 additions & 582 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ A total of 33 issues were closed in this release:
256256

257257
<details>
258258

259+
- [`f223373`](https://github.com/stdlib-js/stdlib/commit/f223373e1c5b86f2ba763cb92472b03096485604) - **chore:** simplify declarations _(by Athan Reines)_
260+
- [`d22a58e`](https://github.com/stdlib-js/stdlib/commit/d22a58eaa5cea695ecb9809f85edea36d1199c74) - **refactor:** simplify declarations _(by Athan Reines)_
261+
- [`b66cf8e`](https://github.com/stdlib-js/stdlib/commit/b66cf8efdf5b793040fce1236fa3adcdcd5067a7) - **docs:** update examples _(by Athan Reines)_
262+
- [`eb00b1b`](https://github.com/stdlib-js/stdlib/commit/eb00b1b80848018e05fbc2a20d5985e747557977) - **docs:** fix example _(by Athan Reines)_
259263
- [`985e111`](https://github.com/stdlib-js/stdlib/commit/985e1117c5836c62d3d9fca351c4815cfa099913) - **docs:** refactor example _(by Athan Reines)_
260264
- [`c520b5a`](https://github.com/stdlib-js/stdlib/commit/c520b5a0cae0c85e946f8a646e7cc8c01b3b5673) - **docs:** address TSDoc lint errors and add doctest aliases _(by Philipp Burckhardt)_
261265
- [`3f7b1ed`](https://github.com/stdlib-js/stdlib/commit/3f7b1ed405cdb77a3357d424f462e8d3b2276df5) - **docs:** fix code in TSDoc examples _(by Philipp Burckhardt)_

base/copy/README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ var bool = ( out === x );
7676

7777
```javascript
7878
var Complex64Array = require( '@stdlib/array/complex64' );
79-
var realf = require( '@stdlib/complex/float32/real' );
80-
var imagf = require( '@stdlib/complex/float32/imag' );
8179
var copy = require( '@stdlib/array/base/copy' );
8280

8381
// Create a complex number array:
@@ -88,15 +86,9 @@ var out = copy( arr );
8886

8987
// Retrieve the first element:
9088
var z = out[ 0 ];
91-
// returns <Complex64>
89+
// returns <Complex64>[ 0.0, 0.0 ]
9290

93-
var re = realf( z );
94-
// returns 0.0
95-
96-
var im = imagf( z );
97-
// returns 0.0
98-
99-
console.log( '%d + %di', re, im );
91+
console.log( '%s', z.toString() );
10092
// => '0 + 0i'
10193
```
10294

base/copy/examples/index.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
'use strict';
2020

2121
var Complex64Array = require( './../../../complex64' );
22-
var realf = require( '@stdlib/complex/float32/real' );
23-
var imagf = require( '@stdlib/complex/float32/imag' );
2422
var copy = require( './../lib' );
2523

2624
// Create a complex number array:
@@ -31,13 +29,7 @@ var out = copy( arr );
3129

3230
// Retrieve the first element:
3331
var z = out[ 0 ];
34-
// returns <Complex64>
32+
// returns <Complex64>[ 0.0, 0.0 ]
3533

36-
var re = realf( z );
37-
// returns 0.0
38-
39-
var im = imagf( z );
40-
// returns 0.0
41-
42-
console.log( '%d + %di', re, im );
34+
console.log( '%s', z.toString() );
4335
// => '0 + 0i'

base/one-to/docs/types/index.d.ts

Lines changed: 7 additions & 276 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { Collection, AccessorArrayLike, Complex128Array, Complex64Array } from '@stdlib/types/array';
23+
import { Collection, AccessorArrayLike } from '@stdlib/types/array';
24+
25+
/**
26+
* Input array.
27+
*/
28+
type InputArray<T> = Collection<T> | AccessorArrayLike<T>;
2429

2530
/**
2631
* Interface describing `oneTo`.
@@ -54,281 +59,7 @@ interface ZeroTo {
5459
* var arr = oneTo.assign( out, 1, 0 );
5560
* // returns <Float64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
5661
*/
57-
assign( out: Float64Array, stride: number, offset: number ): Float64Array;
58-
59-
/**
60-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
61-
*
62-
* @param out - output array
63-
* @param stride - output array stride
64-
* @param offset - output array index offset
65-
* @returns output array
66-
*
67-
* @example
68-
* var Float32Array = require( './../../../../float32' );
69-
*
70-
* var out = new Float32Array( 6 );
71-
*
72-
* var arr = oneTo.assign( out, 1, 0 );
73-
* // returns <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
74-
*/
75-
assign( out: Float32Array, stride: number, offset: number ): Float32Array;
76-
77-
/**
78-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
79-
*
80-
* @param out - output array
81-
* @param stride - output array stride
82-
* @param offset - output array index offset
83-
* @returns output array
84-
*
85-
* @example
86-
* var Int32Array = require( './../../../../int32' );
87-
*
88-
* var out = new Int32Array( 6 );
89-
*
90-
* var arr = oneTo.assign( out, 1, 0 );
91-
* // returns <Int32Array>[ 1, 2, 3, 4, 5, 6 ]
92-
*/
93-
assign( out: Int32Array, stride: number, offset: number ): Int32Array;
94-
95-
/**
96-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
97-
*
98-
* @param out - output array
99-
* @param stride - output array stride
100-
* @param offset - output array index offset
101-
* @returns output array
102-
*
103-
* @example
104-
* var Int16Array = require( './../../../../int16' );
105-
*
106-
* var out = new Int16Array( 6 );
107-
*
108-
* var arr = oneTo.assign( out, 1, 0 );
109-
* // returns <Int16Array>[ 1, 2, 3, 4, 5, 6 ]
110-
*/
111-
assign( out: Int16Array, stride: number, offset: number ): Int16Array;
112-
113-
/**
114-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
115-
*
116-
* @param out - output array
117-
* @param stride - output array stride
118-
* @param offset - output array index offset
119-
* @returns output array
120-
*
121-
* @example
122-
* var Int8Array = require( './../../../../int8' );
123-
*
124-
* var out = new Int8Array( 6 );
125-
*
126-
* var arr = oneTo.assign( out, 1, 0 );
127-
* // returns <Int8Array>[ 1, 2, 3, 4, 5, 6 ]
128-
*/
129-
assign( out: Int8Array, stride: number, offset: number ): Int8Array;
130-
131-
/**
132-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
133-
*
134-
* @param out - output array
135-
* @param stride - output array stride
136-
* @param offset - output array index offset
137-
* @returns output array
138-
*
139-
* @example
140-
* var Uint32Array = require( './../../../../uint32' );
141-
*
142-
* var out = new Uint32Array( 6 );
143-
*
144-
* var arr = oneTo.assign( out, 1, 0 );
145-
* // returns <Uint32Array>[ 1, 2, 3, 4, 5, 6 ]
146-
*/
147-
assign( out: Uint32Array, stride: number, offset: number ): Uint32Array;
148-
149-
/**
150-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
151-
*
152-
* @param out - output array
153-
* @param stride - output array stride
154-
* @param offset - output array index offset
155-
* @returns output array
156-
*
157-
* @example
158-
* var Uint16Array = require( './../../../../uint16' );
159-
*
160-
* var out = new Uint16Array( 6 );
161-
*
162-
* var arr = oneTo.assign( out, 1, 0 );
163-
* // returns <Uint16Array>[ 1, 2, 3, 4, 5, 6 ]
164-
*/
165-
assign( out: Uint16Array, stride: number, offset: number ): Uint16Array;
166-
167-
/**
168-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
169-
*
170-
* @param out - output array
171-
* @param stride - output array stride
172-
* @param offset - output array index offset
173-
* @returns output array
174-
*
175-
* @example
176-
* var Uint8Array = require( './../../../../uint8' );
177-
*
178-
* var out = new Uint8Array( 6 );
179-
*
180-
* var arr = oneTo.assign( out, 1, 0 );
181-
* // returns <Uint8Array>[ 1, 2, 3, 4, 5, 6 ]
182-
*/
183-
assign( out: Uint8Array, stride: number, offset: number ): Uint8Array;
184-
185-
/**
186-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
187-
*
188-
* @param out - output array
189-
* @param stride - output array stride
190-
* @param offset - output array index offset
191-
* @returns output array
192-
*
193-
* @example
194-
* var Uint8ClampedArray = require( './../../../../uint8c' );
195-
*
196-
* var out = new Uint8ClampedArray( 6 );
197-
*
198-
* var arr = oneTo.assign( out, 1, 0 );
199-
* // returns <Uint8ClampedArray>[ 1, 2, 3, 4, 5, 6 ]
200-
*/
201-
assign( out: Uint8ClampedArray, stride: number, offset: number ): Uint8ClampedArray;
202-
203-
/**
204-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
205-
*
206-
* @param out - output array
207-
* @param stride - output array stride
208-
* @param offset - output array index offset
209-
* @returns output array
210-
*
211-
* @example
212-
* var Complex128Array = require( './../../../../complex128' );
213-
* var real = require( '@stdlib/complex/float64/real' );
214-
* var imag = require( '@stdlib/complex/float64/imag' );
215-
*
216-
* var out = new Complex128Array( 6 );
217-
*
218-
* var arr = oneTo.assign( out, 1, 0 );
219-
* // returns <Complex128Array>
220-
*
221-
* var bool = ( arr === out );
222-
* // returns true
223-
*
224-
* var v = out.get( out.length-1 );
225-
* // returns <Complex128>
226-
*
227-
* var re = real( v );
228-
* // returns 6.0
229-
*
230-
* var im = imag( v );
231-
* // returns 0.0
232-
*/
233-
assign( out: Complex128Array, stride: number, offset: number ): Complex128Array;
234-
235-
/**
236-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
237-
*
238-
* @param out - output array
239-
* @param stride - output array stride
240-
* @param offset - output array index offset
241-
* @returns output array
242-
*
243-
* @example
244-
* var Complex64Array = require( './../../../../complex64' );
245-
* var realf = require( '@stdlib/complex/float32/real' );
246-
* var imagf = require( '@stdlib/complex/float32/imag' );
247-
*
248-
* var out = new Complex64Array( 6 );
249-
*
250-
* var arr = oneTo.assign( out, 1, 0 );
251-
* // returns <Complex64Array>
252-
*
253-
* var bool = ( arr === out );
254-
* // returns true
255-
*
256-
* var v = out.get( out.length-1 );
257-
* // returns <Complex64>
258-
*
259-
* var re = realf( v );
260-
* // returns 6.0
261-
*
262-
* var im = imagf( v );
263-
* // returns 0.0
264-
*/
265-
assign( out: Complex64Array, stride: number, offset: number ): Complex64Array;
266-
267-
/**
268-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
269-
*
270-
* @param out - output array
271-
* @param stride - output array stride
272-
* @param offset - output array index offset
273-
* @returns output array
274-
*
275-
* @example
276-
* var toAccessorArray = require( './../../../../base/to-accessor-array' );
277-
*
278-
* var out = toAccessorArray( [ 0, 0, 0, 0, 0, 0 ] );
279-
* var arr = oneTo.assign( out, 1, 0 );
280-
*
281-
* var bool = ( arr === out );
282-
* // returns true
283-
*
284-
* var v = out.get( out.length-1 );
285-
* // returns 6
286-
*/
287-
assign<T = unknown>( out: AccessorArrayLike<T>, stride: number, offset: number ): AccessorArrayLike<T>;
288-
289-
/**
290-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
291-
*
292-
* @param out - output array
293-
* @param stride - output array stride
294-
* @param offset - output array index offset
295-
* @returns output array
296-
*
297-
* @example
298-
* var out = [ 0, 0, 0, 0, 0, 0 ];
299-
*
300-
* var arr = oneTo.assign( out, 1, 0 );
301-
* // returns [ 1, 2, 3, 4, 5, 6 ]
302-
*
303-
* @example
304-
* var out = [ 0, 0, 0, 0, 0, 0 ];
305-
*
306-
* var arr = oneTo.assign( out, -1, out.length-1 );
307-
* // returns [ 6, 5, 4, 3, 2, 1 ]
308-
*/
309-
assign<T = unknown>( out: Array<T>, stride: number, offset: number ): Array<T | number>;
310-
311-
/**
312-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from one.
313-
*
314-
* @param out - output array
315-
* @param stride - output array stride
316-
* @param offset - output array index offset
317-
* @returns output array
318-
*
319-
* @example
320-
* var out = [ 0, 0, 0, 0, 0, 0 ];
321-
*
322-
* var arr = oneTo.assign( out, 1, 0 );
323-
* // returns [ 1, 2, 3, 4, 5, 6 ]
324-
*
325-
* @example
326-
* var out = [ 0, 0, 0, 0, 0, 0 ];
327-
*
328-
* var arr = oneTo.assign( out, -1, out.length-1 );
329-
* // returns [ 6, 5, 4, 3, 2, 1 ]
330-
*/
331-
assign<T = unknown>( out: Collection<T>, stride: number, offset: number ): Collection<T | number>;
62+
assign<T = unknown, U extends InputArray<T> = InputArray<T>>( out: U, stride: number, offset: number ): U;
33263
}
33364

33465
/**

base/one-to/lib/assign.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,17 @@ function indexed( out, stride, offset ) {
7575
* @returns {(Complex128Array|Complex64Array)} output array
7676
*
7777
* @example
78-
* var Complex128Array = require( '@stdlib/array/complex128' );
7978
* var reinterpret128 = require( '@stdlib/strided/base/reinterpret-complex128' );
79+
* var Complex128Array = require( '@stdlib/array/complex128' );
8080
*
8181
* var out = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
82-
* // returns <Complex128Array>
82+
* // returns <Complex128Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]
8383
*
84-
* var data = reinterpret128( out, 0 );
85-
* // returns <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]
86-
*
87-
* var arr = complex( out, data, 1, 0 );
88-
* // returns <Complex128Array>
84+
* var arr = complex( out, reinterpret128( out, 0 ), 1, 0 );
85+
* // returns <Complex128Array>[ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ]
8986
*
9087
* var bool = ( arr === out );
9188
* // returns true
92-
*
93-
* data = reinterpret128( out, 0 );
94-
* returns <Float64Array>[ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ]
9589
*/
9690
function complex( out, data, stride, offset ) {
9791
var v;

0 commit comments

Comments
 (0)