pyoptinterface.copt package¶
- class pyoptinterface.copt.EnvConfig(*args, **kwargs)¶
Bases:
object- set(self, arg0: str, arg1: str, /) None¶
- class pyoptinterface.copt.Model(env=None)¶
Bases:
RawModel- add_exp_cone_constraint(self, variables: collections.abc.Sequence[pyoptinterface._src.core_ext.VariableIndex], name: str = '', dual: bool = False) pyoptinterface._src.core_ext.ConstraintIndex¶
- add_linear_constraint(expr: VariableIndex | ScalarAffineFunction | ExprBuilder, sense: ConstraintSense, rhs: float, name: str = '')¶
- add_linear_constraint(expr: VariableIndex | ScalarAffineFunction | ExprBuilder, interval: Tuple[float, 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=None, lb=None, ub=None, name=None, start=None)¶
- add_mip_start(self, arg0: collections.abc.Sequence[pyoptinterface._src.core_ext.VariableIndex], arg1: collections.abc.Sequence[float], /) 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_nl_start(self, arg0: collections.abc.Sequence[pyoptinterface._src.core_ext.VariableIndex], arg1: collections.abc.Sequence[float], /) None¶
- add_quadratic_constraint(expr: ScalarQuadraticFunction | ExprBuilder, sense: ConstraintSense, rhs: float, name: str = '')¶
- add_quadratic_constraint(con: ComparisonConstraint, name: str = '')
- add_second_order_cone_constraint(self, variables: collections.abc.Sequence[pyoptinterface._src.core_ext.VariableIndex], name: str = '', rotated: bool = False) pyoptinterface._src.core_ext.ConstraintIndex¶
- 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+30, ub: float = 1e+30, name: str = '') pyoptinterface._src.core_ext.VariableIndex¶
- add_variables(*coords: Collection, domain=None, lb=None, ub=None, name=None, start=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_incumbent(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) float¶
- cb_get_info(what)¶
- cb_get_info_double(self, arg: str, /) float¶
- cb_get_info_int(self, arg: str, /) 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_info(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: str, /) float¶
- get_constraint_name(self, arg: pyoptinterface._src.core_ext.ConstraintIndex, /) str¶
- get_model_attribute(attribute: ModelAttribute)¶
- 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_attribute(param_name: str)¶
- get_raw_attribute_double(self, arg: str, /) float¶
- get_raw_attribute_int(self, arg: str, /) int¶
- 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_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_info(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: str, /) float¶
- get_variable_name(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) str¶
- get_variable_type(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) pyoptinterface._src.core_ext.VariableDomain¶
- init(self, arg: pyoptinterface._src.copt_model_ext.Env, /) 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_parameter_attribute_type(self, arg: str, /) int¶
- set_callback(self, arg0: collections.abc.Callable[[pyoptinterface._src.copt_model_ext.RawModel, int], None], arg1: int, /) None¶
- set_constraint_attribute(constraint, attribute: ConstraintAttribute, value)¶
- set_constraint_name(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: str, /) None¶
- set_logging(self, arg: collections.abc.Callable[[str], None], /) None¶
- set_model_attribute(attribute: ModelAttribute, value)¶
- 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_obj_sense(self, arg: pyoptinterface._src.core_ext.ObjectiveSense, /) 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_variable_attribute(variable, attribute: VariableAttribute, value)¶
- set_variable_bounds(self, variable: pyoptinterface._src.core_ext.VariableIndex, lb: float, ub: float) None¶
- set_variable_lower_bound(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: float, /) None¶
- set_variable_name(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: str, /) None¶
- set_variable_type(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: pyoptinterface._src.core_ext.VariableDomain, /) None¶
- set_variable_upper_bound(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: float, /) 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)¶
- version_string(self) str¶
- write(self, arg: str, /) None¶
- pyoptinterface.copt.autoload_library()¶