{ } Raw JSON

bundles / scipy 1.17.1 / scipy / optimize / _constraints / PreparedConstraint

class

scipy.optimize._constraints:PreparedConstraint

source: /scipy/optimize/_constraints.py :314

Signature

class   PreparedConstraint ( constraint x0 sparse_jacobian = None finite_diff_bounds = (-inf, inf) )

Members

Summary

Constraint prepared from a user defined constraint.

Extended Summary

On creation it will check whether a constraint definition is valid and the initial point is feasible. If created successfully, it will contain the attributes listed below.

Parameters

constraint : {NonlinearConstraint, LinearConstraint`, Bounds}

Constraint to check and prepare.

x0 : array_like

Initial vector of independent variables.

sparse_jacobian : bool or None, optional

If bool, then the Jacobian of the constraint will be converted to the corresponded format if necessary. If None (default), such conversion is not made.

finite_diff_bounds : 2-tuple, optional

Lower and upper bounds on the independent variables for the finite difference approximation, if applicable. Defaults to no bounds.

Attributes

fun : {VectorFunction, LinearVectorFunction, IdentityVectorFunction}

Function defining the constraint wrapped by one of the convenience classes.

bounds : 2-tuple

Contains lower and upper bounds for the constraints --- lb and ub. These are converted to ndarray and have a size equal to the number of the constraints.

keep_feasible : ndarray

Array indicating which components must be kept feasible with a size equal to the number of the constraints.

Aliases

  • scipy.optimize._constraints.PreparedConstraint