-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Included math to syntax when missing * Included solveODE * renamed initialStep as firstStep * Included tests for solveODE * Test the full state instead of the final state * Fixed issue with tolerance * Added unit signature for y0 * Included units test also for y0 * Included embedded docs and more tests * Included error for tspan * It works with bignumbers * reduced calling bignumber * extended the search for bignumbers * The jsdocs is less ambiguous * included tests for step options * Allowed for 0 minStep * Optimization to avoid checking the sign every step * added dim to quantile * Included transform * Removed modification of the docs I made an unwanted modification --------- Co-authored-by: David Contreras <[email protected]> Co-authored-by: Jos de Jong <[email protected]>
- Loading branch information
1 parent
49c793b
commit 3ab9bc1
Showing
4 changed files
with
95 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { factory } from '../../utils/factory.js' | ||
import { createQuantileSeq } from '../../function/statistics/quantileSeq.js' | ||
import { lastDimToZeroBase } from './utils/lastDimToZeroBase.js' | ||
|
||
const name = 'quantileSeq' | ||
const dependencies = ['typed', 'add', 'multiply', 'partitionSelect', 'compare', 'isInteger'] | ||
|
||
/** | ||
* Attach a transform function to math.quantileSeq | ||
* Adds a property transform containing the transform function. | ||
* | ||
* This transform changed the `dim` parameter of function std | ||
* from one-based to zero based | ||
*/ | ||
export const createQuantileSeqTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, multiply, partitionSelect, compare, isInteger }) => { | ||
const quantileSeq = createQuantileSeq({ typed, add, multiply, partitionSelect, compare, isInteger }) | ||
|
||
return typed('quantileSeq', { | ||
'Array|Matrix, number|BigNumber|Array, number': (arr, prob, dim) => quantileSeq(arr, prob, dimToZeroBase(dim)), | ||
'Array|Matrix, number|BigNumber|Array, boolean, number': (arr, prob, sorted, dim) => quantileSeq(arr, prob, sorted, dimToZeroBase(dim)) | ||
}) | ||
|
||
function dimToZeroBase (dim) { | ||
// TODO: find a better way, maybe lastDimToZeroBase could apply to more cases. | ||
return lastDimToZeroBase([[], dim])[1] | ||
} | ||
}, { isTransformFunction: true }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters