problem
Class VectorFunctionToProblem

java.lang.Object
  extended by problem.BasicOptimizationProblem
      extended by problem.BasicBoundConstrainedProblem
          extended by problem.BasicInequalityConstrainedProblem
              extended by problem.VectorFunctionToProblem
All Implemented Interfaces:
BoundConstrainedProblem, InequalityConstrainedProblem, OptimizationProblem

public class VectorFunctionToProblem
extends BasicInequalityConstrainedProblem

Adapts a VectorFunction to an InequalityConstrainedProblem. As of now, this does not combine a VectorFunction with ScalarFunctions to create a problem in which one routine computes the objective and some constraints, and the other constraints are computed individually.

Author:
dgorur

Field Summary
 
Fields inherited from class problem.BasicBoundConstrainedProblem
constraintViolations, tmpArr
 
Fields inherited from class problem.BasicOptimizationProblem
formatter
 
Constructor Summary
VectorFunctionToProblem()
           
 
Method Summary
 boolean addInequalityConstraint(ScalarFunction con)
          Adds the given ScalarFunction as an inequality constraint.
protected  void computeConstraintViolations(double[] x)
          Computes inequality constraint violations in addition to bound constraint violations.
 int getConstraintCount()
          Returns the number of constraints that this problem has.
 ScalarFunction getObjective()
          Returns the objective for this problem, which is a ScalarFunction.
 VectorFunction getVectorFunction()
          Returns the vector function used by this adapter.
 void init()
          Initialization routine.
 DataPoint makeDataPoint(double[] x)
          Constructs and returns a DataPoint corresponding to a given input, containing the associated objective values and constraint violations.
protected  cern.colt.matrix.DoubleMatrix2D makeOutputs(cern.colt.matrix.DoubleMatrix2D X)
           
 boolean removeInequalityConstraint(ScalarFunction con)
          Removes the given ScalarFunction from the list of constraints.
 void setObjective(ScalarFunction obj)
          NOTE: Does nothing! In contrast, @see problem.BasicOptimizationProblem#setObjective(function.ScalarFunction)
 void setVectorFunction(VectorFunction vectorFunction)
          Sets the vector function to be used for this adapter.
 
Methods inherited from class problem.BasicInequalityConstrainedProblem
addConstraintViolations, getConstraints
 
Methods inherited from class problem.BasicBoundConstrainedProblem
getBounds, getConstraintViolations, setBounds
 
Methods inherited from class problem.BasicOptimizationProblem
getInputDimension, getOutputDimension, makeDataBlock, setInputDimension, setOutputDimension, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface problem.BoundConstrainedProblem
getConstraintViolations, setBounds
 
Methods inherited from interface problem.OptimizationProblem
getBounds, getInputDimension, getOutputDimension, makeDataBlock
 

Constructor Detail

VectorFunctionToProblem

public VectorFunctionToProblem()
Method Detail

addInequalityConstraint

public boolean addInequalityConstraint(ScalarFunction con)
Description copied from interface: InequalityConstrainedProblem
Adds the given ScalarFunction as an inequality constraint.

Specified by:
addInequalityConstraint in interface InequalityConstrainedProblem
Overrides:
addInequalityConstraint in class BasicInequalityConstrainedProblem
Parameters:
con - the given ScalarFunction.
Returns:
true
See Also:
ArrayList.add(Object)

getConstraintCount

public int getConstraintCount()
Description copied from interface: InequalityConstrainedProblem
Returns the number of constraints that this problem has.

Specified by:
getConstraintCount in interface InequalityConstrainedProblem
Overrides:
getConstraintCount in class BasicInequalityConstrainedProblem
Returns:
the number of constraint functions.

getObjective

public ScalarFunction getObjective()
Description copied from interface: OptimizationProblem
Returns the objective for this problem, which is a ScalarFunction.

Specified by:
getObjective in interface OptimizationProblem
Overrides:
getObjective in class BasicOptimizationProblem
Returns:
the objective for this problem.

getVectorFunction

public VectorFunction getVectorFunction()
Returns the vector function used by this adapter.

Returns:
the vector function used by this adapter.

init

public void init()
Description copied from interface: OptimizationProblem
Initialization routine.

Specified by:
init in interface OptimizationProblem
Overrides:
init in class BasicInequalityConstrainedProblem

makeDataPoint

public DataPoint makeDataPoint(double[] x)
Description copied from interface: OptimizationProblem
Constructs and returns a DataPoint corresponding to a given input, containing the associated objective values and constraint violations.

Specified by:
makeDataPoint in interface OptimizationProblem
Overrides:
makeDataPoint in class BasicBoundConstrainedProblem
Parameters:
x - the given input.
Returns:
a DataPoint corresponding to this input.

removeInequalityConstraint

public boolean removeInequalityConstraint(ScalarFunction con)
Description copied from interface: InequalityConstrainedProblem
Removes the given ScalarFunction from the list of constraints.

Specified by:
removeInequalityConstraint in interface InequalityConstrainedProblem
Overrides:
removeInequalityConstraint in class BasicInequalityConstrainedProblem
Parameters:
con - the given ScalarFunction.
Returns:
true if the given constraint was found in the list of constraints.
See Also:
ArrayList.remove(Object)

setObjective

public void setObjective(ScalarFunction obj)
NOTE: Does nothing! In contrast, @see problem.BasicOptimizationProblem#setObjective(function.ScalarFunction)

Specified by:
setObjective in interface OptimizationProblem
Overrides:
setObjective in class BasicOptimizationProblem
Parameters:
obj - the given objective.

setVectorFunction

public void setVectorFunction(VectorFunction vectorFunction)
Sets the vector function to be used for this adapter.

Parameters:
vectorFunction - the given vector function.

computeConstraintViolations

protected void computeConstraintViolations(double[] x)
Description copied from class: BasicInequalityConstrainedProblem
Computes inequality constraint violations in addition to bound constraint violations.

Overrides:
computeConstraintViolations in class BasicInequalityConstrainedProblem
Parameters:
x - the given input.
See Also:
BasicBoundConstrainedProblem.computeConstraintViolations(double[])

makeOutputs

protected cern.colt.matrix.DoubleMatrix2D makeOutputs(cern.colt.matrix.DoubleMatrix2D X)
Overrides:
makeOutputs in class BasicBoundConstrainedProblem