|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.combean.adapters.qsopt.QSOptProblemAsLPSolver
public class QSOptProblemAsLPSolver
Field Summary | |
---|---|
static byte |
QSOPT_DUAL_SIMPLEX
|
static byte |
QSOPT_PRIMAL_SIMPLEX
|
Fields inherited from interface net.sourceforge.combean.interfaces.mathprog.lp.LPSolver |
---|
LPOBJ_COUNT, LPOBJ_MAX, LPOBJ_MIN, LPOBJ_UNDEFINED, LPSTAT_COUNT, LPSTAT_FAILURE, LPSTAT_INFEASIBLE, LPSTAT_SOLVED, LPSTAT_UNBOUNDED, LPSTAT_UNDEFINED |
Constructor Summary | |
---|---|
QSOptProblemAsLPSolver()
|
|
QSOptProblemAsLPSolver(qs.Problem qsProblem)
|
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. |
byte |
getSimplexKind()
|
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). |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte QSOPT_DUAL_SIMPLEX
public static final byte QSOPT_PRIMAL_SIMPLEX
Constructor Detail |
---|
public QSOptProblemAsLPSolver()
public QSOptProblemAsLPSolver(qs.Problem qsProblem)
Method Detail |
---|
public void setInitialDimensions(int numRows, int numColumns)
LPSolver
setInitialDimensions
in interface LPSolver
numRows
- number of rows to be reserved.numColumns
- number of columns to be reserved.public int addVariable(LPVariable variable)
LPSolver
addVariable
in interface LPSolver
variable
- the variable to be added.
public int addConstraint(LPConstraint constraint)
LPSolver
addConstraint
in interface LPSolver
constraint
- the constraint to be added.
public int addRow(LPConstraint constraint, SparseVector rowVec)
LPSolver
addRow
in interface LPSolver
constraint
- the constraint of the row to be addedrowVec
- the row vector of the constraint matrix to be added.
public int addColumn(LPVariable variable, SparseVector colVec)
LPSolver
addColumn
in interface LPSolver
variable
- the variable of the column to be addedcolVec
- the column vector of the constraint matrix to be added.
public void setObjective(byte objective)
LPSolver
setObjective
in interface LPSolver
objective
- the objectivepublic void freeze()
LPSolver
freeze
in interface LPSolver
public int getNumRows()
LPSolver
getNumRows
in interface LPSolver
public int getNumColumns()
LPSolver
getNumColumns
in interface LPSolver
public void solve()
LPSolver
solve
in interface LPSolver
public byte getSolutionStatus()
LPSolver
getSolutionStatus
in interface LPSolver
public double getSolutionValue()
LPSolver
getSolutionValue
in interface LPSolver
public SparseVector getSolution()
LPSolver
getSolution
in interface LPSolver
public String toString()
toString
in class Object
public byte getSimplexKind()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |