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

Refactoring of solvers (package "analysis.solvers")

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.0
    • None
    • None

    Description

      The classes in package "analysis.solvers" could be refactored similarly to what was done for package optimization.

      • Replace MaxIterationsExceededException with TooManyEvaluationsException:
        Apart from the class MaxIterationsExceededException being deprecated, this approach makes it difficult to compare different algorithms: While the concept of iteration is algorithm-dependent, the user is probably mostly interested in the number of function evaluations.
      • Implement the method solve in the base class (UnivariateRealSolverImpl) and define an abstract method doSolve to be implemented in derived classes. This method would then use a new computeObjectiveFunction method that will take care of the counting of the function evaluations.
      • Remove "protected" fields (the root is unnecessary since it is returned by solve). Arguingly the function value is also not very useful (as we know what it should be), except for debugging purposes (in which case, it might not be a problem to call the function's value method once more).
      • Remove the tolerance setter (accuracy) and make the corresponding fields "final".

      Attachments

        1. NLCG.testCircleFitting.txt
          1 kB
          Gilles Sadowski
        2. AbstractUnivariateRealSolver.java
          9 kB
          Gilles Sadowski

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: