Optimization.NET

Download Optimization.NET (.NET 4.5.1)

The link above contains the full source code, including NUnit test files and VStudio 2013 solution of the Optimization.NET library. Usage examples can be found in the Test folder (NUnit tests)

Rosenbrock

Implementation of the Rosenbrock algorithm of finding minimum of the n-dimensional function.

Public constructor: public Rosenbrock(int dim, double[] initialPar, IFunction f, double step, double epsilon, int itMax)

  • dim: problem dimension (number of variables in the function)
  • initialPar: vector with search parameters
  • f: function to minimize
  • step: initial step to start minimum search
  • epsilon: accuracy of the final result
  • itMax: max number of iteration
function to call to execute minimum search: public void FindMinimum()

Mimium is stored in the initalPar array

Nelder-Mead

Implementation of the Nelder-Mead algorithm of finding minimum of the n-dimensional function.

Public constructor: public Nelder(int dim, double[] initialPar, IFunction f, double step, double epsilon, int itMax)

  • dim: problem dimension (number of variables in the function)
  • initialPar: vector with search parameters
  • f: function to minimize
  • step: initial step to start minimum search
  • epsilon: accuracy of the final result
  • itMax: max number of iteration
function to call to execute minimum search: public void FindMinimum()

Mimium is stored in the initalPar array

DFP

Implementation of the Davidon - Fletcher - Powell algorithm of finding minimum of the n-dimensional function.

Public constructor: public DFP(int dim, double[]initialPar, IGradientFunction f, double step, double epsilon, int itMax)

  • dim: problem dimension (number of variables in the function)
  • initialPar: vector with search parameters
  • f: function to minimize - must inherit from the IGradientFunction
  • step: initial step to start minimum search
  • epsilon: accuracy of the final result
  • itMax: max number of iteration
function to call to execute minimum search: public void FindMinimum()

Similarly to above the mimium is stored in the initalPar array

BFGS

Implementation of the BGGS algorithm of finding minimum of the n-dimensional function. This one should be most efficient and successfull of all.

Public constructor: public BFGS(int dim, double[]initialPar, IGradientFunction f, double step, double epsilon, int itMax)

  • dim: problem dimension (number of variables in the function)
  • initialPar: vector with search parameters
  • f: function to minimize - must inherit from the IGradientFunction
  • step: initial step to start minimum search
  • epsilon: accuracy of the final result
  • itMax: max number of iteration
function to call to execute minimum search: public void FindMinimum()

Similarly to above the mimium is stored in the initalPar array

Full NDoc documentation is here