public final class FunctionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static UnivariateDifferentiableFunction |
add(UnivariateDifferentiableFunction... f)
Adds functions.
|
static UnivariateFunction |
add(UnivariateFunction... f)
Adds functions.
|
static MultivariateFunction |
collector(BivariateFunction combiner,
double initialValue)
Returns a MultivariateFunction h(x[]) defined by
h(x[]) = combiner(...combiner(combiner(initialValue,x[0]),x[1])...) |
static MultivariateFunction |
collector(BivariateFunction combiner,
UnivariateFunction f,
double initialValue)
Returns a MultivariateFunction h(x[]) defined by
h(x[]) = combiner(...combiner(combiner(initialValue,f(x[0])),f(x[1]))...) |
static UnivariateFunction |
combine(BivariateFunction combiner,
UnivariateFunction f,
UnivariateFunction g)
Returns the univariate function
h(x) = combiner(f(x), g(x)) . |
static UnivariateDifferentiableFunction |
compose(UnivariateDifferentiableFunction... f)
Composes functions.
|
static UnivariateFunction |
compose(UnivariateFunction... f)
Composes functions.
|
static UnivariateFunction |
fix1stArgument(BivariateFunction f,
double fixed)
Creates a unary function by fixing the first argument of a binary function.
|
static UnivariateFunction |
fix2ndArgument(BivariateFunction f,
double fixed)
Creates a unary function by fixing the second argument of a binary function.
|
static UnivariateDifferentiableFunction |
multiply(UnivariateDifferentiableFunction... f)
Multiplies functions.
|
static UnivariateFunction |
multiply(UnivariateFunction... f)
Multiplies functions.
|
static double[] |
sample(UnivariateFunction f,
double min,
double max,
int n)
Samples the specified univariate real function on the specified interval.
|
public static UnivariateFunction compose(UnivariateFunction... f)
f
- List of functions.public static UnivariateDifferentiableFunction compose(UnivariateDifferentiableFunction... f)
f
- List of functions.public static UnivariateFunction add(UnivariateFunction... f)
f
- List of functions.public static UnivariateDifferentiableFunction add(UnivariateDifferentiableFunction... f)
f
- List of functions.public static UnivariateFunction multiply(UnivariateFunction... f)
f
- List of functions.public static UnivariateDifferentiableFunction multiply(UnivariateDifferentiableFunction... f)
f
- List of functions.public static UnivariateFunction combine(BivariateFunction combiner, UnivariateFunction f, UnivariateFunction g)
h(x) = combiner(f(x), g(x))
.combiner
- Combiner function.f
- Function.g
- Function.public static MultivariateFunction collector(BivariateFunction combiner, UnivariateFunction f, double initialValue)
h(x[]) = combiner(...combiner(combiner(initialValue,f(x[0])),f(x[1]))...),f(x[x.length-1]))
combiner
- Combiner function.f
- Function.initialValue
- Initial value.public static MultivariateFunction collector(BivariateFunction combiner, double initialValue)
h(x[]) = combiner(...combiner(combiner(initialValue,x[0]),x[1])...),x[x.length-1])
combiner
- Combiner function.initialValue
- Initial value.public static UnivariateFunction fix1stArgument(BivariateFunction f, double fixed)
f
- Binary function.fixed
- Value to which the first argument of f
is set.public static UnivariateFunction fix2ndArgument(BivariateFunction f, double fixed)
f
- Binary function.fixed
- Value to which the second argument of f
is set.public static double[] sample(UnivariateFunction f, double min, double max, int n)
n
sections and sample points
are taken from min
to max - (max - min) / n
; therefore f
is not sampled at the upper
bound max
.f
- Function to be sampledmin
- Lower bound of the interval (included).max
- Upper bound of the interval (excluded).n
- Number of sample points.NumberIsTooLargeException
- if the lower bound min
is
greater than, or equal to the upper bound max
.NotStrictlyPositiveException
- if the number of sample points n
is negative.Copyright © 2019 CNES. All rights reserved.