|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgurobi.GRBColumn
public class GRBColumn
Gurobi column object. A column consists of a list of coefficient, constraint pairs. Columns are used to represent the set of constraints in which a variable participates, and the associated coefficients. They are temporary objects that typically have short lifespans.
You generally build columns by starting with an empty column (using
the GRBColumn
constructor), and then
adding terms. Terms can be added individually, using addTerm
, or in groups, using addTerms
. Terms can also be removed from a column,
using remove
.
Individual terms in a column can be queried using the getConstr
, and getCoeff
methods. You can query the number of terms in the column
using the size
method.
Constructor Summary | |
---|---|
GRBColumn()
Create an empty column. |
|
GRBColumn(GRBColumn col)
Copy an existing column. |
Method Summary | |
---|---|
void |
addTerm(double coeff,
GRBConstr constr)
Add a single term into a column. |
void |
addTerms(double[] coeffs,
GRBConstr[] constrs)
Add a list of terms into a column. |
void |
addTerms(double[] coeffs,
GRBConstr[] constrs,
int start,
int len)
Add new terms into a column. |
void |
clear()
Remove all terms from a column. |
protected void |
finalize()
|
double |
getCoeff(int i)
Retrieve the coefficient from a single term in the column. |
GRBConstr |
getConstr(int i)
Retrieve the constraint object from a single term in the column. |
boolean |
remove(GRBConstr constr)
Remove the term associated with constraint constr from the column. |
void |
remove(int i)
Remove the term stored at index i of the column. |
int |
size()
Retrieve the number of terms in the column. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GRBColumn()
public GRBColumn(GRBColumn col) throws GRBException
col
- Existing column object.
GRBException
Method Detail |
---|
protected void finalize()
finalize
in class java.lang.Object
public int size()
public GRBConstr getConstr(int i) throws GRBException
i
- Index for term of interest.
GRBException
public double getCoeff(int i) throws GRBException
i
- Index for coefficient of interest.
GRBException
public void addTerm(double coeff, GRBConstr constr)
coeff
- Coefficient for new term.constr
- Constraint for new term.public void addTerms(double[] coeffs, GRBConstr[] constrs) throws GRBException
coeffs
- Coefficients for added constraints.constrs
- Constraints to add to column.
GRBException
public void addTerms(double[] coeffs, GRBConstr[] constrs, int start, int len) throws GRBException
start
and len
arguments allow you to
specify which terms to add.
coeffs
- Coefficients for added constraints.constrs
- Constraints to add to column.start
- The first term in the list to add.len
- The number of terms to add.
GRBException
public void remove(int i)
i
- The index of the term to be removed.public boolean remove(GRBConstr constr)
constr
- The constraint whose term should be removed.
public void clear()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |