Problem retrieving routines

Problem.get_prob_name()

Retrieve problem name

Returns:the problem name
Return type:str
Problem.get_obj_name()

Retrieve objective function name

Returns:the objective name
Return type:str
Problem.get_obj_dir()

Retrieve optimization direction flag

Returns:the objective direction, either 'minimize' or 'maximize'
Return type:str
Problem.get_num_rows()

Retrieve number of rows

Returns:the number of rows
Return type:int
Problem.get_num_cols()

Retrieve number of columns

Returns:the number of columns
Return type:int
Problem.get_row_name(int row)

Retrieve row name

Parameters:row (int) – the index of the row
Returns:the row name
Return type:str
Problem.get_row_name_if(int row, names_preferred=False)
Parameters:
  • row (int) – the index of the row
  • names_preferred (bool) – whether to return the row name or index
Returns:

the row name or index

Return type:

str or int

Problem.get_col_name(int col)

Retrieve column name

Parameters:col (int) – the index of the column
Returns:the problem name
Return type:str
Problem.get_col_name_if(int col, names_preferred=False)
Parameters:
  • col (int) – the index of the column
  • names_preferred (bool) – whether to return the column name or index
Returns:

the column name or index

Return type:

str or int

Problem.get_row_or_col_name(int ind)

Retrieve row or column name

Parameters:ind (int) – the row/column index
Returns:a pair, either 'row' or 'col' and the row or column name
Return type:(str, str)
Problem.get_row_or_col_name_if(int ind, names_preferred=False)
Parameters:
  • ind (int) – the row/column index
  • names_preferred (bool) – whether to return the row or column name or index
Returns:

a pair, either 'row' or 'col' and the row or column name

Return type:

(str, str)

Problem.get_row_type(row)

Retrieve row type

Parameters:row (int or str) – the index or name of the row
Returns:the row type, either 'free', 'dominating', 'dominated', 'bounded', or 'fixed'
Return type:str
Problem.get_row_lb(row)

Retrieve row lower bound

Parameters:row (int or str) – the index or name of the row
Returns:the lower bound
Return type:float
Problem.get_row_ub(row)

Retrieve row upper bound

Parameters:row (int or str) – the index or name of the row
Returns:the upper bound
Return type:float
Problem.get_col_type(col)

Retrieve column type

Parameters:col (int or str) – the index or name of the column
Returns:the column type, either 'free', 'dominating', 'dominated', 'bounded', or 'fixed'
Return type:str
Problem.get_col_lb(col)

Retrieve column lower bound

Parameters:col (int or str) – the index or name of the column
Returns:the lower bound
Return type:float
Problem.get_row_ub(row)

Retrieve row upper bound

Parameters:row (int or str) – the index or name of the row
Returns:the upper bound
Return type:float
Problem.get_obj_coef(col)

Retrieve obj. coefficient

Parameters:col (int or str) – the index or name of the column
Returns:the coefficient value
Return type:float
Problem.get_obj_const()

Retrieve obj. constant term

Returns:the constant value
Return type:float
Problem.get_num_nz()

Retrieve number of constraint coefficients

Returns:the number of (non-zero) constraint coefficients
Return type:int
Problem.get_mat_row(row, names_preferred=False)

Retrieve row of the constraint matrix

Parameters:
  • row (int or str) – the index or name of the row
  • names_preferred (bool) – whether to return row and column names or indices
Returns:

the row

Rtype coeffs:

Mapping from column names (str strings) to coefficient values (Real)

Problem.get_mat_col(col, names_preferred=False)

Retrieve column of the constraint matrix

Parameters:
  • col (int or str) – the index or name of the column
  • names_preferred (bool) – whether to return row and column names or indices
Returns:

the column

Rtype coeffs:

Mapping from row names (str strings) to coefficient values (Real)