
    bi6	                     >    d Z ddlmZ ddlZddlmZ  G d de      Zy)a6  
Copyright 2013 Steven Diamond, Eric Chu

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.
    )TupleN)Elementwisec                        e Zd ZdZd fdZej                  d        Zdee	e	f   fdZ
de	fdZde	fdZde	fdZde	fd	Zde	fd
Zde	fdZd Z xZS )expzElementwise :math:`e^{x}`.
    returnc                 ,    t         t        |   |       y )N)superr   __init__)selfx	__class__s     V/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/cvxpy/atoms/elementwise/exp.pyr
   zexp.__init__   s    c4!!$    c                 2    t        j                  |d         S )Nr   )npr   )r   valuess     r   numericzexp.numeric    s    vvfQi  r   c                      y)zCReturns sign (is positive, is negative) of the expression.
        )TF r   s    r   sign_from_argszexp.sign_from_args$   s     r   c                      y)zIs the atom convex?
        Tr   r   s    r   is_atom_convexzexp.is_atom_convex*        r   c                      y)zIs the atom concave?
        Fr   r   s    r   is_atom_concavezexp.is_atom_concave/        r   c                      y)z$Is the atom log-log convex?
        Tr   r   s    r   is_atom_log_log_convexzexp.is_atom_log_log_convex4   r   r   c                      y)z%Is the atom log-log concave?
        Fr   r   s    r   is_atom_log_log_concavezexp.is_atom_log_log_concave9   r   r   c                      y)z;Is the composition non-decreasing in argument idx?
        Tr   r   idxs     r   is_incrzexp.is_incr>   r   r   c                      y)z;Is the composition non-increasing in argument idx?
        Fr   r#   s     r   is_decrzexp.is_decrC   r   r   c                     | j                   d   j                  }| j                  }t        j                  |d         }t        j	                  |||      gS )a+  Gives the (sub/super)gradient of the atom w.r.t. each argument.

        Matrix expressions are vectorized, so the gradient is a matrix.

        Args:
            values: A list of numeric values for the arguments.

        Returns:
            A list of SciPy CSC sparse matrices or None.
        r   )argssizer   r   elemwise_grad_to_diag)r   r   rowscols	grad_valss        r   _gradz	exp._gradH   sJ     yy|  yyFF6!9%	)))T4@AAr   )r   N)__name__
__module____qualname____doc__r
   r   numpy_numericr   r   boolr   r   r   r   r!   r%   r'   r/   __classcell__)r   s   @r   r   r      s    % ! !dDj 1  
 
 
 
d 
d 
Br   r   )r3   typingr   numpyr   #cvxpy.atoms.elementwise.elementwiser   r   r   r   r   <module>r:      s#       ;>B+ >Br   