pyoptinterface package¶
- class pyoptinterface.ConstraintAttribute(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
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(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- Equal = 2¶
- GreaterEqual = 1¶
- LessEqual = 0¶
- Within = 3¶
- class pyoptinterface.ConstraintType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- Cone = 3¶
- Linear = 0¶
- Quadratic = 1¶
- SOS = 2¶
- pyoptinterface.Eq = ConstraintSense.Equal¶
Alias of ConstraintSense.Equal for equality constraints.
- class pyoptinterface.ExprBuilder(*args, **kwargs)¶
Bases:
object
- add_affine_term¶
- add_quadratic_term¶
- clean_nearzero_terms¶
- clear¶
- degree¶
- empty¶
- reserve_affine¶
- reserve_quadratic¶
- set_affine_coef¶
- set_quadratic_coef¶
- pyoptinterface.Geq = ConstraintSense.GreaterEqual¶
Alias of ConstraintSense.GreaterEqual for greater-than-or-equal-to constraints.
- pyoptinterface.In = ConstraintSense.Within¶
Alias of ConstraintSense.Within for range constraints.
- pyoptinterface.Leq = ConstraintSense.LessEqual¶
Alias of ConstraintSense.LessEqual for less-than-or-equal-to constraints.
- class pyoptinterface.ModelAttribute(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
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.ObjectiveSense(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- Maximize = 1¶
- Minimize = 0¶
- class pyoptinterface.ResultStatusCode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
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.SOSType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- SOS1 = 0¶
- SOS2 = 1¶
- class pyoptinterface.ScalarAffineFunction(*args, **kwargs)¶
Bases:
object
- add_constant¶
- add_term¶
- canonicalize¶
- property coefficients¶
(self) -> list[float]
- property constant¶
(self) -> float | None
- reserve¶
- size¶
- property variables¶
(self) -> list[int]
- class pyoptinterface.ScalarQuadraticFunction(*args, **kwargs)¶
Bases:
object
- add_affine_term¶
- add_constant¶
- add_quadratic_term¶
- property affine_part¶
(self) -> pyoptinterface._src.core_ext.ScalarAffineFunction | None
- canonicalize¶
- property coefficients¶
(self) -> list[float]
- reserve_affine¶
- reserve_quadratic¶
- size¶
- property variable_1s¶
(self) -> list[int]
- property variable_2s¶
(self) -> list[int]
- class pyoptinterface.TerminationStatusCode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
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(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- Domain = 4¶
- IISLowerBound = 7¶
- IISUpperBound = 8¶
- LowerBound = 2¶
- Name = 6¶
- PrimalStart = 5¶
- UpperBound = 3¶
- Value = 1¶
- class pyoptinterface.VariableDomain(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
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()¶
- map(func)¶
- select(*keys, with_key=False)¶