Adapter for mapping bounded {@link MultivariateFunction} to unbounded ones.
This adapter can be used to wrap functions subject to simple bounds on parameters so they can be used by optimizers that do not directly support simple bounds.
The principle is that the user function that will be wrapped will see its parameters bounded as required, i.e when its {@code value} method is calledwith argument array {@code point}, the elements array will fulfill requirement {@code lower[i] <= point[i] <= upper[i]} for all i. Some of the componentsmay be unbounded or bounded only on one side if the corresponding bound is set to an infinite value. The optimizer will not manage the user function by itself, but it will handle this adapter and it is this adapter that will take care the bounds are fulfilled. The adapter {@link #value(double[])} method willbe called by the optimizer with unbound parameters, and the adapter will map the unbounded value to the bounded range using appropriate functions like {@link Sigmoid} for double bounded elements for example.
As the optimizer sees only unbounded parameters, it should be noted that the start point or simplex expected by the optimizer should be unbounded, so the user is responsible for converting his bounded point to unbounded by calling {@link #boundedToUnbounded(double[])} before providing them to the optimizer.For the same reason, the point returned by the {@link org.apache.commons.math3.optimization.BaseMultivariateOptimizer#optimize(int,MultivariateFunction,org.apache.commons.math3.optimization.GoalType,double[])}method is unbounded. So to convert this point to bounded, users must call {@link #unboundedToBounded(double[])} by themselves!
This adapter is only a poor man solution to simple bounds optimization constraints that can be used with simple optimizers like {@link SimplexOptimizer} with {@link NelderMeadSimplex} or {@link MultiDirectionalSimplex}. A better solution is to use an optimizer that directly supports simple bounds like {@link CMAESOptimizer} or{@link BOBYQAOptimizer}. One caveat of this poor man solution is that behavior near the bounds may be numerically unstable as bounds are mapped from infinite values. Another caveat is that convergence values are evaluated by the optimizer with respect to unbounded variables, so there will be scales differences when converted to bounded variables.
@see MultivariateFunctionPenaltyAdapter
@deprecated As of 3.1 (to be removed in 4.0).
@since 3.0