public class FunctionUtils extends Object
public static UnivariateFunction compose(UnivariateFunction... f)
The functions in the argument list are composed sequentially, in the given order. For example, compose(f1,f2,f3) acts like f1(f2(f3(x))).
f - List of functions.public static UnivariateDifferentiableFunction compose(UnivariateDifferentiableFunction... f)
The functions in the argument list are composed sequentially, in the given order. For example, compose(f1,f2,f3) acts like f1(f2(f3(x))).
f - List of functions.@Deprecated public static DifferentiableUnivariateFunction compose(DifferentiableUnivariateFunction... f)
compose(UnivariateDifferentiableFunction...)The functions in the argument list are composed sequentially, in the given order. For example, compose(f1,f2,f3) acts like f1(f2(f3(x))).
f - List of functions.public static UnivariateFunction add(UnivariateFunction... f)
f - List of functions.public static UnivariateDifferentiableFunction add(UnivariateDifferentiableFunction... f)
f - List of functions.@Deprecated public static DifferentiableUnivariateFunction add(DifferentiableUnivariateFunction... f)
add(UnivariateDifferentiableFunction...)f - List of functions.public static UnivariateFunction multiply(UnivariateFunction... f)
f - List of functions.public static UnivariateDifferentiableFunction multiply(UnivariateDifferentiableFunction... f)
f - List of functions.@Deprecated public static DifferentiableUnivariateFunction multiply(DifferentiableUnivariateFunction... f)
multiply(UnivariateDifferentiableFunction...)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) throws NumberIsTooLargeException, NotStrictlyPositiveException
The interval is divided equally into 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.@Deprecated public static DifferentiableUnivariateFunction toDifferentiableUnivariateFunction(UnivariateDifferentiableFunction f)
DifferentiableUnivariateFunction interface itself is deprecatedUnivariateDifferentiableFunction into a DifferentiableUnivariateFunction.f - function to convert@Deprecated public static UnivariateDifferentiableFunction toUnivariateDifferential(DifferentiableUnivariateFunction f)
DifferentiableUnivariateFunction interface itself is deprecatedDifferentiableUnivariateFunction into a UnivariateDifferentiableFunction.
Note that the converted function is able to handle DerivativeStructure up to order one.
If the function is called with higher order, a NumberIsTooLargeException is thrown.
f - function to convert@Deprecated public static DifferentiableMultivariateFunction toDifferentiableMultivariateFunction(MultivariateDifferentiableFunction f)
DifferentiableMultivariateFunction interface itself is deprecatedMultivariateDifferentiableFunction into a DifferentiableMultivariateFunction.f - function to convert@Deprecated public static MultivariateDifferentiableFunction toMultivariateDifferentiableFunction(DifferentiableMultivariateFunction f)
DifferentiableMultivariateFunction interface itself is deprecatedDifferentiableMultivariateFunction into a MultivariateDifferentiableFunction.
Note that the converted function is able to handle DerivativeStructure elements
that all have the same number of free parameters and order, and with order at most 1.
If the function is called with inconsistent numbers of free parameters or higher order, a
DimensionMismatchException or a NumberIsTooLargeException will be thrown.
f - function to convert@Deprecated public static DifferentiableMultivariateVectorFunction toDifferentiableMultivariateVectorFunction(MultivariateDifferentiableVectorFunction f)
DifferentiableMultivariateVectorFunction interface itself is deprecatedf - function to convert@Deprecated public static MultivariateDifferentiableVectorFunction toMultivariateDifferentiableVectorFunction(DifferentiableMultivariateVectorFunction f)
DifferentiableMultivariateFunction interface itself is deprecatedDifferentiableMultivariateVectorFunction into a MultivariateDifferentiableVectorFunction.
Note that the converted function is able to handle DerivativeStructure elements
that all have the same number of free parameters and order, and with order at most 1.
If the function is called with inconsistent numbers of free parameters or higher order, a
DimensionMismatchException or a NumberIsTooLargeException will be thrown.
f - function to convertCopyright © 2003–2016 The Apache Software Foundation. All rights reserved.