jsat.math
Interface Function
-
- All Superinterfaces:
- java.io.Serializable
- All Known Subinterfaces:
- IndexFunction, WordWeighting
- All Known Implementing Classes:
- BinaryWordPresent, LinearBatch.LossFunction, LinearBatch.LossMCFunction, OkapiBM25, RosenbrockFunction, TfIdf, WordCount
public interface Function extends java.io.SerializableThis functional interface defines a function over a vector input and returns a scalar output.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method and Description default doublef(double... x)Evaluates the given function for the specified input vector.default doublef(Vec x)Evaluates the given function for the specified input vector.doublef(Vec x, boolean parallel)Evaluates the given function for the specified input vector.static FunctionVecforwardDifference(Function f)Returns a new function that approximates the derivative of the given one via numerical forward difference approximation.
-
-
-
Method Detail
-
f
default double f(double... x)
Evaluates the given function for the specified input vector.- Parameters:
x- the input to the function- Returns:
- the scalar output of this function
-
f
default double f(Vec x)
Evaluates the given function for the specified input vector.- Parameters:
x- the input to the function- Returns:
- the scalar output of this function
-
f
double f(Vec x, boolean parallel)
Evaluates the given function for the specified input vector.- Parameters:
x- the input to the functionparallel-trueif the function should be evaluated with multiple threads, orfalseto use a single thread.- Returns:
- the scalar output of this function
-
forwardDifference
static FunctionVec forwardDifference(Function f)
Returns a new function that approximates the derivative of the given one via numerical forward difference approximation.- Parameters:
f- the function to approximate the derivative of- Returns:
- a function that will return an estimate of the derivative
-
-
DataMelt 3.0 © DataMelt by jWork.ORG