add_SOSAdd a SOS (Special Ordered Sets) constraint. int add_SOS(lprec *lp, char *name, int sostype, int priority, int count, int *sosvars, REAL *weights); Return Value add_SOS returns the list index of the new SOS if the operation was successful. A return value of 0 indicates an error. Parameters lp Pointer to previously created lp model. See return value of make_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI name The name of the SOS constraint. sostype The type of the SOS constraint. Must be >= 1 priority Priority of the SOS constraint in the SOS set. count The number of variables in the SOS list. sosvars An array specifying the count variables (their column numbers). weights An array specifying the count variable weights. May also be NULL. In that case, lp_solve will weight the variables in the order they are specified. Remarks The add_SOS function adds an SOS constraint. Example
See Also make_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, is_SOS_var |