Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-874

New API for optimizers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0
    • 4.0
    • None

    Description

      I suggest to change the signatures of the "optimize" methods in

      • UnivariateOptimizer
      • MultivariateOptimizer
      • MultivariateDifferentiableOptimizer
      • MultivariateDifferentiableVectorOptimizer
      • BaseMultivariateSimpleBoundsOptimizer

      Currently, the arguments are

      • the allowed number of evaluations of the objective function
      • the objective function
      • the type of optimization (minimize or maximize)
      • the initial guess
      • optionally, the lower and upper bounds

      A marker interface:

      public interface OptimizationData {}
      

      would in effect be implemented by all input data so that the signature would become (for MultivariateOptimizer):

      public PointValuePair optimize(MultivariateFunction f,
                                     OptimizationData... optData);
      

      A thread was started on the "dev" ML.
      Initially, this proposal aimed at avoiding to call some optimizer-specific methods. An example is the "setSimplex" method in "o.a.c.m.optimization.direct.SimplexOptimizer": it must be called before the call to "optimize". Not only this departs form the common API, but the definition of the simplex also fixes the dimension of the problem; hence it would be more natural to pass it together with the other parameters (i.e. in "optimize") that are also dimension-dependent (initial guess, bounds).

      Eventually, the API will be simpler: users will

      1. construct an optimizer (passing dimension-independent parameters at construction),
      2. call "optimize" (passing any dimension-dependent parameters).

      Attachments

        1. fitting.tar.gz
          15 kB
          Gilles Sadowski
        2. optim_linear.tar.gz
          16 kB
          Gilles Sadowski
        3. optim.tar.gz
          142 kB
          Gilles Sadowski
        4. optimizers.patch
          11 kB
          Gilles Sadowski

        Issue Links

          Activity

            People

              Unassigned Unassigned
              erans Gilles Sadowski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: