add_constraint, add_constraintex, str_add_constraintAdd a constraint to the lp. unsigned char add_constraint(lprec *lp, REAL *row, int constr_type, REAL rh); unsigned char add_constraintex(lprec *lp, int count, REAL *row, int *colno, int constr_type, REAL rh); unsigned char str_add_constraint(lprec *lp, char *row_string, int constr_type, REAL rh); Return Value add_constraint, add_constraintex and str_add_constraint return TRUE (1) if the operation was successful. A return value of FALSE (0) indicates an error. Parameters lp Pointer to previously created lp model. See return value of make_lp, read_lp, read_LP, read_lpt, read_LPT, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI count Number of elements in row and colno. row An array with 1+column (count for add_constraintex) elements that contains the values of the row. colno An array with count elements that contains the column numbers of the row. However this variable can also be NULL. In that case element i in the variable row is column i. row_string A string with column elements that contains the values of the row. Each element must be separated by space(s). constr_type The type of the constraint. Can by any of the following values:
rh The value of the right hand side (RHS). Remarks The add_constraint, add_constraintex, str_add_constraint functions add a row to the
model (at the end) and sets all values of the row at once. Example
See Also make_lp, read_lp, read_LP, read_lpt, read_LPT, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, set_obj_fn, set_obj_fnex, str_set_obj_fn, set_obj, set_add_rowmode, is_add_rowmode, get_constr_type, is_constr_type, del_constraint, add_column, add_columnex, str_add_column, get_column, get_row, get_mat |