pyoptinterface package

class pyoptinterface.ConstraintAttribute(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Dual = 3
Name = 1
Primal = 2
class pyoptinterface.ConstraintIndex

Bases: object

property index

(self) -> int

property type

(self) -> pyoptinterface._src.core_ext.ConstraintType

class pyoptinterface.ConstraintSense

Bases: object

Equal = pyoptinterface._src.core_ext.ConstraintSense.Equal
GreaterEqual = pyoptinterface._src.core_ext.ConstraintSense.GreaterEqual
LessEqual = pyoptinterface._src.core_ext.ConstraintSense.LessEqual
class pyoptinterface.ConstraintType

Bases: object

Cone = pyoptinterface._src.core_ext.ConstraintType.Cone
Linear = pyoptinterface._src.core_ext.ConstraintType.Linear
Quadratic = pyoptinterface._src.core_ext.ConstraintType.Quadratic
SOS = pyoptinterface._src.core_ext.ConstraintType.SOS
pyoptinterface.Eq = pyoptinterface._src.core_ext.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 = pyoptinterface._src.core_ext.ConstraintSense.GreaterEqual

Alias of ConstraintSense.GreaterEqual for greater-than-or-equal-to constraints.

pyoptinterface.Leq = pyoptinterface._src.core_ext.ConstraintSense.LessEqual

Alias of ConstraintSense.LessEqual for less-than-or-equal-to constraints.

class pyoptinterface.ModelAttribute(value, names=None, *, 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

Bases: object

Maximize = pyoptinterface._src.core_ext.ObjectiveSense.Maximize
Minimize = pyoptinterface._src.core_ext.ObjectiveSense.Minimize
class pyoptinterface.ResultStatusCode(value, names=None, *, 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

Bases: object

SOS1 = pyoptinterface._src.core_ext.SOSType.SOS1
SOS2 = pyoptinterface._src.core_ext.SOSType.SOS2
class pyoptinterface.ScalarAffineFunction(*args, **kwargs)

Bases: object

add_constant
add_term
canonicalize
property coefficients

(self) -> list[float]

property constant

(self) -> Optional[float]

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) -> Optional[pyoptinterface._src.core_ext.ScalarAffineFunction]

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=None, *, 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=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Domain = 4
LowerBound = 2
Name = 6
PrimalStart = 5
UpperBound = 3
Value = 1
class pyoptinterface.VariableDomain

Bases: object

Binary = pyoptinterface._src.core_ext.VariableDomain.Binary
Continuous = pyoptinterface._src.core_ext.VariableDomain.Continuous
Integer = pyoptinterface._src.core_ext.VariableDomain.Integer
SemiContinuous = pyoptinterface._src.core_ext.VariableDomain.SemiContinuous
class pyoptinterface.VariableIndex(*args, **kwargs)

Bases: object

property index

(self) -> int

pyoptinterface.make_nd_variable(model, *coords: Collection, domain=None, lb=None, ub=None, name=None)
pyoptinterface.make_tupledict(*coords: Iterable, rule)
pyoptinterface.quicksum(terms, f=None)
class pyoptinterface.tupledict(*args, **kwargs)

Bases: dict

clean()
select(*keys, with_key=False)

Submodules