edu.stanford.rsl.jpop
Class FunctionOptimizer

java.lang.Object
  extended by edu.stanford.rsl.jpop.FunctionOptimizer

public class FunctionOptimizer
extends java.lang.Object


Nested Class Summary
static class FunctionOptimizer.OptimizationMode
           
static class FunctionOptimizer.TerminationCode
          Termination codes ITRMCD = 0: Optimal solution found ITRMCD = 1: Terminated with gradient small, X is probably optimal ITRMCD = 2: Terminated with stepsize small, X is probably optimal ITRMCD = 3: Lower point cannot be found, X is probably optimal ITRMCD = 4: Iteration limit (150) exceeded ITRMCD = 5: Too many large steps, function may be unbounded
 
Constructor Summary
FunctionOptimizer()
           
FunctionOptimizer(int dimension)
           
 
Method Summary
 double getFunctionAtOptimum()
           
 double[] getGradientAtOptimum()
           
 double[][] getHessianAtOptimum()
           
 FunctionOptimizer.OptimizationMode getOptimizationMode()
           
 double[] getOptimum()
           
 FunctionOptimizer.TerminationCode getTerminationCode()
          returns the TerminationCode of the Optimization process.
 double[] optimizeFunction(OptimizableFunction function)
          Method will optimize the given function using the current settings of the FunctionOptimizer.
 void setDimension(int dimension)
           
 void setFunctionAssembler(FunctionAssembler assembler)
          Sets a new FunctionAssembler for the optimization process.
 void setFunctionController(FunctionController controller)
          Sets a new FunctionController.
 void setInitialX(double[] x)
           
 void setOptimizationMode(FunctionOptimizer.OptimizationMode optimizationMode)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionOptimizer

public FunctionOptimizer(int dimension)

FunctionOptimizer

public FunctionOptimizer()
Method Detail

setFunctionAssembler

public void setFunctionAssembler(FunctionAssembler assembler)
Sets a new FunctionAssembler for the optimization process. Default setting is AdditiveFunctionAssembler.

Parameters:
assembler -

setFunctionController

public void setFunctionController(FunctionController controller)
Sets a new FunctionController. Defaults to ParallelFunctionController. In rare cases the overhead caused by the parallel execution may reduce the actual execution time. In this case use a SimpleFunctionController instead.

Parameters:
controller -

optimizeFunction

public double[] optimizeFunction(OptimizableFunction function)
Method will optimize the given function using the current settings of the FunctionOptimizer. Note that if you set the OptimizationMode to Gradient or Hessian, the OptimizableFunction must implement GradientOptimizableFunction or HessianOptmizableFunction respectively.

Parameters:
function -
Returns:

setDimension

public void setDimension(int dimension)

setInitialX

public void setInitialX(double[] x)

getOptimum

public double[] getOptimum()

getGradientAtOptimum

public double[] getGradientAtOptimum()

getFunctionAtOptimum

public double getFunctionAtOptimum()

getHessianAtOptimum

public double[][] getHessianAtOptimum()

getOptimizationMode

public FunctionOptimizer.OptimizationMode getOptimizationMode()
Returns:
the optimizationMode

setOptimizationMode

public void setOptimizationMode(FunctionOptimizer.OptimizationMode optimizationMode)
Parameters:
optimizationMode - the optimizationMode to set

getTerminationCode

public FunctionOptimizer.TerminationCode getTerminationCode()
returns the TerminationCode of the Optimization process. It should be checked to determine, whether the optimization was successful.

Returns:
the TermininationCode