|
22 | 22 |
|
23 | 23 | /* eslint-disable max-lines */ |
24 | 24 |
|
25 | | -import { typedndarray, DataType, Order, float64ndarray, float32ndarray, complex128ndarray, complex64ndarray, int32ndarray, int16ndarray, int8ndarray, uint32ndarray, uint16ndarray, uint8ndarray, uint8cndarray, boolndarray, genericndarray } from '@stdlib/types/ndarray'; |
| 25 | +import { typedndarray, float64ndarray, float32ndarray, complex128ndarray, complex64ndarray, int32ndarray, int16ndarray, int8ndarray, uint32ndarray, uint16ndarray, uint8ndarray, uint8cndarray, boolndarray, genericndarray } from '@stdlib/types/ndarray'; |
26 | 26 |
|
27 | 27 | /** |
28 | 28 | * Returns a boolean indicating whether an element passes a test. |
@@ -96,337 +96,7 @@ type Predicate<T, V> = Nullary<V> | Unary<T, V> | Binary<T, V> | Ternary<T, V>; |
96 | 96 | * var y = every( x, isEven ); |
97 | 97 | * // returns true |
98 | 98 | */ |
99 | | -declare function every<V = unknown>( x: float64ndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
100 | | - |
101 | | -/** |
102 | | -* Return a boolean indicating whether every element in the ndarray passes a test implemented by a predicate function. |
103 | | -* |
104 | | -* @param x - input ndarray |
105 | | -* @param predicate - predicate function |
106 | | -* @param thisArg - predicate function execution context |
107 | | -* @returns output ndarray |
108 | | -* |
109 | | -* @example |
110 | | -* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; |
111 | | -* var Float32Array = require( '@stdlib/array/float32' ); |
112 | | -* var ndarray = require( '@stdlib/ndarray/ctor' ); |
113 | | -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); |
114 | | -* |
115 | | -* var buffer = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); |
116 | | -* var shape = [ 2, 3 ]; |
117 | | -* var strides = [ 6, 2 ]; |
118 | | -* var offset = 1; |
119 | | -* |
120 | | -* var x = ndarray( 'float32', buffer, shape, strides, offset, 'row-major' ); |
121 | | -* // returns <ndarray> |
122 | | -* |
123 | | -* var arr = ndarray2array( x ); |
124 | | -* // returns [ [ 2.0, 4.0, 6.0 ], [ 8.0, 10.0, 12.0 ] ] |
125 | | -* |
126 | | -* var y = every( x, isEven ); |
127 | | -* // returns true |
128 | | -*/ |
129 | | -declare function every<V = unknown>( x: float32ndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
130 | | - |
131 | | -/** |
132 | | -* Return a boolean indicating whether every element in the ndarray passes a test implemented by a predicate function. |
133 | | -* |
134 | | -* @param x - input ndarray |
135 | | -* @param predicate - predicate function |
136 | | -* @param thisArg - predicate function execution context |
137 | | -* @returns output ndarray |
138 | | -* |
139 | | -* @example |
140 | | -* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; |
141 | | -* var Complex64Array = require( '@stdlib/array/complex64' ); |
142 | | -* var ndarray = require( '@stdlib/ndarray/ctor' ); |
143 | | -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); |
144 | | -* |
145 | | -* var buffer = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); |
146 | | -* var shape = [ 2, 3 ]; |
147 | | -* var strides = [ 6, 2 ]; |
148 | | -* var offset = 1; |
149 | | -* |
150 | | -* var x = ndarray( 'complex64', buffer, shape, strides, offset, 'row-major' ); |
151 | | -* // returns <ndarray> |
152 | | -* |
153 | | -* var arr = ndarray2array( x ); |
154 | | -* // returns [ [ 2.0, 4.0, 6.0 ], [ 8.0, 10.0, 12.0 ] ] |
155 | | -* |
156 | | -* var y = every( x, isEven ); |
157 | | -* // returns true |
158 | | -*/ |
159 | | -declare function every<V = unknown>( x: complex64ndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
160 | | - |
161 | | -/** |
162 | | -* Return a boolean indicating whether every element in the ndarray passes a test implemented by a predicate function. |
163 | | -* |
164 | | -* @param x - input ndarray |
165 | | -* @param predicate - predicate function |
166 | | -* @param thisArg - predicate function execution context |
167 | | -* @returns output ndarray |
168 | | -* |
169 | | -* @example |
170 | | -* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; |
171 | | -* var Complex128Array = require( '@stdlib/array/complex128' ); |
172 | | -* var ndarray = require( '@stdlib/ndarray/ctor' ); |
173 | | -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); |
174 | | -* |
175 | | -* var buffer = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); |
176 | | -* var shape = [ 2, 3 ]; |
177 | | -* var strides = [ 6, 2 ]; |
178 | | -* var offset = 1; |
179 | | -* |
180 | | -* var x = ndarray( 'complex128', buffer, shape, strides, offset, 'row-major' ); |
181 | | -* // returns <ndarray> |
182 | | -* |
183 | | -* var arr = ndarray2array( x ); |
184 | | -* // returns [ [ 2.0, 4.0, 6.0 ], [ 8.0, 10.0, 12.0 ] ] |
185 | | -* |
186 | | -* var y = every( x, isEven ); |
187 | | -* // returns true |
188 | | -*/ |
189 | | -declare function every<V = unknown>( x: complex128ndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
190 | | - |
191 | | -/** |
192 | | -* Return a boolean indicating whether every element in the ndarray passes a test implemented by a predicate function. |
193 | | -* |
194 | | -* @param x - input ndarray |
195 | | -* @param predicate - predicate function |
196 | | -* @param thisArg - predicate function execution context |
197 | | -* @returns output ndarray |
198 | | -* |
199 | | -* @example |
200 | | -* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; |
201 | | -* var Int32Array = require( '@stdlib/array/int32' ); |
202 | | -* var ndarray = require( '@stdlib/ndarray/ctor' ); |
203 | | -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); |
204 | | -* |
205 | | -* var buffer = new Int32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); |
206 | | -* var shape = [ 2, 3 ]; |
207 | | -* var strides = [ 6, 2 ]; |
208 | | -* var offset = 1; |
209 | | -* |
210 | | -* var x = ndarray( 'int32', buffer, shape, strides, offset, 'row-major' ); |
211 | | -* // returns <ndarray> |
212 | | -* |
213 | | -* var arr = ndarray2array( x ); |
214 | | -* // returns [ [ 2.0, 4.0, 6.0 ], [ 8.0, 10.0, 12.0 ] ] |
215 | | -* |
216 | | -* var y = every( x, isEven ); |
217 | | -* // returns true |
218 | | -*/ |
219 | | -declare function every<V = unknown>( x: int32ndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
220 | | - |
221 | | -/** |
222 | | -* Return a boolean indicating whether every element in the ndarray passes a test implemented by a predicate function. |
223 | | -* |
224 | | -* @param x - input ndarray |
225 | | -* @param predicate - predicate function |
226 | | -* @param thisArg - predicate function execution context |
227 | | -* @returns output ndarray |
228 | | -* |
229 | | -* @example |
230 | | -* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; |
231 | | -* var Int16Array = require( '@stdlib/array/int16' ); |
232 | | -* var ndarray = require( '@stdlib/ndarray/ctor' ); |
233 | | -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); |
234 | | -* |
235 | | -* var buffer = new Int16Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); |
236 | | -* var shape = [ 2, 3 ]; |
237 | | -* var strides = [ 6, 2 ]; |
238 | | -* var offset = 1; |
239 | | -* |
240 | | -* var x = ndarray( 'int16', buffer, shape, strides, offset, 'row-major' ); |
241 | | -* // returns <ndarray> |
242 | | -* |
243 | | -* var arr = ndarray2array( x ); |
244 | | -* // returns [ [ 2.0, 4.0, 6.0 ], [ 8.0, 10.0, 12.0 ] ] |
245 | | -* |
246 | | -* var y = every( x, isEven ); |
247 | | -* // returns true |
248 | | -*/ |
249 | | -declare function every<V = unknown>( x: int16ndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
250 | | - |
251 | | -/** |
252 | | -* Return a boolean indicating whether every element in the ndarray passes a test implemented by a predicate function. |
253 | | -* |
254 | | -* @param x - input ndarray |
255 | | -* @param predicate - predicate function |
256 | | -* @param thisArg - predicate function execution context |
257 | | -* @returns output ndarray |
258 | | -* |
259 | | -* @example |
260 | | -* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; |
261 | | -* var Int8Array = require( '@stdlib/array/int8' ); |
262 | | -* var ndarray = require( '@stdlib/ndarray/ctor' ); |
263 | | -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); |
264 | | -* |
265 | | -* var buffer = new Int8Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); |
266 | | -* var shape = [ 2, 3 ]; |
267 | | -* var strides = [ 6, 2 ]; |
268 | | -* var offset = 1; |
269 | | -* |
270 | | -* var x = ndarray( 'int8', buffer, shape, strides, offset, 'row-major' ); |
271 | | -* // returns <ndarray> |
272 | | -* |
273 | | -* var arr = ndarray2array( x ); |
274 | | -* // returns [ [ 2.0, 4.0, 6.0 ], [ 8.0, 10.0, 12.0 ] ] |
275 | | -* |
276 | | -* var y = every( x, isEven ); |
277 | | -* // returns true |
278 | | -*/ |
279 | | -declare function every<V = unknown>( x: int8ndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
280 | | - |
281 | | -/** |
282 | | -* Return a boolean indicating whether every element in the ndarray passes a test implemented by a predicate function. |
283 | | -* |
284 | | -* @param x - input ndarray |
285 | | -* @param predicate - predicate function |
286 | | -* @param thisArg - predicate function execution context |
287 | | -* @returns output ndarray |
288 | | -* |
289 | | -* @example |
290 | | -* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; |
291 | | -* var Uint32Array = require( '@stdlib/array/uint32' ); |
292 | | -* var ndarray = require( '@stdlib/ndarray/ctor' ); |
293 | | -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); |
294 | | -* |
295 | | -* var buffer = new Uint32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); |
296 | | -* var shape = [ 2, 3 ]; |
297 | | -* var strides = [ 6, 2 ]; |
298 | | -* var offset = 1; |
299 | | -* |
300 | | -* var x = ndarray( 'uint32', buffer, shape, strides, offset, 'row-major' ); |
301 | | -* // returns <ndarray> |
302 | | -* |
303 | | -* var arr = ndarray2array( x ); |
304 | | -* // returns [ [ 2.0, 4.0, 6.0 ], [ 8.0, 10.0, 12.0 ] ] |
305 | | -* |
306 | | -* var y = every( x, isEven ); |
307 | | -* // returns true |
308 | | -*/ |
309 | | -declare function every<V = unknown>( x: uint32ndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
310 | | - |
311 | | -/** |
312 | | -* Return a boolean indicating whether every element in the ndarray passes a test implemented by a predicate function. |
313 | | -* |
314 | | -* @param x - input ndarray |
315 | | -* @param predicate - predicate function |
316 | | -* @param thisArg - predicate function execution context |
317 | | -* @returns output ndarray |
318 | | -* |
319 | | -* @example |
320 | | -* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; |
321 | | -* var Uint16Array = require( '@stdlib/array/uint16' ); |
322 | | -* var ndarray = require( '@stdlib/ndarray/ctor' ); |
323 | | -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); |
324 | | -* |
325 | | -* var buffer = new Uint16Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); |
326 | | -* var shape = [ 2, 3 ]; |
327 | | -* var strides = [ 6, 2 ]; |
328 | | -* var offset = 1; |
329 | | -* |
330 | | -* var x = ndarray( 'uint16', buffer, shape, strides, offset, 'row-major' ); |
331 | | -* // returns <ndarray> |
332 | | -* |
333 | | -* var arr = ndarray2array( x ); |
334 | | -* // returns [ [ 2.0, 4.0, 6.0 ], [ 8.0, 10.0, 12.0 ] ] |
335 | | -* |
336 | | -* var y = every( x, isEven ); |
337 | | -* // returns true |
338 | | -*/ |
339 | | -declare function every<V = unknown>( x: uint16ndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
340 | | - |
341 | | -/** |
342 | | -* Return a boolean indicating whether every element in the ndarray passes a test implemented by a predicate function. |
343 | | -* |
344 | | -* @param x - input ndarray |
345 | | -* @param predicate - predicate function |
346 | | -* @param thisArg - predicate function execution context |
347 | | -* @returns output ndarray |
348 | | -* |
349 | | -* @example |
350 | | -* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; |
351 | | -* var Uint8Array = require( '@stdlib/array/uint8' ); |
352 | | -* var ndarray = require( '@stdlib/ndarray/ctor' ); |
353 | | -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); |
354 | | -* |
355 | | -* var buffer = new Uint8Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); |
356 | | -* var shape = [ 2, 3 ]; |
357 | | -* var strides = [ 6, 2 ]; |
358 | | -* var offset = 1; |
359 | | -* |
360 | | -* var x = ndarray( 'uint8', buffer, shape, strides, offset, 'row-major' ); |
361 | | -* // returns <ndarray> |
362 | | -* |
363 | | -* var arr = ndarray2array( x ); |
364 | | -* // returns [ [ 2.0, 4.0, 6.0 ], [ 8.0, 10.0, 12.0 ] ] |
365 | | -* |
366 | | -* var y = every( x, isEven ); |
367 | | -* // returns true |
368 | | -*/ |
369 | | -declare function every<V = unknown>( x: uint8ndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
370 | | - |
371 | | -/** |
372 | | -* Return a boolean indicating whether every element in the ndarray passes a test implemented by a predicate function. |
373 | | -* |
374 | | -* @param x - input ndarray |
375 | | -* @param predicate - predicate function |
376 | | -* @param thisArg - predicate function execution context |
377 | | -* @returns output ndarray |
378 | | -* |
379 | | -* @example |
380 | | -* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; |
381 | | -* var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); |
382 | | -* var ndarray = require( '@stdlib/ndarray/ctor' ); |
383 | | -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); |
384 | | -* |
385 | | -* var buffer = new Uint8ClampedArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); |
386 | | -* var shape = [ 2, 3 ]; |
387 | | -* var strides = [ 6, 2 ]; |
388 | | -* var offset = 1; |
389 | | -* |
390 | | -* var x = ndarray( 'uint8c', buffer, shape, strides, offset, 'row-major' ); |
391 | | -* // returns <ndarray> |
392 | | -* |
393 | | -* var arr = ndarray2array( x ); |
394 | | -* // returns [ [ 2.0, 4.0, 6.0 ], [ 8.0, 10.0, 12.0 ] ] |
395 | | -* |
396 | | -* var y = every( x, isEven ); |
397 | | -* // returns true |
398 | | -*/ |
399 | | -declare function every<V = unknown>( x: uint8cndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
400 | | - |
401 | | -/** |
402 | | -* Return a boolean indicating whether every element in the ndarray passes a test implemented by a predicate function. |
403 | | -* |
404 | | -* @param x - input ndarray |
405 | | -* @param predicate - predicate function |
406 | | -* @param thisArg - predicate function execution context |
407 | | -* @returns output ndarray |
408 | | -* |
409 | | -* @example |
410 | | -* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; |
411 | | -* var BooleanArray = require( '@stdlib/array/bool' ); |
412 | | -* var ndarray = require( '@stdlib/ndarray/ctor' ); |
413 | | -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); |
414 | | -* |
415 | | -* var buffer = new BooleanArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); |
416 | | -* var shape = [ 2, 3 ]; |
417 | | -* var strides = [ 6, 2 ]; |
418 | | -* var offset = 1; |
419 | | -* |
420 | | -* var x = ndarray( 'bool', buffer, shape, strides, offset, 'row-major' ); |
421 | | -* // returns <ndarray> |
422 | | -* |
423 | | -* var arr = ndarray2array( x ); |
424 | | -* // returns [ [ 2.0, 4.0, 6.0 ], [ 8.0, 10.0, 12.0 ] ] |
425 | | -* |
426 | | -* var y = every( x, isEven ); |
427 | | -* // returns true |
428 | | -*/ |
429 | | -declare function every<V = unknown>( x: boolndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
| 99 | +declare function every<V = unknown>( x: float64ndarray | float32ndarray | complex64ndarray | complex128ndarray | int32ndarray | int16ndarray | int8ndarray | uint32ndarray | uint16ndarray | uint8ndarray | uint8cndarray | boolndarray, predicate: Predicate<number, V>, thisArg?: ThisParameterType<Predicate<number, V>> ): boolean; |
430 | 100 |
|
431 | 101 | /** |
432 | 102 | * Return a boolean indicating whether every element in the ndarray passes a test implemented by a predicate function. |
|
0 commit comments