|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.dms.kjc.linprog.SimpleLinearProgram
public class SimpleLinearProgram
A simple implementation of the LinearProgram interface; keeps track of all the information that has been passed in with local fields.
| Field Summary | |
|---|---|
protected boolean[] |
boolVar
An array indicating whether or not a given variable should be constrained to be zero-one. |
protected List<at.dms.kjc.linprog.Constraint> |
constraints
Rows of Constraints. |
protected int |
numVars
Number of variables. |
protected double[] |
obj
The objective function. |
| Constructor Summary | |
|---|---|
SimpleLinearProgram(int numVars)
Create one of these 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 n)
Constrains the n'th variable of this to be a boolean variable (zero or one). |
void |
setObjective(double[] obj)
Sets the objective function to be |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int numVars
protected List<at.dms.kjc.linprog.Constraint> constraints
protected double[] obj
protected boolean[] boolVar
| Constructor Detail |
|---|
public SimpleLinearProgram(int numVars)
| Method Detail |
|---|
public double[] getEmptyConstraint()
getEmptyConstraint in interface LinearProgrampublic void setObjective(double[] obj)
setObjective in interface LinearProgrampublic void setBoolVar(int n)
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||