pyoptinterface package¶
- class pyoptinterface.ConstraintAttribute(*values)¶
Bases:
Enum- Dual = 3¶
- IIS = 4¶
- Name = 1¶
- Primal = 2¶
- class pyoptinterface.ConstraintIndex(*args, **kwargs)¶
Bases:
object- property index¶
(self) -> int
- property type¶
(self) -> pyoptinterface._src.core_ext.ConstraintType
- class pyoptinterface.ConstraintSense(*values)¶
Bases:
Enum- Equal = 2¶
- GreaterEqual = 1¶
- LessEqual = 0¶
- class pyoptinterface.ConstraintType(*values)¶
Bases:
Enum- ExponentialCone = 4¶
- Linear = 0¶
- Quadratic = 1¶
- SOS = 2¶
- SecondOrderCone = 3¶
- pyoptinterface.Eq = ConstraintSense.Equal¶
Alias of ConstraintSense.Equal for equality constraints.
- class pyoptinterface.ExprBuilder(*args, **kwargs)¶
Bases:
object- add_affine_term(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: float, /) None¶
- add_quadratic_term(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: pyoptinterface._src.core_ext.VariableIndex, arg2: float, /) None¶
- clean_nearzero_terms(self, threshold: float = 1e-12) None¶
- clear(self) None¶
- degree(self) int¶
- empty(self) bool¶
- reserve_affine(self, arg: int, /) None¶
- reserve_quadratic(self, arg: int, /) None¶
- set_affine_coef(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: float, /) None¶
- set_quadratic_coef(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: pyoptinterface._src.core_ext.VariableIndex, arg2: float, /) None¶
- pyoptinterface.Geq = ConstraintSense.GreaterEqual¶
Alias of ConstraintSense.GreaterEqual for greater-than-or-equal-to constraints.
- pyoptinterface.Leq = ConstraintSense.LessEqual¶
Alias of ConstraintSense.LessEqual for less-than-or-equal-to constraints.
- class pyoptinterface.ModelAttribute(*values)¶
Bases:
Enum- BarrierIterations = 7¶
- DualObjectiveValue = 8¶
- DualStatus = 3¶
- Name = 1¶
- NodeCount = 9¶
- NumberOfThreads = 10¶
- ObjectiveBound = 11¶
- ObjectiveSense = 2¶
- ObjectiveValue = 12¶
- PrimalStatus = 4¶
- RawStatusString = 5¶
- RelativeGap = 13¶
- Silent = 14¶
- SimplexIterations = 15¶
- SolveTimeSec = 18¶
- SolverName = 16¶
- SolverVersion = 17¶
- TerminationStatus = 6¶
- TimeLimitSec = 19¶
- class pyoptinterface.ResultStatusCode(*values)¶
Bases:
Enum- FEASIBLE_POINT = 2¶
- INFEASIBILITY_CERTIFICATE = 5¶
- INFEASIBLE_POINT = 4¶
- NEARLY_FEASIBLE_POINT = 3¶
- NEARLY_INFEASIBILITY_CERTIFICATE = 6¶
- NEARLY_REDUCTION_CERTIFICATE = 8¶
- NO_SOLUTION = 1¶
- OTHER_RESULT_STATUS = 10¶
- REDUCTION_CERTIFICATE = 7¶
- UNKNOWN_RESULT_STATUS = 9¶
- class pyoptinterface.ScalarAffineFunction(*args, **kwargs)¶
Bases:
object- add_constant(self, arg: float, /) None¶
- add_term(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: float, /) None¶
- canonicalize(self, threshold: float = 1e-12) None¶
- property coefficients¶
(self) -> list[float]
- property constant¶
(self) -> float | None
- from_numpy = <nanobind.nb_func object>¶
- reserve(self, arg: int, /) None¶
- size(self) int¶
- property variables¶
(self) -> list[int]
- class pyoptinterface.ScalarQuadraticFunction(*args, **kwargs)¶
Bases:
object- add_affine_term(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: float, /) None¶
- add_constant(self, arg: float, /) None¶
- add_quadratic_term(self, arg0: pyoptinterface._src.core_ext.VariableIndex, arg1: pyoptinterface._src.core_ext.VariableIndex, arg2: float, /) None¶
- property affine_part¶
(self) -> pyoptinterface._src.core_ext.ScalarAffineFunction | None
- canonicalize(self, threshold: float = 1e-12) None¶
- property coefficients¶
(self) -> list[float]
- reserve_affine(self, arg: int, /) None¶
- reserve_quadratic(self, arg: int, /) None¶
- size(self) int¶
- property variable_1s¶
(self) -> list[int]
- property variable_2s¶
(self) -> list[int]
- class pyoptinterface.TerminationStatusCode(*values)¶
Bases:
Enum- ALMOST_DUAL_INFEASIBLE = 10¶
- ALMOST_INFEASIBLE = 9¶
- ALMOST_LOCALLY_SOLVED = 11¶
- ALMOST_OPTIMAL = 8¶
- DUAL_INFEASIBLE = 4¶
- INFEASIBLE = 3¶
- INFEASIBLE_OR_UNBOUNDED = 7¶
- INTERRUPTED = 24¶
- INVALID_MODEL = 22¶
- INVALID_OPTION = 23¶
- ITERATION_LIMIT = 12¶
- LOCALLY_INFEASIBLE = 6¶
- LOCALLY_SOLVED = 5¶
- MEMORY_LIMIT = 16¶
- NODE_LIMIT = 14¶
- NORM_LIMIT = 18¶
- NUMERICAL_ERROR = 21¶
- OBJECTIVE_LIMIT = 17¶
- OPTIMAL = 2¶
- OPTIMIZE_NOT_CALLED = 1¶
- OTHER_ERROR = 25¶
- OTHER_LIMIT = 19¶
- SLOW_PROGRESS = 20¶
- SOLUTION_LIMIT = 15¶
- TIME_LIMIT = 13¶
- class pyoptinterface.VariableAttribute(*values)¶
Bases:
Enum- Domain = 4¶
- IISLowerBound = 7¶
- IISUpperBound = 8¶
- LowerBound = 2¶
- Name = 6¶
- PrimalStart = 5¶
- ReducedCost = 9¶
- UpperBound = 3¶
- Value = 1¶
- class pyoptinterface.VariableDomain(*values)¶
Bases:
IntEnum- Binary = 2¶
- Continuous = 0¶
- Integer = 1¶
- SemiContinuous = 3¶
- pyoptinterface.make_tupledict(*coords: Iterable, rule)¶
- pyoptinterface.quicksum(terms, f=None)¶
- pyoptinterface.quicksum_(expr: ExprBuilder, terms, f=None)¶
- class pyoptinterface.tupledict(*args, **kwargs)¶
Bases:
dict- clean()¶
- clear()¶
Remove all items from the dict.
- map(func)¶
- pop(k[, d]) v, remove specified key and return the corresponding value.¶
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()¶
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- select(*keys, with_key=False)¶
- setdefault(key, default=None)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.¶
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]