
    bih                        d Z ddlmZ ddlmZmZmZ erddlmZm	Z	m
Z
 ddlmZ ddlZddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  dd	lm!Z!m"Z"m#Z# dd
l$m%Z%  G d de jL                        Z'y)a,  
Copyright 2013 Steven Diamond

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

    http://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.
    )annotations)TYPE_CHECKINGIterableOptional)Constant	ParameterVariable)AtomN)
Constraint)
expression)GENERAL_PROJECTION_TOLPSD_NSD_PROJECTION_TOLSPARSE_PROJECTION_TOL)
get_coordsc                     e Zd ZdZ	 	 	 	 	 	 	 d-	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d.dZd/dZd0dZd1dZd2dZe	d3d       Z
d4d	Zd5d
Zd6dZd7dZd7dZd7dZd7dZd7dZd7dZd7dZd7dZd7dZd7dZd7dZd7dZd7dZd7dZd8dZe	d9d       Zd:dZd:d2dZe	d;d       Z e jB                  d2d       Z e	d<d        Z"e"jB                  d2d!       Z"d2d"Z#d:d#Z$d7d$Z%d7d%Z&d7d&Z'd7d'Z(d7d(Z)d7d)Z*d=d>d*Z+d?d+Z,d@d,Z-y)ALeafa  
    A leaf node of an expression tree; i.e., a Variable, Constant, or Parameter.

    A leaf may carry *attributes* that constrain the set values permissible
    for it. Leafs can have no more than one attribute, with the exception
    that a leaf may be both ``nonpos`` and ``nonneg`` or both ``boolean``
    in some indices and ``integer`` in others.

    An error is raised if a leaf is assigned a value that contradicts
    one or more of its attributes. See the ``project`` method for a convenient
    way to project a value onto a leaf's domain.

    Parameters
    ----------
    shape : int or tuple of ints
        Shape of the leaf, e.g., ``(3, 2)`` or ``2``.
    value : numeric type
        A value to assign to the leaf.
    nonneg : bool
        Is the variable constrained to be nonnegative?
    nonpos : bool
        Is the variable constrained to be nonpositive?
    complex : bool
        Is the variable complex valued?
    symmetric : bool
        Is the variable symmetric?
    diag : bool
        Is the variable diagonal?
    PSD : bool
        Is the variable constrained to be positive semidefinite?
    NSD : bool
        Is the variable constrained to be negative semidefinite?
    Hermitian : bool
        Is the variable Hermitian?
    boolean : bool or Iterable
        Is the variable boolean? True, which constrains
        the entire Variable to be boolean, False, or a list of
        indices which should be constrained as boolean, where each
        index is a tuple of length exactly equal to the
        length of shape.
    integer : bool or Iterable
        Is the variable integer? The semantics are the same as the
        boolean argument.
    sparsity : Iterable
        Is the variable sparse?
    pos : bool
        Is the variable positive?
    neg : bool
        Is the variable negative?
    bounds : Iterable
        An iterable of length two specifying lower and upper bounds.
    Nc                (    t        |t        j                        rt        |      f}n)t        j
                  st        |      dkD  rt        d      |D ]0  }t        |t        j                        r|dk  s#t        d|d       t        |      }| _	        |	s|
s|s|s|r(t        |      dk7  s|d   |d   k7  rt        d|d      |||||||||	|
|||||d _
        |d	u rRt        |d
      }t        j                  t        j                  |            }t        j                  ||d       _        n|du rg  _        n| _        |d	u rRt        |d
      }t        j                  t        j                  |            }t        j                  ||d       _        n|du rg  _        n| _        |rW j%                  |       _        t         j&                  d         t        j                   j(                        z  dk   _        nd  _        t-        d  j                  j/                         D               _        g d}t-         fd|D              dkD  rt        d|       g  _         j5                  |       _        || _        y y )N   z:Expressions of dimension greater than 2 are not supported.r   Invalid dimensions .   z. Must be a square matrix.)nonnegnonposposnegcompleximag	symmetricdiagPSDNSD	hermitianbooleanintegersparsityboundsT)r   F)orderFg      ?c              3  ,   K   | ]  \  }}|s	d   ywr   N ).0kvs      Q/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/cvxpy/expressions/leaf.py	<genexpr>z Leaf.__init__.<locals>.<genexpr>   s     !M11!!Ms   
)r   r   r    r!   r"   r%   c              3  B   K   | ]  }j                   |   sd   ywr*   
attributes)r,   r-   selfs     r/   r0   z Leaf.__init__.<locals>.<genexpr>   s     BQtq/AqBs   zHA CVXPY Variable cannot have more than one of the following attributes: )
isinstancenumbersIntegralintsALLOW_ND_EXPRlen
ValueErrortuple_shaper3   maxnparangeprodunravel_indexboolean_idxinteger_idx_validate_indices
sparse_idxshape_sparse_high_fill_insumitemsnum_attributesargs_ensure_valid_boundsr&   value)r4   rH   rO   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r   r   r&   dflat_idxdim_reducing_attrs   `                    r/   __init__zLeaf.__init__a   su    eW--.ZMESZ!^ 2 3 3 	FAa!1!12a1f U!DEE	F e3)tys5zQBG(eTUhBV %( ) ) &,v"%c&-t(14"%c(1g'.HPVX d?t$Eyy0H!//%sKD!D&Dd?t$Eyy0H!//%sKD!D&D"44X>DO),T__Q-?)@2774::CV)VZ^)^D%"DO!!M0E0E0G!MMXB+BBQFZ$%'  	//7DJ     c                    | j                   dk(  r|g k7  rt        d      g S t        j                  t	        j
                  t        |d               |f| j                         }|j                          t        |      S )z
        Validate the sparsity pattern for a leaf node.

        Parameters:
        indices: List or tuple of indices indicating the positions of non-zero elements.
        r+   z!Indices should have 0 dimensions.r   rH   )	r>   r<   sp	coo_arrayr@   emptyr;   sum_duplicatesr   )r4   indices	validators      r/   rF   zLeaf._validate_indices   sm     ;;""} !DEEI LL"((3wqz?";W!ET[[Y	 	  ")$$rT   c           	        d}| j                   j                         D ]  \  }}|dus|t        |t              r|d|d|z  }*|dk(  r|t	        j
                  |d   t        j                  t        j                  dd i	      }t	        j
                  |d
   t        j                  t        j                  dd i	      }|d|d|d|dz  }|dv st        |t              s|d|d|z  } |S )z)Get a string representing the attributes. Fz, =r&   r   floatc                
    | dS Nz.2fr+   xs    r/   <lambda>z$Leaf._get_attr_str.<locals>.<lambda>   
    QsG rT   )	edgeitems	threshold	formatterr   c                
    | dS rb   r+   rc   s    r/   re   z$Leaf._get_attr_str.<locals>.<lambda>   rf   rT   z=())r%   r#   r$   )
r3   rK   r5   boolr@   array2stringr9   PRINT_EDGEITEMSPRINT_THRESHOLDr   )r4   attr_strattrvalloweruppers         r/   _get_attr_strzLeaf._get_attr_str   s    ..0 	8ID#%COc4(T3 77HX%#/OOCF./.?.?./.?.?/68L.MOE OOCF./.?.?./.?.?/68L.MOE 4 FFH??JsT\D]T3 77H	8  rT   c                H    |i n|}t        |       |v r|t        |          S | S )aG  Returns a shallow copy of the object.

        Used to reconstruct an object tree.

        Parameters
        ----------
        args : list, optional
            The arguments to reconstruct the object. If args=None, use the
            current args of the object.

        Returns
        -------
        Expression
        )id)r4   rM   
id_objectss      r/   copyz	Leaf.copy   s0     &-R:
d8z!bh''rT   c                     y)zLeaves are not copied.Nr+   r4   s    r/   get_datazLeaf.get_data   s    rT   c                    | j                   S )z!The dimensions of the expression.)r>   r{   s    r/   rH   z
Leaf.shape   s     {{rT   c                    g S )z#Default is empty list of Variables.r+   r{   s    r/   	variableszLeaf.variables       	rT   c                    g S )z$Default is empty list of Parameters.r+   r{   s    r/   
parameterszLeaf.parameters   r   rT   c                    g S )z#Default is empty list of Constants.r+   r{   s    r/   	constantszLeaf.constants   r   rT   c                     y)zIs the expression convex?Tr+   r{   s    r/   	is_convexzLeaf.is_convex       rT   c                     y)zIs the expression concave?Tr+   r{   s    r/   
is_concavezLeaf.is_concave   r   rT   c                "    | j                         S )z!Is the expression log-log convex?is_posr{   s    r/   is_log_log_convexzLeaf.is_log_log_convex       {{}rT   c                "    | j                         S )z"Is the expression log-log concave?r   r{   s    r/   is_log_log_concavezLeaf.is_log_log_concave  r   rT   c                d    | j                   d   xs  | j                   d   xs | j                   d   S )zIs the expression nonnegative?r   r   r#   r2   r{   s    r/   	is_nonnegzLeaf.is_nonneg  s4    ) +T__U-C +	*	,rT   c                B    | j                   d   xs | j                   d   S )zIs the expression nonpositive?r   r   r2   r{   s    r/   	is_nonposzLeaf.is_nonpos
  s    x(BDOOE,BBrT   c                     | j                   d   S )zIs the expression positive?r   r2   r{   s    r/   r   zLeaf.is_pos      u%%rT   c                     | j                   d   S )zIs the expression negative?r   r2   r{   s    r/   is_negzLeaf.is_neg  r   rT   c                    | j                         xr | j                         xs3 | j                  d   xs" | j                         xs | j	                         S )zIs the Leaf hermitian?r"   )is_realis_symmetricr3   is_psdis_nsdr{   s    r/   is_hermitianzLeaf.is_hermitian  sO    64#4#4#6 KOOK(K,0KKMK=A[[]	KrT   c                P      j                         xs t         fddD              S )zIs the Leaf symmetric?c              3  <   K   | ]  }j                   |     y wNr2   )r,   keyr4   s     r/   r0   z$Leaf.is_symmetric.<locals>.<genexpr>  s     T$Ts   )r   r   r    r!   )	is_scalaranyr{   s   `r/   r   zLeaf.is_symmetric  s(    ~~ UT0STT	UrT   c                     | j                   d   S )zIs the Leaf imaginary?r   r2   r{   s    r/   is_imagzLeaf.is_imag       v&&rT   c                f    | j                   d   xs! | j                         xs | j                   d   S )zIs the Leaf complex valued?r   r"   )r3   r   r{   s    r/   
is_complexzLeaf.is_complex$  s*    y)[T\\^[t{?[[rT   c                   | j                         ry| j                  d   b| j                  d   d   }t        j                  |      r|t        j                   k7  S t        j
                  |t        j                   k7        S y)z$Does the variable have lower bounds?Tr&   r   F)r   r3   r@   isscalarinfr   )r4   lower_bounds     r/   _has_lower_boundszLeaf._has_lower_bounds(  sk    >>__X&2//(3A6K{{;'"rvvg--vvkbffW455rT   c                   | j                         ry| j                  d   `| j                  d   d   }t        j                  |      r|t        j                  k7  S t        j
                  |t        j                  k7        S y)z$Does the variable have upper bounds?Tr&   r   F)r   r3   r@   r   r   r   )r4   upper_bounds     r/   _has_upper_boundszLeaf._has_upper_bounds5  sg    >>__X&2//(3A6K{{;'"bff,,vvkRVV344rT   c                   | j                   d   s| j                   d   r|j                  |dk\         | j                   d   s| j                   d   r|j                  |dk         | j                   d   r| j                  }|\  }}|t        j                   k7  }|t        j                  k7  }t        j
                  |      r>| j                  dkD  r|j                  ||   ||   k\         n|j                  ||k\         t        j
                  |      r?| j                  dkD  r|j                  ||   ||   k         y|j                  ||k         yyy)zA utility function to append constraints from lower and upper bounds.

        Parameters
        ----------
        term: The term to encode in the constraints.
        constraints: An existing list of constraitns to append to.
        r   r   r   r   r   r&   N)r3   appendr&   r@   r   r   ndim)r4   termconstraintsr&   lower_boundsupper_boundslower_bound_maskupper_bound_masks           r/   _bound_domainzLeaf._bound_domainB  s7    ??8$(>tqy)??8$(>tqy)??8$[[F)/&L, , 7 , 6vv&' 99q=&&t,<'=N^A_'_`&&t|';<vv&' 99q=&&t,<'=N^A_'_`&&t|';< ( %rT   c                    g }| j                  | |       | j                  d   r|j                  | dz	         |S | j                  d   r|j                  | dz         |S )znA list of constraints describing the closure of the region
           where the expression is finite.
        r    r   r!   )r   r3   r   )r4   domains     r/   r   zLeaf.domaind  s_     4(??5!MM$!)$  __U#MM$!)$rT   c                j	   | j                         st        j                  |      }| j                  dkD  r|S | j                  d   r| j                  d   rd|z  S | j                  d   s| j                  d   rt        j
                  |d      S | j                  d   s| j                  d   rt        j                  |d      S | j                  d   r1t        j                  || j                  d   | j                  d         S | j                  d	   rt        j                  |      d
z  S | j                  d   r|j                  t              S | j                  d   rt        | d      rt        j                  |j                  t        j                  d            }t        j                  t        j                  || j                      dd            || j                   <   |j"                  dk(  r|j%                  |j&                        S |S y| j                  d   rt        | d      rt        j                  |j                  t        j                  d            }t        j                  || j(                           || j(                  <   |j"                  dk(  r|j%                  |j&                        S |S y| j                  d   rTt+        j,                  |      r|j/                         }nt        j0                  |      }t3        j4                  |gdg      S | j                  d   r%|t        j6                  |      j8                  z   dz  S t;        dD cg c]  }| j                  |    c}      r|j<                  j>                  dv r|j                  t@              }||j8                  z   }|dz  }| j                  d   r|S tC        jD                  |      \  }}| j                  d   r|dk  }|j;                         s|S d||<   n|dkD  }|j;                         s|S d||<   ||z  jG                  |j8                        S | j                  d   rZ|sXtI        jJ                  dtL        d       t        jN                  | j&                        }|| jP                     || jP                  <   |S |S c c}w )aH  Project value onto the attribute set of the leaf.

        A sensible idiom is ``leaf.value = leaf.project(val)``.

        Parameters
        ----------
        val : numeric type
            The value assigned.

        Returns
        -------
        numeric type
            The value rounded to the attribute type.
        r   r   r   r   r   g        r   r&   r   y              ?r   r#   rD   T)ry   g      ?r$   rE   r   )offsetsr"   g       @)r   r    r!   ibr   r    r%   z{Accessing a sparse CVXPY expression via a dense representation. Please report this as a bug to the CVXPY Discord or GitHub.   N))r   r@   realrL   r3   minimummaximumclipr&   r   astyper   hasattr
atleast_1dfloat64roundrD   r   reshaperH   rE   intf	is_sparsediagonalr   rW   diags_arrayconjTr   dtypekindr`   LAeighdotwarningswarnRuntimeWarningzerosrG   )r4   rr   sparse_pathnew_valr   wVbads           r/   projectzLeaf.projectt  s     ''#,C"J??8$)BS5L__X&$//%*@::c2&&__X&$//%*@::c2&&__X&773AA??__V$773<?"__Y'::g&&__Y't]+--

2::D
(IJ,.HHRWWWTEUEU=VXZ\^5_,`(()58XX]wsyy1OO , __Y't]+--

2::D
(IJ,.HHWT=M=M5N,O(()58XX]wsyy1OO , __V$~~c"llnggcl>>3%!55__[)"''#,..(",,46 //#& 6 7yy~~%jj'+C2IC{+
773<DAqu%!ewwyJ#!ewwyJ#E;;qss##__Z(MM Y(!- hhtzz*G'*4??';GDOO$NJ96s   R0c                   |d | _         y | j                  B|s@t        j                  || j                     | j                  f| j                        | _         y | j                  |r|j
                  | _         y || _         y )NrV   )_valuerG   rW   rX   rH   data)r4   rr   r   s      r/   
save_valuezLeaf.save_value  sc    ;DK__(,,DOO(<doo'NVZV`V`aDK__([((DKDKrT   c                6   | j                   | j                  S t        j                  dt        d       | j                  yt        j                  | j                  | j                  j                        }| j                  j                  || j                   <   |S )z$The numeric value of the expression.Nz_Reading from a sparse CVXPY expression via `.value` is discouraged. Use `.value_sparse` insteadr   )r   )
rG   r   r   r   r   r@   r   rH   r   r   r4   rr   s     r/   rO   z
Leaf.value  sw     ??";;MM 9:H!M{{"((4::T[[->->?C#';;#3#3C JrT   c                    | j                   '| j                  rt        j                  dt        d       | j                  | j                  |             y )Nz]Writing to a sparse CVXPY expression via `.value` is discouraged. Use `.value_sparse` insteadr   )rG   rI   r   r   r   r   _validate_valuer   s     r/   rO   z
Leaf.value  sB    ??&4+D+DMM 9:H!M,,S12rT   c                    | j                   yt        | j                   t        j                        r7t	        j
                  | j                   | j                  f| j                        S | j                   S )z?The numeric value of the expression if it is a sparse variable.NrV   )r   r5   r@   ndarrayrW   rX   rG   rH   r{   s    r/   value_sparsezLeaf.value_sparse  sO     ;;dkk2::.<<doo >djjQQ;;rT   c                   t        |t        j                        rt        j                  |      }n}t        |t        j                        sct        |t        j
                        r1|j                  t        | j                  d         fk(  rt        d      t        dt        |       d      | j                  | j                  |d      d       y )Nr   zvInvalid type for assigning value_sparse.Try using `expr.value_sparse = scipy.sparse.coo_array((values, expr)) instead.z2Invalid type for assigning value_sparse.Recieved: ze Expected scipy.sparse.coo_array. Instantiate with scipy.sparse.coo_array((value_array, coordinates))T)r5   rW   spmatrixrX   r@   r   rH   r;   rG   r<   typer   r   r   s     r/   r   zLeaf.value_sparse  s    c2;;',,s#CC.#

,		c$//!*<&=%?? Z[ [ !#YK (WX 
 	,,S$7>rT   c                D    | j                  | j                  |             y)z4Project and assign a value to the variable.
        N)r   r   r   s     r/   project_and_assignzLeaf.project_and_assign   s     	S)*rT   c                   |t        j                  |      }t        j                  |      | j                  k7  r9t        dt        j                  |      d| j                  j
                  d      |r|j                          t        |      }t        |      t        | j                        k7  s&t        d t        || j                        D              r/t        dt        |      d| j                  j
                  d      | j                  ||      }t        j                  ||z
        }t        j                  |      r't        j                   |j"                  dt$              }nnt        j&                  |      }| j(                  d   s| j(                  d	   rt+        j,                  |d
      t.        k  }nt        j                   |dt0              }|s| j(                  d   rd}n| j(                  d   rd}n| j(                  d   rd}n| j(                  d   rd}n| j(                  d   rd}n| j(                  d   rd}n| j(                  d   rd}nm| j(                  d	   rd}n[| j(                  d   rd}nI| j(                  d   rd}n7| j(                  j3                         D 	cg c]
  \  }}	|	s	| c}	}dgz   d   }t        | j                  j
                  d|d       |S c c}	}w )!a  Check that the value satisfies the leaf's symbolic attributes.

        Parameters
        ----------
        val : numeric type
            The value assigned.

        Returns
        -------
        numeric type
            The value converted to the proper matrix type.
        r   z for z value.c              3  H   K   | ]  \  }}||k7  j                           y wr   )r   )r,   abs      r/   r0   z'Leaf._validate_value.<locals>.<genexpr>  s     UDAq!q&Us    "zInvalid sparsity pattern r   )atolr    r!   r   )ordr   nonnegativer   positiver   nonpositiver   negativer%   z zero outside of sparsity patternr   r   zpositive semidefiniteznegative semidefiniter   	imaginaryr&   z	in boundsr   z value must be r   )r   convertrH   r<   	__class____name__rZ   r   r;   rG   r   zipr   r@   absr   allcloser   r   arrayr3   r   normr   r   rK   )
r4   rr   r   
coords_val
projectiondeltaclose_enoughrp   r-   r.   s
             r/   r   zLeaf._validate_value  sp    ?,,s#Czz#$**, ZZ_dnn&=&=?  ""$'_
z?c$//&::UC
DOO4TUU$#C$..*A*AC  c;7JFF3+,E~~e$  "{{5::q0E G  ??5)T__U-C#%775a#8<R#RL $&;;ua4J$LL??8,,H__U+)H__X.,H__U+)H__Z0AH__V,)H__U+6H__U+6H__V,*H__X.*H151F1F1H Nv1A NRXQY Y[\]H .2nn.E.ExP  
	 !Os   /
K0:K0c                     | j                   d   S )z1Is the expression a positive semidefinite matrix?r    r2   r{   s    r/   r   zLeaf.is_psdX  r   rT   c                     | j                   d   S )z1Is the expression a negative semidefinite matrix?r!   r2   r{   s    r/   r   zLeaf.is_nsd\  r   rT   c                     | j                   d   S )z$Is the expression a diagonal matrix?r   r2   r{   s    r/   is_diagzLeaf.is_diag`  r   rT   c                     y)z Leaf nodes are always quadratic.Tr+   r{   s    r/   is_quadraticzLeaf.is_quadraticd  r   rT   c                     y)z#Leaf nodes are not quadratic terms.Fr+   r{   s    r/   has_quadratic_termzLeaf.has_quadratic_termh  s    rT   c                     y)z'Leaf nodes are always piecewise linear.Tr+   r{   s    r/   is_pwlzLeaf.is_pwll  r   rT   c                     y)zbThe expression is a disciplined parameterized expression.

           context: dcp or dgp
        Tr+   )r4   contexts     r/   is_dppzLeaf.is_dppp  s    
 rT   c                    g S r   r+   r{   s    r/   atomsz
Leaf.atomsw  s    	rT   c                4   |y t        |t              rt        |      dk7  rt        d      |D ]]  }t        |t        j
                        xr |j                  | j                  k(  }|;t	        j                  |      rQ|rTt        d       t        j                   t        j                  g}t        |      D ]g  \  }}|'t	        j                  | j                  ||         ||<   /t	        j                  |      sEt	        j                  | j                  |      ||<   i t	        j                  |d   t        j                   k(        rt        d      t	        j                  |d   t        j                  k(        rt        d      t	        j                  |d   |d   kD        rt        d      t	        j                  t	        j                  |d               s+t	        j                  t	        j                  |d               rt        d	      |S )
Nr   z%Bounds should be a list of two items.z]Bounds should be None, scalars, or arrays with the same dimensions as the variable/parameter.r   z*-np.inf is not feasible as an upper bound.r   z(np.inf is not feasible as a lower bound.zKInvalid bounds: some upper bounds are less than corresponding lower bounds.z/np.nan is not feasible as lower or upper bound.)r5   r   r;   r<   r@   r   rH   r   r   	enumeratefullr   isnan)r4   rO   rr   valid_arraynone_boundsidxs         r/   rN   zLeaf._ensure_valid_boundsz  s   = %*c%jAoDEE  	C$S"**5Q#))tzz:QKK2;;s#3{ A 	 w'!%( 	6HC{WWTZZS1ABc
S!WWTZZ5c
		6 66%(rvvg%&IJJ66%(bff$%GHH 66%(U1X%& @ A A 66"((58$%q0B)C 2 3 3 rT   )NFFFFFFFFFFFFFFN)"rH   zint | tuple[int, ...]r   rl   r   rl   r   rl   r   rl   r   rl   r   rl   r    rl   r!   rl   r"   rl   r#   Iterable | boolr$   r  r%   r  r   rl   r   rl   r&   Iterable | NonereturnNone)r[   z$list[tuple[int]] | tuple[np.ndarray]r   ztuple[np.ndarray])r   str)NN)r   r!  )r   ztuple[int, ...])r   zlist[Variable])r   zlist[Parameter])r   zlist[Constant])r   rl   )r   zexpression.Expressionr   list[Constraint]r   r!  )r   r#  )F)r   zOptional[np.ndarray])r   zOptional[...])dcp)r  r"  r   rl   )r   z
list[Atom])r   r  ).r   
__module____qualname____doc__rS   rF   ru   ry   r|   propertyrH   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rO   setterr   r   r   r   r   r  r  r  r  r  r  rN   r+   rT   r/   r   r   +   s   3l JOBGAF-2EJJO"&A*ABFAA'+A;?A A (,A ;?A 	A '+	A
 !A
 4CA "A 15A DHA  A 
AF%(*(%  ,
C&&K
U
'\ =D  Nb   \\3 3   ? ?"+
Qf&&'*rT   r   )(r'  
__future__r   typingr   r   r   cvxpyr   r   r	   cvxpy.atoms.atomr
   r6   r   numpyr@   numpy.linalglinalgr   scipy.sparsesparserW   cvxpy.interface	interfacer   cvxpy.settingssettingsr9   cvxpy.constraints.constraintr   cvxpy.expressionsr   r   r   r    cvxpy.utilities.coo_array_compatr   
Expressionr   r+   rT   r/   <module>r;     s_    # 4 433%        3 ( 
 8y	:   y	rT   