pyoptinterface.gurobi package

class pyoptinterface.gurobi.Env(*args, **kwargs)

Bases: RawEnv

close(self) None
raw_parameter_type(self, arg: str, /) int
set_raw_parameter(param_name: str, value)
set_raw_parameter_double(self, arg0: str, arg1: float, /) None
set_raw_parameter_int(self, arg0: str, arg1: int, /) None
set_raw_parameter_string(self, arg0: str, arg1: str, /) None
start(self) None
class pyoptinterface.gurobi.Model(env=None)

Bases: RawModel

add_linear_constraint(expr: VariableIndex | ScalarAffineFunction | ExprBuilder, sense: ConstraintSense, rhs: float, name: str = '')
add_linear_constraint(con: ComparisonConstraint, name: str = '')
add_m_linear_constraints(A, x, sense, b)

add constraints Ax <= / = / >= b

A is a 2-dimensional numpy array or scipy sparse matrix x is an iterable of variables sense is one of (poi.Leq, poi.Eq, poi.Geq) b is an iterable of values or a single scalar

add_m_variables(shape: Tuple[int, ...] | int, domain: VariableDomain | None = None, lb: float | None = None, ub: float | None = None, name: str | None = None, start: float | None = None)
add_nl_constraint(expr, sense: ConstraintSense, rhs: float, /, name: str = '')
add_nl_constraint(expr, interval: Tuple[float, float], /, name: str = '')
add_nl_constraint(con, /, name: str = '')
add_nl_objective(expr)
add_quadratic_constraint(expr: ScalarQuadraticFunction | ExprBuilder, sense: ConstraintSense, rhs: float, name: str = '')
add_quadratic_constraint(con: ComparisonConstraint, name: str = '')
add_second_order_cone_constraint(cone_variables, name='', rotated=False)

Convert a second order cone constraint to a quadratic constraint. x[0] >= sqrt(x[1]^2 + … + x[n]^2) to x[0]^2 - x[1]^2 - … - x[n]^2 >= 0 or convert a rotated second order cone constraint to a quadratic constraint. 2 * x[0] * x[1] >= x[2]^2 + … + x[n]^2 to 2 * x[0] * x[1] - x[2]^2 - … - x[n]^2 >= 0

add_sos_constraint(self, arg0: collections.abc.Sequence[pyoptinterface._src.core_ext.VariableIndex], arg1: pyoptinterface._src.core_ext.SOSType, /) pyoptinterface._src.core_ext.ConstraintIndex
add_sos_constraint(self, arg0: collections.abc.Sequence[pyoptinterface._src.core_ext.VariableIndex], arg1: pyoptinterface._src.core_ext.SOSType, arg2: collections.abc.Sequence[float], /) pyoptinterface._src.core_ext.ConstraintIndex
add_variable(self, domain: pyoptinterface._src.core_ext.VariableDomain = VariableDomain.Continuous, lb: float = -1e+100, ub: float = 1e+100, name: str = '') pyoptinterface._src.core_ext.VariableIndex
add_variables(*coords: Collection, domain: VariableDomain | None = None, lb: float | None = None, ub: float | None = None, name: str | None = None, start: float | None = None)
cb_add_lazy_constraint(self, expr: pyoptinterface._src.core_ext.ScalarAffineFunction, sense: pyoptinterface._src.core_ext.ConstraintSense, rhs: float) None
cb_add_lazy_constraint(self, expr: pyoptinterface._src.core_ext.ExprBuilder, sense: pyoptinterface._src.core_ext.ConstraintSense, rhs: float) None
cb_add_user_cut(self, expr: pyoptinterface._src.core_ext.ScalarAffineFunction, sense: pyoptinterface._src.core_ext.ConstraintSense, rhs: float) None
cb_add_user_cut(self, expr: pyoptinterface._src.core_ext.ExprBuilder, sense: pyoptinterface._src.core_ext.ConstraintSense, rhs: float) None
cb_exit(self) None
cb_get_info(what)
cb_get_info_double(self, arg: int, /) float
cb_get_info_int(self, arg: int, /) int
cb_get_relaxation(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) float
cb_get_solution(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) float
cb_set_solution(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: float, /) None
cb_submit_solution(self) float
close(self) None
computeIIS(self) None
delete_constraint(self, arg: pyoptinterface._src.core_ext.ConstraintIndex, /) None
delete_variable(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) None
delete_variables(self, arg: collections.abc.Sequence[pyoptinterface._src.core_ext.VariableIndex], /) None
get_constraint_attribute(constraint, attribute: ConstraintAttribute)
get_constraint_raw_attribute(constraint, name: str)
get_constraint_raw_attribute_char(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: str, /) str
get_constraint_raw_attribute_double(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: str, /) float
get_constraint_raw_attribute_int(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: str, /) int
get_constraint_raw_attribute_string(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: str, /) str
get_model_attribute(attribute: ModelAttribute)
get_model_raw_attribute(name: str)
get_model_raw_attribute_double(self, arg: str, /) float
get_model_raw_attribute_int(self, arg: str, /) int
get_model_raw_attribute_list_double(self, arg0: str, arg1: collections.abc.Sequence[int], /) list[float]
get_model_raw_attribute_string(self, arg: str, /) str
get_model_raw_attribute_vector_double(self, arg0: str, arg1: int, arg2: int, /) list[float]
get_normalized_coefficient(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: pyoptinterface._src.core_ext.VariableIndex, /) float
get_normalized_rhs(self, arg: pyoptinterface._src.core_ext.ConstraintIndex, /) float
get_objective_coefficient(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) float
get_raw_model(self) types.CapsuleType
get_raw_parameter(param_name: str)
get_raw_parameter_double(self, arg: str, /) float
get_raw_parameter_int(self, arg: str, /) int
get_raw_parameter_string(self, arg: str, /) str
get_value(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) float
get_value(self, arg: pyoptinterface._src.core_ext.ScalarAffineFunction, /) float
get_value(self, arg: pyoptinterface._src.core_ext.ScalarQuadraticFunction, /) float
get_value(self, arg: pyoptinterface._src.core_ext.ExprBuilder, /) float
get_variable_attribute(variable, attribute: VariableAttribute)
get_variable_raw_attribute(variable, name: str)
get_variable_raw_attribute_char(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: str, /) str
get_variable_raw_attribute_double(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: str, /) float
get_variable_raw_attribute_int(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: str, /) int
get_variable_raw_attribute_string(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: str, /) str
init(self, arg: pyoptinterface._src.gurobi_model_ext.RawEnv, /) None
is_constraint_active(self, arg: pyoptinterface._src.core_ext.ConstraintIndex, /) bool
is_variable_active(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) bool
number_of_constraints(type: ConstraintType)
number_of_variables()
optimize(self) None
pprint(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) str
pprint(self, expr: pyoptinterface._src.core_ext.ScalarAffineFunction, precision: int = 4) str
pprint(self, expr: pyoptinterface._src.core_ext.ScalarQuadraticFunction, precision: int = 4) str
pprint(self, expr: pyoptinterface._src.core_ext.ExprBuilder, precision: int = 4) str
raw_attribute_type(self, arg: str, /) int
raw_parameter_type(self, arg: str, /) int
set_callback(self, arg: collections.abc.Callable[[pyoptinterface._src.gurobi_model_ext.RawModel, int], None], /) None
set_constraint_attribute(constraint, attribute: ConstraintAttribute, value)
set_constraint_name(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: str, /) None
set_constraint_raw_attribute(constraint, name: str, value)
set_constraint_raw_attribute_char(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: str, arg2: str, /) None
set_constraint_raw_attribute_double(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: str, arg2: float, /) None
set_constraint_raw_attribute_int(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: str, arg2: int, /) None
set_constraint_raw_attribute_string(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: str, arg2: str, /) None
set_logging(self, arg: collections.abc.Callable[[str], None], /) None
set_model_attribute(attribute: ModelAttribute, value)
set_model_raw_attribute(name: str, value)
set_model_raw_attribute_double(self, arg0: str, arg1: float, /) None
set_model_raw_attribute_int(self, arg0: str, arg1: int, /) None
set_model_raw_attribute_string(self, arg0: str, arg1: str, /) None
set_normalized_coefficient(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: pyoptinterface._src.core_ext.VariableIndex, arg2: float, /) None
set_normalized_rhs(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: float, /) None
set_objective(self, expr: pyoptinterface._src.core_ext.ScalarQuadraticFunction, sense: pyoptinterface._src.core_ext.ObjectiveSense = ObjectiveSense.Minimize) None
set_objective(self, expr: pyoptinterface._src.core_ext.ScalarAffineFunction, sense: pyoptinterface._src.core_ext.ObjectiveSense = ObjectiveSense.Minimize) None
set_objective(self, expr: pyoptinterface._src.core_ext.ExprBuilder, sense: pyoptinterface._src.core_ext.ObjectiveSense = ObjectiveSense.Minimize) None
set_objective(self, expr: pyoptinterface._src.core_ext.VariableIndex, sense: pyoptinterface._src.core_ext.ObjectiveSense = ObjectiveSense.Minimize) None
set_objective(self, expr: float, sense: pyoptinterface._src.core_ext.ObjectiveSense = ObjectiveSense.Minimize) None
set_objective_coefficient(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: float, /) None
set_raw_parameter(param_name: str, value)
set_raw_parameter_double(self, arg0: str, arg1: float, /) None
set_raw_parameter_int(self, arg0: str, arg1: int, /) None
set_raw_parameter_string(self, arg0: str, arg1: str, /) None
set_variable_attribute(variable, attribute: VariableAttribute, value)
set_variable_bounds(self, variable: pyoptinterface._src.core_ext.VariableIndex, lb: float, ub: float) None
set_variable_name(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: str, /) None
set_variable_raw_attribute(variable, name: str, value)
set_variable_raw_attribute_char(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: str, arg2: str, /) None
set_variable_raw_attribute_double(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: str, arg2: float, /) None
set_variable_raw_attribute_int(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: str, arg2: int, /) None
set_variable_raw_attribute_string(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: str, arg2: str, /) None
static supports_constraint_attribute(attribute: ConstraintAttribute, settable=False)
static supports_model_attribute(attribute: ModelAttribute, settable=False)
static supports_variable_attribute(attribute: VariableAttribute, settable=False)
update(self) None
version_string(self) str
write(self, arg: str, /) None
pyoptinterface.gurobi.autoload_library()