
    bi                     *    d Z ddlmZ  G d de      Zy)a,  
Copyright, the CVXPY authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
    )
Constraintc                   B     e Zd ZdZdd fdZd Zedefd       Z xZ	S )Conea  A base class for all conic constraints in CVXPY

    These are special constraints imposing set membership in convex cones
    CVXPY supports modelling using the following cones as of today:
    - ExpCone
    - SOC (Second Order Cone)
    - PowCone3D
    - PowConeND
    - RelEntrConeQuad
    - OpRelEntrConeQuad
    - PSD/NSD

    Parameters
    ----------
    args : list
        A list of expression trees.
    constr_id : int
        A unique id for the constraint.
    returnc                 .    t         t        |   ||       y N)superr   __init__)selfargs	constr_id	__class__s      R/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/cvxpy/constraints/cones.pyr
   zCone.__init__)   s    dD"43    c                     t         )a8  Method for modelling problems with the dual cone of `Cone`

        If the user simply calls the method without any arguments, then
        the dual cone to the current instance of `Cone` will be returned, else,
        the user can also choose to freely model with the dual cone of `Cone`
        by constraining aribitrary expressions in the same.

        Will typically not be used stand-alone, and would be
        indirectly accessed via `dual_residual` which will return
        the violation of CVXPY's computed dual variables w.r.t. `Cone`'s
        dual-cone)NotImplementedError)r   r   s     r   
_dual_conezCone._dual_cone,   s
     "!r   c                 H     | j                   | j                   j                  S )zComputes the residual (see Constraint.violation for a
        more formal definition) for the dual cone of the current instance
        of `Cone` w.r.t. the recovered dual variables

        Primarily intended to be used for KKT checks
        )r   dual_variablesresidual)r   s    r   dual_residualzCone.dual_residual:   s!     t 3 34===r   r   )r   N)
__name__
__module____qualname____doc__r
   r   propertyfloatr   __classcell__)r   s   @r   r   r      s-    (4" >u > >r   r   N)r   cvxpy.constraints.constraintr   r    r   r   <module>r!      s     4.>: .>r   