Skip to content

Commit 9744905

Browse files
authored
Merge branch 'develop' into feat/stats-base-dists-f-pdf-c-port
2 parents c75a537 + 68e429f commit 9744905

File tree

306 files changed

+20594
-1914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+20594
-1914
lines changed

lib/node_modules/@stdlib/array/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ Lastly, the namespace contains various other functions for dealing with arrays,
191191
- <span class="signature">[`nansLike( x[, dtype] )`][@stdlib/array/nans-like]</span><span class="delimiter">: </span><span class="description">create an array filled with NaNs and having the same length and data type as a provided array.</span>
192192
- <span class="signature">[`nans( length[, dtype] )`][@stdlib/array/nans]</span><span class="delimiter">: </span><span class="description">create an array filled with NaNs and having a specified length.</span>
193193
- <span class="signature">[`nextDataType( [dtype] )`][@stdlib/array/next-dtype]</span><span class="delimiter">: </span><span class="description">return the next larger array data type of the same kind.</span>
194+
- <span class="signature">[`nulls( length[, dtype] )`][@stdlib/array/nulls]</span><span class="delimiter">: </span><span class="description">create an array filled with nulls and having a specified length.</span>
194195
- <span class="signature">[`oneToLike( x[, dtype] )`][@stdlib/array/one-to-like]</span><span class="delimiter">: </span><span class="description">generate a linearly spaced numeric array whose elements increment by `1` starting from one and having the same length and data type as a provided input array.</span>
195196
- <span class="signature">[`oneTo( n[, dtype] )`][@stdlib/array/one-to]</span><span class="delimiter">: </span><span class="description">generate a linearly spaced numeric array whose elements increment by `1` starting from one.</span>
196197
- <span class="signature">[`onesLike( x[, dtype] )`][@stdlib/array/ones-like]</span><span class="delimiter">: </span><span class="description">create an array filled with ones and having the same length and data type as a provided array.</span>
@@ -333,6 +334,8 @@ console.log( objectKeys( ns ) );
333334

334335
[@stdlib/array/next-dtype]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/next-dtype
335336

337+
[@stdlib/array/nulls]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/nulls
338+
336339
[@stdlib/array/one-to-like]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/one-to-like
337340

338341
[@stdlib/array/one-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/one-to

lib/node_modules/@stdlib/array/base/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ The namespace exports the following:
124124
- <span class="signature">[`everyByRight( x, predicate[, thisArg] )`][@stdlib/array/base/every-by-right]</span><span class="delimiter">: </span><span class="description">test whether all elements in an array pass a test implemented by a predicate function, iterating from right to left.</span>
125125
- <span class="signature">[`everyBy( x, predicate[, thisArg] )`][@stdlib/array/base/every-by]</span><span class="delimiter">: </span><span class="description">test whether all elements in an array pass a test implemented by a predicate function.</span>
126126
- <span class="signature">[`every( x )`][@stdlib/array/base/every]</span><span class="delimiter">: </span><span class="description">test whether all elements in an array are truthy.</span>
127+
- <span class="signature">[`falses( len )`][@stdlib/array/base/falses]</span><span class="delimiter">: </span><span class="description">create a "generic" array filled with `false` values.</span>
127128
- <span class="signature">[`fancySliceAssign( x, y, s, strict )`][@stdlib/array/base/fancy-slice-assign]</span><span class="delimiter">: </span><span class="description">assign element values from a broadcasted input array to corresponding elements in an output array.</span>
128129
- <span class="signature">[`fancySlice( x, s, strict )`][@stdlib/array/base/fancy-slice]</span><span class="delimiter">: </span><span class="description">return a shallow copy of a portion of an array.</span>
129130
- <span class="signature">[`fillBy( x, start, end, fcn[, thisArg] )`][@stdlib/array/base/fill-by]</span><span class="delimiter">: </span><span class="description">fill all elements within a portion of an array according to a callback function.</span>
@@ -260,6 +261,7 @@ The namespace exports the following:
260261
- <span class="signature">[`toDeduped( x, limit, equalNaNs )`][@stdlib/array/base/to-deduped]</span><span class="delimiter">: </span><span class="description">copy elements to a new "generic" array after removing consecutive duplicated values.</span>
261262
- <span class="signature">[`toInsertedAt( x, index, value )`][@stdlib/array/base/to-inserted-at]</span><span class="delimiter">: </span><span class="description">return a new array containing every element from an input array and with a provided value inserted at a specified index.</span>
262263
- <span class="signature">[`toReversed( x )`][@stdlib/array/base/to-reversed]</span><span class="delimiter">: </span><span class="description">return a new array with elements in reverse order.</span>
264+
- <span class="signature">[`trues( len )`][@stdlib/array/base/trues]</span><span class="delimiter">: </span><span class="description">create a "generic" array filled with `true` values.</span>
263265
- <span class="signature">[`unary2dBy( arrays, shape, fcn, clbk[, thisArg] )`][@stdlib/array/base/unary2d-by]</span><span class="delimiter">: </span><span class="description">apply a unary function to each element retrieved from a two-dimensional nested input array according to a callback function and assign results to elements in a two-dimensional nested output array.</span>
264266
- <span class="signature">[`unary2d( arrays, shape, fcn )`][@stdlib/array/base/unary2d]</span><span class="delimiter">: </span><span class="description">apply a unary callback to elements in a two-dimensional nested input array and assign results to elements in a two-dimensional nested output array.</span>
265267
- <span class="signature">[`unary3dBy( arrays, shape, fcn, clbk[, thisArg] )`][@stdlib/array/base/unary3d-by]</span><span class="delimiter">: </span><span class="description">apply a unary function to each element retrieved from a three-dimensional nested input array according to a callback function and assign results to elements in a three-dimensional nested output array.</span>
@@ -500,6 +502,8 @@ var squared = ns.map2d( arr2d, [ 2, 3 ], randu );
500502

501503
[@stdlib/array/base/every]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/every
502504

505+
[@stdlib/array/base/falses]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/falses
506+
503507
[@stdlib/array/base/fancy-slice-assign]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/fancy-slice-assign
504508

505509
[@stdlib/array/base/fancy-slice]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/fancy-slice
@@ -772,6 +776,8 @@ var squared = ns.map2d( arr2d, [ 2, 3 ], randu );
772776

773777
[@stdlib/array/base/to-reversed]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/to-reversed
774778

779+
[@stdlib/array/base/trues]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/trues
780+
775781
[@stdlib/array/base/unary2d-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/unary2d-by
776782

777783
[@stdlib/array/base/unary2d]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/unary2d

lib/node_modules/@stdlib/array/base/docs/types/index.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ import entries2views = require( '@stdlib/array/base/entries2views' );
9999
import every = require( '@stdlib/array/base/every' );
100100
import everyBy = require( '@stdlib/array/base/every-by' );
101101
import everyByRight = require( '@stdlib/array/base/every-by-right' );
102+
import falses = require( '@stdlib/array/base/falses' );
102103
import fancySlice = require( '@stdlib/array/base/fancy-slice' );
103104
import fancySliceAssign = require( '@stdlib/array/base/fancy-slice-assign' );
104105
import fill = require( '@stdlib/array/base/fill' );
@@ -235,6 +236,7 @@ import toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
235236
import toDeduped = require( '@stdlib/array/base/to-deduped' );
236237
import toInsertedAt = require( '@stdlib/array/base/to-inserted-at' );
237238
import toReversed = require( '@stdlib/array/base/to-reversed' );
239+
import trues = require( '@stdlib/array/base/trues' );
238240
import unary2d = require( '@stdlib/array/base/unary2d' );
239241
import unary2dBy = require( '@stdlib/array/base/unary2d-by' );
240242
import unary3d = require( '@stdlib/array/base/unary3d' );
@@ -2405,6 +2407,18 @@ interface Namespace {
24052407
*/
24062408
everyByRight: typeof everyByRight;
24072409

2410+
/**
2411+
* Returns a "generic" array filled with `false` values.
2412+
*
2413+
* @param len - array length
2414+
* @returns output array
2415+
*
2416+
* @example
2417+
* var out = ns.falses( 3 );
2418+
* // returns [ false, false, false ]
2419+
*/
2420+
falses: typeof falses;
2421+
24082422
/**
24092423
* Returns a shallow copy of a portion of an array.
24102424
*
@@ -5713,6 +5727,18 @@ interface Namespace {
57135727
*/
57145728
toReversed: typeof toReversed;
57155729

5730+
/**
5731+
* Returns a "generic" array filled with `true` values.
5732+
*
5733+
* @param len - array length
5734+
* @returns output array
5735+
*
5736+
* @example
5737+
* var out = ns.trues( 3 );
5738+
* // returns [ true, true, true ]
5739+
*/
5740+
trues: typeof trues;
5741+
57165742
/**
57175743
* Applies a unary callback to elements in a two-dimensional nested input array and assigns results to elements in a two-dimensional nested output array.
57185744
*
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2026 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# falses
22+
23+
> Create a "generic" array filled with `false` values.
24+
25+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
26+
27+
<section class="intro">
28+
29+
</section>
30+
31+
<!-- /.intro -->
32+
33+
<!-- Package usage documentation. -->
34+
35+
<section class="usage">
36+
37+
## Usage
38+
39+
```javascript
40+
var falses = require( '@stdlib/array/base/falses' );
41+
```
42+
43+
#### falses( len )
44+
45+
Returns a "generic" array filled with `false` values.
46+
47+
```javascript
48+
var out = falses( 3 );
49+
// returns [ false, false, false ]
50+
```
51+
52+
</section>
53+
54+
<!-- /.usage -->
55+
56+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
57+
58+
<section class="notes">
59+
60+
</section>
61+
62+
<!-- /.notes -->
63+
64+
<!-- Package usage examples. -->
65+
66+
<section class="examples">
67+
68+
## Examples
69+
70+
<!-- eslint no-undef: "error" -->
71+
72+
```javascript
73+
var falses = require( '@stdlib/array/base/falses' );
74+
75+
// Create a `false` value array:
76+
var arr = falses( 10 );
77+
78+
console.log( arr );
79+
// => [ false, false, false, false, false, false, false, false, false, false ]
80+
```
81+
82+
</section>
83+
84+
<!-- /.examples -->
85+
86+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
87+
88+
<section class="references">
89+
90+
</section>
91+
92+
<!-- /.references -->
93+
94+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
95+
96+
<section class="related">
97+
98+
</section>
99+
100+
<!-- /.related -->
101+
102+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
103+
104+
<section class="links">
105+
106+
</section>
107+
108+
<!-- /.links -->
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2026 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var bench = require( '@stdlib/bench' );
24+
var pow = require( '@stdlib/math/base/special/pow' );
25+
var isArray = require( '@stdlib/assert/is-array' );
26+
var format = require( '@stdlib/string/format' );
27+
var pkg = require( './../package.json' ).name;
28+
var falses = require( './../lib' );
29+
30+
31+
// FUNCTIONS //
32+
33+
/**
34+
* Creates a benchmark function.
35+
*
36+
* @private
37+
* @param {PositiveInteger} len - array length
38+
* @returns {Function} benchmark function
39+
*/
40+
function createBenchmark( len ) {
41+
return benchmark;
42+
43+
/**
44+
* Benchmark function.
45+
*
46+
* @private
47+
* @param {Benchmark} b - benchmark instance
48+
*/
49+
function benchmark( b ) {
50+
var out;
51+
var i;
52+
53+
b.tic();
54+
for ( i = 0; i < b.iterations; i++ ) {
55+
out = falses( len );
56+
if ( out.length !== len ) {
57+
b.fail( 'unexpected length' );
58+
}
59+
}
60+
b.toc();
61+
if ( !isArray( out ) ) {
62+
b.fail( 'should return an array' );
63+
}
64+
b.pass( 'benchmark finished' );
65+
b.end();
66+
}
67+
}
68+
69+
70+
// MAIN //
71+
72+
/**
73+
* Main execution sequence.
74+
*
75+
* @private
76+
*/
77+
function main() {
78+
var len;
79+
var min;
80+
var max;
81+
var f;
82+
var i;
83+
84+
min = 1; // 10^min
85+
max = 6; // 10^max
86+
87+
for ( i = min; i <= max; i++ ) {
88+
len = pow( 10, i );
89+
90+
f = createBenchmark( len );
91+
bench( format( '%s:len=%d', pkg, len ), f );
92+
}
93+
}
94+
95+
main();
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
{{alias}}( len )
3+
Returns a "generic" array filled with `false` values.
4+
5+
Parameters
6+
----------
7+
len: integer
8+
Array length.
9+
10+
Returns
11+
-------
12+
out: Array
13+
Output array.
14+
15+
Examples
16+
--------
17+
> var out = {{alias}}( 3 )
18+
[ false, false, false ]
19+
20+
See Also
21+
--------
22+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2026 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// TypeScript Version: 4.1
20+
21+
/**
22+
* Returns a "generic" array filled with `false` values.
23+
*
24+
* @param len - array length
25+
* @returns output array
26+
*
27+
* @example
28+
* var out = falses( 3 );
29+
* // returns [ false, false, false ]
30+
*/
31+
declare function falses( len: number ): Array<boolean>;
32+
33+
34+
// EXPORTS //
35+
36+
export = falses;

0 commit comments

Comments
 (0)