|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LPSolver
An LP solver which allows a linear programming problem to be constructed and solved.
Field Summary | |
---|---|
static byte |
LPOBJ_COUNT
|
static byte |
LPOBJ_MAX
|
static byte |
LPOBJ_MIN
|
static byte |
LPOBJ_UNDEFINED
|
static byte |
LPSTAT_COUNT
|
static byte |
LPSTAT_FAILURE
|
static byte |
LPSTAT_INFEASIBLE
|
static byte |
LPSTAT_SOLVED
|
static byte |
LPSTAT_UNBOUNDED
|
static byte |
LPSTAT_UNDEFINED
|
Method Summary | |
---|---|
int |
addColumn(LPVariable variable,
SparseVector colVec)
Add a column to the LP problem. |
int |
addConstraint(LPConstraint constraint)
Add a constraint to the LP problem. |
int |
addRow(LPConstraint constraint,
SparseVector rowVec)
Add a row to the LP problem. |
int |
addVariable(LPVariable variable)
Add a variable to the LP problem. |
void |
freeze()
This method must be called after the LP has been constructed and before the solver is called. |
int |
getNumColumns()
The number of columns of the LP. |
int |
getNumRows()
The number of rows of the LP. |
SparseVector |
getSolution()
Get the primal solution vector of LP. |
byte |
getSolutionStatus()
Return the status of the solver has attempted to solve the problem. |
double |
getSolutionValue()
Get value of objective function. |
void |
setInitialDimensions(int numRows,
int numColumns)
A hint to the memory management. |
void |
setObjective(byte objective)
Set the objective of the LP (min or max). |
void |
solve()
Solve the LP (usually from scratch). |
Field Detail |
---|
static final byte LPOBJ_UNDEFINED
static final byte LPOBJ_MAX
static final byte LPOBJ_MIN
static final byte LPOBJ_COUNT
static final byte LPSTAT_UNDEFINED
static final byte LPSTAT_SOLVED
static final byte LPSTAT_INFEASIBLE
static final byte LPSTAT_UNBOUNDED
static final byte LPSTAT_FAILURE
static final byte LPSTAT_COUNT
Method Detail |
---|
void setInitialDimensions(int numRows, int numColumns)
numRows
- number of rows to be reserved.numColumns
- number of columns to be reserved.int addVariable(LPVariable variable)
variable
- the variable to be added.
int addConstraint(LPConstraint constraint)
constraint
- the constraint to be added.
int addRow(LPConstraint constraint, SparseVector rowVec)
constraint
- the constraint of the row to be addedrowVec
- the row vector of the constraint matrix to be added.
int addColumn(LPVariable variable, SparseVector colVec)
variable
- the variable of the column to be addedcolVec
- the column vector of the constraint matrix to be added.
void setObjective(byte objective)
objective
- the objectivevoid freeze()
int getNumRows()
int getNumColumns()
void solve()
byte getSolutionStatus()
double getSolutionValue()
SparseVector getSolution()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |