SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.optimization.unconstrained
Class UnconstrainedMaximizer

java.lang.Object
  extended by com.numericalmethod.suanshu.optimization.unconstrained.UnconstrainedMaximizer

public class UnconstrainedMaximizer
extends java.lang.Object

A maximization problem is simply minimizing the negative of the objective function. This class is simply provided as a wrapper class to solve a maximization problem using a Minimizer.


Constructor Summary
UnconstrainedMaximizer()
          Construct an instance of UnconstrainedMaximizer to maximize an objective function.
UnconstrainedMaximizer(UnconstrainedMinimizer minimizer)
          Construct an instance of UnconstrainedMaximizer to maximize an objective function.
 
Method Summary
 double[] search(int maxIterations, double... initials)
          Search for a maximizer that maximizes the objective function from the given starting points.
 Vector search(int maxIterations, Vector... initials)
          Search for a maximizer that maximizes the objective function from the given starting points.
 void solve(RealScalarFunction f, double tol)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnconstrainedMaximizer

public UnconstrainedMaximizer(UnconstrainedMinimizer minimizer)
Construct an instance of UnconstrainedMaximizer to maximize an objective function.

Parameters:
minimizer - the minimizer used to do maximization

UnconstrainedMaximizer

public UnconstrainedMaximizer()
Construct an instance of UnconstrainedMaximizer to maximize an objective function. By default, we use the NelderMead algorithm.

Method Detail

solve

public void solve(RealScalarFunction f,
                  double tol)

search

public Vector search(int maxIterations,
                     Vector... initials)
Search for a maximizer that maximizes the objective function from the given starting points.

Parameters:
maxIterations - the maximum number of iterations
initials - the initial guesses; they could include information such as boundaries
Returns:
an (approximate) maximizer

search

public double[] search(int maxIterations,
                       double... initials)
Search for a maximizer that maximizes the objective function from the given starting points.

Parameters:
maxIterations - the maximum number of iterations
initials - an initial guess
Returns:
an (approximate) maximizer

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.