scipy 1.8.0 Pypi GitHub Homepage
Other Docs
Parameters

It represents the set of constraints of the form:

f_eq(x) = 0
f_ineq(x) <= 0

where f_eq and f_ineq are evaluated by a single function, see below.

The class is supposed to be instantiated by factory methods, which should prepare the parameters listed below.

Parameters

n_eq, n_ineq : int

Number of equality and inequality constraints respectively.

fun : callable

Function defining the constraints. The signature is fun(x) -> c_eq, c_ineq , where c_eq is ndarray with :None:None:`n_eq` components and c_ineq is ndarray with :None:None:`n_ineq` components.

jac : callable

Function to evaluate the Jacobian of the constraint. The signature is jac(x) -> J_eq, J_ineq , where J_eq and J_ineq are either ndarray of csr_matrix of shapes (n_eq, n) and (n_ineq, n), respectively.

hess : callable

Function to evaluate the Hessian of the constraints multiplied by Lagrange multipliers, that is dot(f_eq, v_eq) + dot(f_ineq, v_ineq) . The signature is hess(x, v_eq, v_ineq) -> H , where H has an implied shape (n, n) and provide a matrix-vector product operation H.dot(p) .

keep_feasible : ndarray, shape (n_ineq,)

Mask indicating which inequality constraints should be kept feasible.

Canonical constraint to use with trust-constr algorithm.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/optimize/_trustregion_constr/canonical_constraint.py#5
type: <class 'type'>
Commit: