Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 1 addition & 194 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,194 +1 @@
#/
# @license Apache-2.0
#
# Copyright (c) 2017 The Stdlib Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#/

# Files #
#########
package.json.copy
.stdlibrc

# Directories #
###############
build/
downloads/
reports/
tmp/

# Compiled source #
###################
*.com
*.class
*.dll
*.o
*.so
*.slo
*.lo
*.obj
*.dylib
*.lai
*.la
*.a
*.lib
*.ko
*.elf
*.node

# Precompiled headers #
#######################
*.gch
*.pch

# Executables #
###############
*.exe
*.out
*.app

# Packages #
############
# It is better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
Desktop.ini

# Temporary files #
###################
*~

# Node.js #
###########
/node_modules/
lib/node_modules/**/node_modules/
docs/**/node_modules/
pids
*.pid
*.seed
yarn.lock
package-lock.json

# Typescript #
##############
*.tsbuildinfo
lib/node_modules/**/tsconfig.json
lib/node_modules/**/tslint.json

# Matlab #
##########
*.asv
*.mex*

# Fortran #
###########
*.mod

# R #
#####
.Rhistory
.Rapp.history
.Rproj.user/

# Python #
##########
__pycache__/
*.py[cod]
*$py.class
*.egg-info/

# TeX #
#######
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.dvi
*-converted-to.*
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.brf
*.run.xml
*.fdb_latexmk
*.synctex
*.synctex.gz
*.synctex.gz(busy)
*.pdfsync
*.alg
*.loa
acs-*.bib
*.thm
*.nav
*.snm
*.vrb
*.acn
*.acr
*.glg
*.glo
*.gls
*-concordance.tex
*.tikz
*-tikzDictionary
*.idx
*.ilg
*.ind
*.ist

# Visual Studio #
#################
.vscode/
jsconfig.json

# Sublime Text #
################
*.sublime-workspace
*.sublime-project

# Other editor files #
######################
.idea/

# Cursor #
##########
.cursorignore
node_modules
27 changes: 14 additions & 13 deletions lib/node_modules/@stdlib/stats/base/nanmin-by/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@license Apache-2.0

Copyright (c) 2020 The Stdlib Authors.
Copyright (c) 2025 The Stdlib Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,7 +30,7 @@ limitations under the License.
var nanminBy = require( '@stdlib/stats/base/nanmin-by' );
```

#### nanminBy( N, x, stride, clbk\[, thisArg] )
#### nanminBy( N, x, strideX, clbk\[, thisArg] )

Calculates the minimum value of strided array `x` via a callback function, ignoring `NaN` values.

Expand All @@ -49,7 +49,7 @@ The function has the following parameters:

- **N**: number of indexed elements.
- **x**: input [`Array`][mdn-array], [`typed array`][mdn-typed-array], or an array-like object (excluding strings and functions).
- **stride**: index increment.
- **strideX**: index increment.
- **clbk**: callback function.
- **thisArg**: execution context (_optional_).

Expand Down Expand Up @@ -81,7 +81,7 @@ var cnt = context.count;
// returns 10
```

The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element
The `N` and `strideX` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element

```javascript
var floor = require( '@stdlib/math/base/special/floor' );
Expand Down Expand Up @@ -119,7 +119,7 @@ var v = nanminBy( N, x1, 2, accessor );
// returns -12.0
```

#### nanminBy.ndarray( N, x, stride, offset, clbk\[, thisArg] )
#### nanminBy.ndarray( N, x, strideX, offsetX, clbk\[, thisArg] )

Calculates the minimum value of strided array `x` via a callback function, ignoring `NaN` values and using alternative indexing semantics.

Expand All @@ -136,9 +136,9 @@ var v = nanminBy.ndarray( x.length, x, 1, 0, accessor );

The function has the following additional parameters:

- **offset**: starting index.
- **offsetX**: starting index.

While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x`
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x`

```javascript
function accessor( v ) {
Expand All @@ -163,6 +163,7 @@ var v = nanminBy.ndarray( 3, x, 1, x.length-3, accessor );
- A provided callback function should return a numeric value.
- If a provided callback function returns `NaN`, the value is ignored.
- If a provided callback function does not return any value (or equivalently, explicitly returns `undefined`), the value is ignored.
- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]).
- When possible, prefer using [`dnanmin`][@stdlib/stats/strided/dnanmin], [`snanmin`][@stdlib/stats/strided/snanmin], and/or [`nanmin`][@stdlib/stats/base/nanmin], as, depending on the environment, these interfaces are likely to be significantly more performant.

</section>
Expand All @@ -176,23 +177,23 @@ var v = nanminBy.ndarray( 3, x, 1, x.length-3, accessor );
<!-- eslint no-undef: "error" -->

```javascript
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/base/uniform' );
var filledarrayBy = require( '@stdlib/array/filled-by' );
var bernoulli = require( '@stdlib/random/base/bernoulli' );
var nanminBy = require( '@stdlib/stats/base/nanmin-by' );

function fill() {
if ( randu() < 0.2 ) {
function rand() {
if( bernoulli( 0.8 ) < 1 ) {
return NaN;
}
return discreteUniform( -50, 50 );
return uniform( -50.0, 50.0 );
}

function accessor( v ) {
return v * 2.0;
}

var x = filledarrayBy( 10, 'float64', fill );
var x = filledarrayBy( 10, 'float64', rand );
console.log( x );

var v = nanminBy( x.length, x, 1, accessor );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib Authors.
* Copyright (c) 2025 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,9 @@
// MODULES //

var bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/base/uniform' );
var filledarrayBy = require( '@stdlib/array/filled-by' );
var bernoulli = require( '@stdlib/random/base/bernoulli' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pow = require( '@stdlib/math/base/special/pow' );
var pkg = require( './../package.json' ).name;
Expand All @@ -37,6 +39,13 @@ var nanminBy = require( './../lib/nanmin_by.js' );
* @param {number} value - array element
* @returns {number} accessed value
*/
function rand() {
if( bernoulli( 0.8 ) < 1 ) {
return NaN;
}
return uniform( -50.0, 50.0 );
}

function accessor( value ) {
return value * 2.0;
}
Expand All @@ -49,17 +58,7 @@ function accessor( value ) {
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
var x;
var i;

x = [];
for ( i = 0; i < len; i++ ) {
if ( randu() < 0.2 ) {
x.push( NaN );
} else {
x.push( ( randu()*20.0 ) - 10.0 );
}
}
var x = filledarrayBy( len, "float64", rand );
return benchmark;

function benchmark( b ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib Authors.
* Copyright (c) 2025 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,9 @@
// MODULES //

var bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/base/uniform' );
var filledarrayBy = require( '@stdlib/array/filled-by' );
var bernoulli = require( '@stdlib/random/base/bernoulli' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pow = require( '@stdlib/math/base/special/pow' );
var pkg = require( './../package.json' ).name;
Expand All @@ -37,6 +39,13 @@ var nanminBy = require( './../lib/ndarray.js' );
* @param {number} value - array element
* @returns {number} accessed value
*/
function rand() {
if( bernoulli( 0.8 ) < 1 ) {
return NaN;
}
return uniform( -50.0, 50.0 );
}

function accessor( value ) {
return value * 2.0;
}
Expand All @@ -49,17 +58,7 @@ function accessor( value ) {
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
var x;
var i;

x = [];
for ( i = 0; i < len; i++ ) {
if ( randu() < 0.2 ) {
x.push( NaN );
} else {
x.push( ( randu()*20.0 ) - 10.0 );
}
}
var x = filledarrayBy( len, "float64", rand );
return benchmark;

function benchmark( b ) {
Expand Down
Loading
Loading