Class Minimizer


  • public class Minimizer
    extends Object

    This class encapsulates the running of Powell's Method on a given function in order to determine a local minimum.

    The function to be minimized can have a domain of any dimension as it takes an array of doubles and returns the value that needs to be minimized.

    For example, to minimize the function (x - 2)^2 - 3 you would:

     {
         @code
         final Minimizer m = new Minimizer(x -> ((x[0] - 2.0) * (x[0] - 2.0)) - 3.0);
         final double minVal = m.minimize(new double[] {-45.0});
         final double minParam = m.getFinalPostion()[0];
     }
     
    • Field Detail

      • ftol

        public static double ftol
        Default float tolerance.
    • Constructor Detail

      • Minimizer

        public Minimizer​(Minimizer.Func f)
        Construct the minimizer with the function to be minimized.
    • Method Detail

      • getFinalPostion

        public double[] getFinalPostion()
        Return the final domain value of the minimized solution.