Adapter extending bounded {@link MultivariateFunction} to an unboudeddomain using a penalty function.
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 check if the parameters is within range or not. If it is in range, then the underlying user function will be called, and if it is not the value of a penalty function will be returned instead.
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 if start point or start simplex is completely outside of the allowed range, only the penalty function is used, and the optimizer may converge without ever entering the range.
@see MultivariateFunctionMappingAdapter
@deprecated As of 3.1 (to be removed in 4.0).
@since 3.0