drasys.or.opt.lp
Interface LinearProgrammingI

All Known Implementing Classes:
DenseLPBase

public interface LinearProgrammingI

The interface used by all algorithms to access linear programming models.


Field Summary
static byte EQUAL
          Indicates an equality constraint: '=='
static byte GREATER
          Indicates a greater than or equal to constraint: '>='
static byte LESS
          Indicates a less than or equal to constraint: '<='
 
Method Summary
 void addConstraint(MatrixI coefficients, VectorI rightHandSides, byte[] type)
          Adds a set of constraints to the model.
 void addConstraint(VectorI coefficients, double rightHandSide, byte type)
          Adds a single constraint to the model.
 void ensureCapacity(int sizeOfRows, int sizeOfColumns)
          Ensures the algorithm has room to hold this many rows and columns.
 double getMaxAbsoluteValue()
          Gets largest absolute value in the equations.
 double getMinAbsoluteValue()
          Gets smallest absolute value in the equations.
 double getObjectiveValue()
          Returns the optimized value of the objective function.
 double getRangeMax()
          Gets smallest absolute value the algorithm will accept.
 double getRangeMin()
          Gets smallest absolute value the algorithm will accept.
 VectorI getSolution()
          Returns the solution vector.
 double maximize()
          Find the solution that maximizes the objective function.
 double minimize()
          Find the solution that minimizes the objective function.
 void removeAllElements()
          Removes all of the coefficients from the algorithm's data structures.
 void resize(int sizeOfRows, int sizeOfColumns)
          Changes the size of the model the algorithm can solve.
 void setAutomaticScaling(boolean automaticallyScale)
          Enables automatic scaling.
 void setEqualityFuzz(double fuzz)
          Sets the value that is used to relax equailty tests.
 void setMaxIterations(int maxIterations)
          Sets the maximum number of iterations.
 void setObjective(VectorI objective)
          Sets the objective function for the model.
 void setRange(double minAbsoluteValue, double maxAbsoluteValue)
          Sets smallest and largest absolute value the algorithm will accept.
 

Field Detail

LESS

public static final byte LESS
Indicates a less than or equal to constraint: '<='

EQUAL

public static final byte EQUAL
Indicates an equality constraint: '=='

GREATER

public static final byte GREATER
Indicates a greater than or equal to constraint: '>='
Method Detail

setEqualityFuzz

public void setEqualityFuzz(double fuzz)
Sets the value that is used to relax equailty tests. This value may be updated each time a new constrtaint is added, so set this after the last constraint.

setMaxIterations

public void setMaxIterations(int maxIterations)
Sets the maximum number of iterations.

setRange

public void setRange(double minAbsoluteValue,
                     double maxAbsoluteValue)
Sets smallest and largest absolute value the algorithm will accept.

getRangeMin

public double getRangeMin()
Gets smallest absolute value the algorithm will accept.

getRangeMax

public double getRangeMax()
Gets smallest absolute value the algorithm will accept.

getMinAbsoluteValue

public double getMinAbsoluteValue()
Gets smallest absolute value in the equations.

getMaxAbsoluteValue

public double getMaxAbsoluteValue()
Gets largest absolute value in the equations.

setAutomaticScaling

public void setAutomaticScaling(boolean automaticallyScale)
Enables automatic scaling. Automatic scaling is disabled by default.

removeAllElements

public void removeAllElements()
Removes all of the coefficients from the algorithm's data structures.

resize

public void resize(int sizeOfRows,
                   int sizeOfColumns)
Changes the size of the model the algorithm can solve.

ensureCapacity

public void ensureCapacity(int sizeOfRows,
                           int sizeOfColumns)
Ensures the algorithm has room to hold this many rows and columns.

addConstraint

public void addConstraint(VectorI coefficients,
                          double rightHandSide,
                          byte type)
Adds a single constraint to the model.

addConstraint

public void addConstraint(MatrixI coefficients,
                          VectorI rightHandSides,
                          byte[] type)
Adds a set of constraints to the model.

setObjective

public void setObjective(VectorI objective)
Sets the objective function for the model.

maximize

public double maximize()
                throws NoSolutionException,
                       UnboundedException,
                       ConvergenceException,
                       ScaleException
Find the solution that maximizes the objective function.
Returns:
the optimized value of the objective function.
Throws:
ScaleException - if autoscaling is disabled and a coefficient is outside the allowable range.
UnboundedException - if the constraints allow the objective to go to infinity.
NoSolutionException - if there is no feasible solution.
ConvergenceException - if the algorithm doesn't converge after the maximum iterations.

minimize

public double minimize()
                throws NoSolutionException,
                       UnboundedException,
                       ConvergenceException,
                       ScaleException
Find the solution that minimizes the objective function.
Returns:
the optimized value of the objective function.
Throws:
ScaleException - if autoscaling is disabled and a coefficient is outside the allowable range.
UnboundedException - if the constraints allow the objective to go to infinity.
NoSolutionException - if there is no feasible solution.
ConvergenceException - if the algorithm doesn't converge after the maximum iterations.

getObjectiveValue

public double getObjectiveValue()
Returns the optimized value of the objective function.

getSolution

public VectorI getSolution()
Returns the solution vector.


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com