
    bi                     h    d dl mZmZmZ erd dlmZ 	 ded   deeef   fdZdddddeeef   fd	Zy
)    )TYPE_CHECKINGListTuple)
Expressionexprsr   returnc                 R    t        d | D              }t        d | D              }||fS )zGive the sign resulting from summing a list of expressions.

    Args:
        shapes: A list of sign (is pos, is neg) tuples.

    Returns:
        The sign (is pos, is neg) of the sum.
    c              3   <   K   | ]  }|j                           y wN)	is_nonneg.0exprs     O/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/cvxpy/utilities/sign.py	<genexpr>zsum_signs.<locals>.<genexpr>         4d!4   c              3   <   K   | ]  }|j                           y wr   )	is_nonposr   s     r   r   zsum_signs.<locals>.<genexpr>!   r   r   )all)r   is_posis_negs      r   	sum_signsr      s/     4e44F4e44FF    lh_exprrh_exprc                     | j                         }|j                         }| j                         }|j                         }|xr |}|xr |}|xs |}|xs |xr |xs |xr |}	|xs |xr |xs |xr |}
|	|
fS )zGive the sign resulting from multiplying two expressions.

    Args:
        lh_expr: An expression.
        rh_expr: An expression.

    Returns:
        The sign (is pos, is neg) of the product.
    )r   r   )r   r   	lh_nonneg	rh_nonneg	lh_nonpos	rh_nonposlh_zerorh_zerois_zeror   r   s              r   mul_signr%   %   s     !!#I!!#I!!#I!!#I%IG%IG GN0yNi6MIFN0yNi6MIFFr   N)	typingr   r   r   cvxpy.expressions.expressionr   boolr   r%    r   r   <module>r*      sZ    - -7"T,' E$*,= l \ eD$J>O r   