(binary-search arr v)(binary-search-id bsres n)Find array index after binary search snapping to the lower value. The last segment snaps to the previous segment.
Find array index after binary search snapping to the lower value. The last segment snaps to the previous segment.
(check-axis! method
axis
arr
{:keys [min-points sorted?] :or {min-points 1 sorted? true}})Checks the coordinates of one axis of an interpolator and throws ex-info when they are invalid.
Parameters:
method (keyword): name of the interpolation method, used in the messageaxis (keyword): name of the axis, for example :xsarr (double array): the coordinatesopts (map, optional keys):
:min-points (long, default: 1): minimal number of points:sorted? (boolean, default: true): require strictly increasing coordinatesEvery coordinate has to be finite (not NaN, not infinite), also when :sorted? is false.
Returns nil. Throws ex-info with :property set to :too-few-points, :not-finite or :not-increasing.
See also validate-xy!, invalid-input!.
Checks the coordinates of one axis of an interpolator and throws `ex-info` when they are invalid.
Parameters:
- `method` (keyword): name of the interpolation method, used in the message
- `axis` (keyword): name of the axis, for example `:xs`
- `arr` (double array): the coordinates
- `opts` (map, optional keys):
- `:min-points` (long, default: 1): minimal number of points
- `:sorted?` (boolean, default: true): require strictly increasing coordinates
Every coordinate has to be finite (not `NaN`, not infinite), also when `:sorted?` is false.
Returns `nil`. Throws `ex-info` with `:property` set to `:too-few-points`, `:not-finite` or `:not-increasing`.
See also [[validate-xy!]], [[invalid-input!]].(invalid-input! method property message data)Throws ex-info describing invalid input data of an interpolation method.
Parameters:
method (keyword): name of the interpolation method, used in the messageproperty (keyword): the violated property, for example :length-mismatch, :too-few-points, :not-finite or :not-increasingmessage (string): description of the problemdata (map): additional data stored in the exceptionNever returns. The ex-data of the exception contains :type (:invalid-input), :method, :property and the keys of data.
See also check-axis!, validate-xy!.
Throws `ex-info` describing invalid input data of an interpolation method. Parameters: - `method` (keyword): name of the interpolation method, used in the message - `property` (keyword): the violated property, for example `:length-mismatch`, `:too-few-points`, `:not-finite` or `:not-increasing` - `message` (string): description of the problem - `data` (map): additional data stored in the exception Never returns. The `ex-data` of the exception contains `:type` (`:invalid-input`), `:method`, `:property` and the keys of `data`. See also [[check-axis!]], [[validate-xy!]].
(pi-matrix-ys xss Phi ys polynomial-terms)Adds polynomial terms
Adds polynomial terms
(solve-LU-or-SVD A b)Solves the linear system A x = b with LU decomposition, falls back to SVD (minimum norm least squares) when the matrix is singular.
Parameters:
A (RealMatrix): square matrixb (RealVector): right hand sideReturns the solution as a vector of doubles.
Solves the linear system `A x = b` with LU decomposition, falls back to SVD (minimum norm least squares) when the matrix is singular. Parameters: - `A` (`RealMatrix`): square matrix - `b` (`RealVector`): right hand side Returns the solution as a vector of doubles.
(validate-xy! method xs ys opts)Checks the data of a one dimensional interpolator and throws ex-info when it is invalid.
Parameters:
method (keyword): name of the interpolation method, used in the messagexs (double array): the nodesys (double array): the values; NaN and infinite values are allowedopts (map, optional keys): :min-points (default: 1) and :sorted? (default: true), see check-axis!The number of values has to be equal to the number of nodes.
Returns nil. Throws ex-info with :property set to :length-mismatch, :too-few-points, :not-finite or :not-increasing.
See also check-axis!, invalid-input!.
Checks the data of a one dimensional interpolator and throws `ex-info` when it is invalid. Parameters: - `method` (keyword): name of the interpolation method, used in the message - `xs` (double array): the nodes - `ys` (double array): the values; `NaN` and infinite values are allowed - `opts` (map, optional keys): `:min-points` (default: 1) and `:sorted?` (default: true), see [[check-axis!]] The number of values has to be equal to the number of nodes. Returns `nil`. Throws `ex-info` with `:property` set to `:length-mismatch`, `:too-few-points`, `:not-finite` or `:not-increasing`. See also [[check-axis!]], [[invalid-input!]].
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |