Problem creating and modifying routines¶
-
Problem.set_prob_name(str name)¶ Assign (change) problem name
Parameters: name ( str) – the name of the problem, it may not exceed 255 bytes encoded as UTF-8
-
Problem.set_obj_name(str name)¶ Assign (change) objective function name
Parameters: name ( str) – the name of the objective, it may not exceed 255 bytes encoded as UTF-8
-
Problem.set_obj_dir(str direction)¶ Set (change) optimization direction flag
Parameters: direction ( str) – the objective direction, either'minimize'or'maximize'
-
Problem.add_rows(int number)¶ Add new rows to problem object
Parameters: number ( int) – the number of rows to addReturns: the index of the first row added Return type: int
-
Problem.add_named_rows(*names)¶ Add new rows to problem object
Parameters: names ( tupleofstr) – the names of the rows to add, none may exceed 255 bytes encoded as UTF-8
-
Problem.add_cols(int number)¶ Add new columns to problem object
Parameters: number ( int) – the number of columns to addReturns: the index of the first column added Return type: int
-
Problem.add_named_cols(*names)¶ Add new columns to problem object
Parameters: names ( tupleofstr) – the names of the columns to add, none may exceed 255 bytes encoded as UTF-8
-
Problem.set_row_name(row, str name)¶ Change row name
Parameters:
-
Problem.set_col_name(col, str name)¶ Change column name
Parameters:
-
Problem.set_row_bnds(row, lower, upper)¶ Set (change) row bounds
Parameters:
-
Problem.set_col_bnds(col, lower, upper)¶ Set (change) column bounds
Parameters:
-
Problem.set_obj_coef(col, double coeff)¶ Set (change) obj. coefficient
Parameters:
-
Problem.set_obj_const(double coeff)¶ Set (change) obj. constant term
Parameters: coeff ( Real) – the coefficient value
-
Problem.set_mat_row(row, coeffs)¶ Set (replace) row of the constraint matrix
Parameters:
-
Problem.clear_mat_row(row)¶ Clear row of the constraint matrix
Parameters: row ( intorstr) – the index or name of the row
-
Problem.set_mat_col(col, coeffs)¶ Set (replace) column of the constraint matrix
Parameters:
-
Problem.clear_mat_col(col)¶ Clear column of the constraint matrix
Parameters: col ( intorstr) – the index or name of the column
-
Problem.load_matrix(coeffs)¶ Load (replace) the whole constraint matrix
Parameters: coeffs – Mappingfrom row and column name (str string) pairs (length-2tuple) to coefficient values (Real)
-
Problem.clear_matrix()¶ Clear the whole constraint matrix
-
Problem.sort_matrix()¶ Sort elements of the constraint matrix
-
Problem.del_rows(*rows)¶ Delete specified rows from problem object
Parameters: rows ( tupleofintorstr) – the indices or names of the rows
-
Problem.del_cols(*cols)¶ Delete specified columns from problem object
Parameters: cols ( tupleofintorstr) – the indices or the names of the columns
-
Problem.copy_prob(Problem source, bool copy_names)¶ Copy problem object content
Parameters: Returns: the copied problem
Return type:
-
Problem.erase_prob()¶ Erase problem object content