|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.linprog.LPSolve
public class LPSolve
This is an integer linear program solver based on the Java port of lp_solve 2.0, available from: http://www.cs.wustl.edu/~javagrp/help/LinearProgramming.html
Constructor Summary | |
---|---|
LPSolve(int numConstraints,
int numVars)
Construct an LP with |
Method Summary | |
---|---|
void |
addConstraintEQ(double[] constraint,
double rhs)
Adds an equality constraint between the variables with coefficients |
void |
addConstraintGE(double[] constraint,
double rhs)
Adds a greater-than-or-equal constraint between the variables with coefficients |
double[] |
getEmptyConstraint()
Returns an array with a zero-entry for each variable in the linear program (which the client can then fill in with coefficients before checking in as a new constraint.) |
void |
setBoolVar(int i)
Constrains the i'th variable of this to be an integer. |
void |
setObjective(double[] obj)
Sets the objective function to be |
double[] |
solve()
Solve the program and return the value of the the variables (indices 0...numVars-1) in the optimum. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LPSolve(int numConstraints, int numVars)
Method Detail |
---|
public double[] getEmptyConstraint()
getEmptyConstraint
in interface LinearProgram
public void setObjective(double[] obj)
setObjective
in interface LinearProgram
public void setBoolVar(int i)
setBoolVar
in interface LinearProgram
public void addConstraintGE(double[] constraint, double rhs)
addConstraintGE
in interface LinearProgram
public void addConstraintEQ(double[] constraint, double rhs)
addConstraintEQ
in interface LinearProgram
public double[] solve()
solve
in interface LinearProgramSolver
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |