pyoptinterface.xpress package¶
- class pyoptinterface.xpress.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: VariableDomain | None = None, lb: float | None = None, ub: float | None = None, name: str | None = None, start: float | None = None)¶
- add_mip_start(self, variables: collections.abc.Sequence[pyoptinterface._src.core_ext.VariableIndex], values: 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_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, variables: collections.abc.Sequence[pyoptinterface._src.core_ext.VariableIndex], sos_type: pyoptinterface._src.core_ext.SOSType, weights: collections.abc.Sequence[float]) pyoptinterface._src.core_ext.ConstraintIndex¶
- add_sos_constraint(self, variables: collections.abc.Sequence[pyoptinterface._src.core_ext.VariableIndex], sos_type: pyoptinterface._src.core_ext.SOSType) pyoptinterface._src.core_ext.ConstraintIndex
- add_variable(self, domain: pyoptinterface._src.core_ext.VariableDomain = VariableDomain.Continuous, lb: float = -1e+20, ub: float = 1e+20, 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, function: pyoptinterface._src.core_ext.ScalarAffineFunction, sense: pyoptinterface._src.core_ext.ConstraintSense, rhs: float) None¶
- cb_add_lazy_constraint(self, function: pyoptinterface._src.core_ext.ExprBuilder, sense: pyoptinterface._src.core_ext.ConstraintSense, rhs: float) None
- cb_add_user_cut(self, function: pyoptinterface._src.core_ext.ScalarAffineFunction, sense: pyoptinterface._src.core_ext.ConstraintSense, rhs: float) None¶
- cb_add_user_cut(self, function: pyoptinterface._src.core_ext.ExprBuilder, sense: pyoptinterface._src.core_ext.ConstraintSense, rhs: float) None
- cb_exit(self) None¶
- cb_get_arguments(self) None | pyoptinterface._src.xpress_model_ext.bariteration_struct | pyoptinterface._src.xpress_model_ext.barlog_struct | pyoptinterface._src.xpress_model_ext.afterobjective_struct | pyoptinterface._src.xpress_model_ext.beforeobjective_struct | pyoptinterface._src.xpress_model_ext.presolve_struct | pyoptinterface._src.xpress_model_ext.checktime_struct | pyoptinterface._src.xpress_model_ext.chgbranchobject_struct | pyoptinterface._src.xpress_model_ext.cutlog_struct | pyoptinterface._src.xpress_model_ext.cutround_struct | pyoptinterface._src.xpress_model_ext.destroymt_struct | pyoptinterface._src.xpress_model_ext.gapnotify_struct | pyoptinterface._src.xpress_model_ext.miplog_struct | pyoptinterface._src.xpress_model_ext.infnode_struct | pyoptinterface._src.xpress_model_ext.intsol_struct | pyoptinterface._src.xpress_model_ext.lplog_struct | pyoptinterface._src.xpress_model_ext.message_struct | pyoptinterface._src.xpress_model_ext.newnode_struct | pyoptinterface._src.xpress_model_ext.nodecutoff_struct | pyoptinterface._src.xpress_model_ext.nodelpsolved_struct | pyoptinterface._src.xpress_model_ext.optnode_struct | pyoptinterface._src.xpress_model_ext.preintsol_struct | pyoptinterface._src.xpress_model_ext.prenode_struct | pyoptinterface._src.xpress_model_ext.usersolnotify_struct¶
- cb_get_incumbent(self, variable: pyoptinterface._src.core_ext.VariableIndex) float¶
- cb_get_relaxation(self, variable: pyoptinterface._src.core_ext.VariableIndex) float¶
- cb_get_solution(self, variable: pyoptinterface._src.core_ext.VariableIndex) float¶
- cb_set_solution(self, variable: pyoptinterface._src.core_ext.VariableIndex, value: float) None¶
- cb_submit_solution(self) None¶
- close(self) None¶
- computeIIS(self) None¶
- delete_constraint(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) None¶
- delete_variable(self, variable: pyoptinterface._src.core_ext.VariableIndex) None¶
- delete_variables(self, variables: collections.abc.Sequence[pyoptinterface._src.core_ext.VariableIndex]) None¶
- get_constraint_attribute(constraint, attribute: ConstraintAttribute)¶
- get_constraint_dual(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) float¶
- get_constraint_dual_ray(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) float¶
- get_constraint_name(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) str¶
- get_constraint_rhs(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) float¶
- get_constraint_sense(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) pyoptinterface._src.core_ext.ConstraintSense¶
- get_constraint_slack(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) float¶
- get_iis_sol_status(self) pyoptinterface._src.xpress_model_ext.XPRS.IISSOLSTATUS¶
- get_infinity = <nanobind.nb_func object>¶
- get_lp_status(self) pyoptinterface._src.xpress_model_ext.XPRS.LPSTATUS¶
- get_mip_status(self) pyoptinterface._src.xpress_model_ext.XPRS.MIPSTATUS¶
- get_model_attribute(attribute: ModelAttribute)¶
- get_nlp_status(self) pyoptinterface._src.xpress_model_ext.XPRS.NLPSTATUS¶
- get_normalized_coefficient(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex, variable: pyoptinterface._src.core_ext.VariableIndex) float¶
- get_normalized_rhs(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) float¶
- get_objective_coefficient(self, variable: pyoptinterface._src.core_ext.VariableIndex) float¶
- get_optimize_type(self) pyoptinterface._src.xpress_model_ext.XPRS.OPTIMIZETYPE¶
- get_problem_name(self) str¶
- get_raw_attribute(self, attrib: str) int | int | float | str¶
- get_raw_attribute_dbl(self, attrib: str) float¶
- get_raw_attribute_dbl_by_id(self, attrib: int) float¶
- get_raw_attribute_int(self, attrib: str) int¶
- get_raw_attribute_int_by_id(self, attrib: int) int¶
- get_raw_attribute_str(self, attrib: str) str¶
- get_raw_attribute_str_by_id(self, attrib: int) str¶
- get_raw_control(self, control: str) int | int | float | str¶
- get_raw_control_dbl(self, control: str) float¶
- get_raw_control_dbl_by_id(self, control: int) float¶
- get_raw_control_int(self, control: str) int¶
- get_raw_control_int_by_id(self, control: int) int¶
- get_raw_control_str(self, control: str) str¶
- get_raw_control_str_by_id(self, control: int) str¶
- get_raw_model(self) types.CapsuleType¶
- get_sol_status(self) pyoptinterface._src.xpress_model_ext.XPRS.SOLSTATUS¶
- get_solve_status(self) pyoptinterface._src.xpress_model_ext.XPRS.SOLVESTATUS¶
- 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_lowerbound(self, variable: pyoptinterface._src.core_ext.VariableIndex) float¶
- get_variable_lowerbound_IIS(self, variable: pyoptinterface._src.core_ext.VariableIndex) bool¶
- get_variable_name(self, variable: pyoptinterface._src.core_ext.VariableIndex) str¶
- get_variable_primal_ray(self, variable: pyoptinterface._src.core_ext.VariableIndex) float¶
- get_variable_rc(self, variable: pyoptinterface._src.core_ext.VariableIndex) float¶
- get_variable_type(self, variable: pyoptinterface._src.core_ext.VariableIndex) pyoptinterface._src.core_ext.VariableDomain¶
- get_variable_upperbound(self, variable: pyoptinterface._src.core_ext.VariableIndex) float¶
- get_variable_upperbound_IIS(self, variable: pyoptinterface._src.core_ext.VariableIndex) bool¶
- get_variable_value(self, variable: pyoptinterface._src.core_ext.VariableIndex) float¶
- init(self, env: pyoptinterface._src.xpress_model_ext.Env) None¶
- is_constraint_active(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) bool¶
- is_constraint_basic(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) bool¶
- is_constraint_in_IIS(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) bool¶
- is_constraint_nonbasic_lb(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) bool¶
- is_constraint_nonbasic_ub(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) bool¶
- is_constraint_superbasic(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex) bool¶
- is_variable_active(self, variable: pyoptinterface._src.core_ext.VariableIndex) bool¶
- is_variable_basic(self, variable: pyoptinterface._src.core_ext.VariableIndex) bool¶
- is_variable_nonbasic_lb(self, variable: pyoptinterface._src.core_ext.VariableIndex) bool¶
- is_variable_nonbasic_ub(self, variable: pyoptinterface._src.core_ext.VariableIndex) bool¶
- is_variable_superbasic(self, variable: pyoptinterface._src.core_ext.VariableIndex) bool¶
- number_of_constraints(type: ConstraintType)¶
- number_of_variables()¶
- optimize(self) None¶
- pprint(self, variable: 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
- set_callback(self, callback: collections.abc.Callable[[pyoptinterface._src.xpress_model_ext.RawModel, pyoptinterface._src.xpress_model_ext.XPRS.CB_CONTEXT], None], cbctx: int) None¶
- set_constraint_attribute(constraint, attribute: ConstraintAttribute, value)¶
- set_constraint_name(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex, name: str) None¶
- set_constraint_rhs(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex, rhs: float) None¶
- set_constraint_sense(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex, sense: pyoptinterface._src.core_ext.ConstraintSense) None¶
- set_model_attribute(attribute: ModelAttribute, value)¶
- set_normalized_coefficient(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex, variable: pyoptinterface._src.core_ext.VariableIndex, value: float) None¶
- set_normalized_rhs(self, constraint: pyoptinterface._src.core_ext.ConstraintIndex, value: float) None¶
- set_objective(self, function: pyoptinterface._src.core_ext.ScalarAffineFunction, sense: pyoptinterface._src.core_ext.ObjectiveSense = ObjectiveSense.Minimize) None¶
- set_objective(self, function: pyoptinterface._src.core_ext.ScalarQuadraticFunction, sense: pyoptinterface._src.core_ext.ObjectiveSense = ObjectiveSense.Minimize) None
- set_objective(self, function: 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, variable: pyoptinterface._src.core_ext.VariableIndex, value: float) None¶
- set_problem_name(self, probname: str) None¶
- set_raw_control(self, control: str, value: int | int | float | str) None¶
- set_raw_control_dbl(self, control: str, value: float) None¶
- set_raw_control_dbl_by_id(self, control: int, value: float) None¶
- set_raw_control_int(self, control: str, value: int) None¶
- set_raw_control_int_by_id(self, control: int, value: int) None¶
- set_raw_control_str(self, control: str, value: str) None¶
- set_raw_control_str_by_id(self, control: int, value: 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_lowerbound(self, variable: pyoptinterface._src.core_ext.VariableIndex, lb: float) None¶
- set_variable_name(self, variable: pyoptinterface._src.core_ext.VariableIndex, name: str) None¶
- set_variable_type(self, variable: pyoptinterface._src.core_ext.VariableIndex, vtype: pyoptinterface._src.core_ext.VariableDomain) None¶
- set_variable_upperbound(self, variable: pyoptinterface._src.core_ext.VariableIndex, ub: 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, filename: str) None¶
- pyoptinterface.xpress.autoload_library()¶