8.5.13. MDOColumn¶
-
class MDOColumn¶
Represent a column in constraint matrix in MindOpt application.
Methods
Add a term to this column
Add terms to this column
Clear all terms contained in this column
Retrieve the ith coefficient associated with this column
Retrieve the ith constraint associated with this column
Remove the ith term from this column
Remove all terms containing a specified constraint
Retrieve the number of terms contained in column
-
void addTerm(double coeff, MDOConstr constr)¶
Add a term to this column.
- Parameters
double coeff – The coefficient of the term to be added.
MDOConstr constr – The constraint of the term to be added.
-
void addTerms(const double *coeff, const MDOConstr *constr, int cnt)¶
Add terms to this column.
- Parameters
const double* coeff – The coefficients of the terms to be added.
const MDOConstr* constr – The constraints of the terms to be added.
int cnt – The number of terms to be added.
-
void clear()¶
Clear all terms contained in this column.
-
double getCoeff(int i)¶
Retrieve the ith coefficient associated with this column.
- Parameters
int i – The index of their coefficient to be retrieved.
- Returns
The ith coefficient associated with this column.
-
MDOConstr getConstr(int i)¶
Retrieve the ith constraint associated with this column.
- Parameters
int i – The index of the constraint to be retrieved.
- Returns
The ith constraint associated with this column.
-
void remove(int i)¶
Remove the ith term from this column.
- Parameters
int i – The index of the term to be removed.
-
bool remove(MDOConstr c)¶
Remove all terms containing a specified constraint.
- Parameters
MDOConstr c – The constraint to be removed.
- Returns
True if at least one term was removed.
-
unsigned int size()¶
Retrieve the number of terms contained in column.
- Returns
The number of terms contained in column.
-
void addTerm(double coeff, MDOConstr constr)¶