pyoptinterface.highs package

class pyoptinterface.highs.Model

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_variable(self, domain: pyoptinterface._src.core_ext.VariableDomain = VariableDomain.Continuous, lb: float = -inf, ub: float = inf, 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)
close(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_dual(self, arg: pyoptinterface._src.core_ext.ConstraintIndex, /) float
get_constraint_name(self, arg: pyoptinterface._src.core_ext.ConstraintIndex, /) str
get_constraint_primal(self, arg: pyoptinterface._src.core_ext.ConstraintIndex, /) float
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_obj_sense(self) pyoptinterface._src.core_ext.ObjectiveSense
get_obj_value(self) float
get_objective_coefficient(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) float
get_raw_info_double(self, arg: str, /) float
get_raw_info_int(self, arg: str, /) int
get_raw_info_int64(self, arg: str, /) int
get_raw_information(param_name: str)
get_raw_model(self) types.CapsuleType
get_raw_option_bool(self, arg: str, /) bool
get_raw_option_double(self, arg: str, /) float
get_raw_option_int(self, arg: str, /) int
get_raw_option_string(self, arg: str, /) str
get_raw_parameter(param_name: 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_dual(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) float
get_variable_lower_bound(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) 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
get_variable_upper_bound(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) float
getnumcol(self) int
getnumrow(self) int
getruntime(self) float
init(self) None
is_constraint_active(self, arg: pyoptinterface._src.core_ext.ConstraintIndex, /) bool
is_variable_active(self, arg: pyoptinterface._src.core_ext.VariableIndex, /) bool
property m_n_constraints

(self) -> int

property m_n_variables

(self) -> int

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_info_type(self, arg: str, /) int
raw_option_type(self, arg: str, /) int
set_constraint_attribute(constraint, attribute: ConstraintAttribute, value)
set_constraint_name(self, arg0: pyoptinterface._src.core_ext.ConstraintIndex, arg1: str, /) 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_primal_start(self, arg0: collections.abc.Sequence[pyoptinterface._src.core_ext.VariableIndex], arg1: collections.abc.Sequence[float], /) None
set_raw_option_bool(self, arg0: str, arg1: bool, /) None
set_raw_option_double(self, arg0: str, arg1: float, /) None
set_raw_option_int(self, arg0: str, arg1: int, /) None
set_raw_option_string(self, arg0: str, arg1: str, /) None
set_raw_parameter(param_name: str, value)
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
property solution

(self) -> pyoptinterface._src.highs_model_ext.HighsSolution

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, pretty: bool = False) None
pyoptinterface.highs.autoload_library()