
    bi$	                     v    d Z ddlmZmZmZ ddlZddlmc m	Z
 ddlmc mZ ddlm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

    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.
    )ListOptionalTupleN)AffAtom)
Constraintc                        e Zd ZdZd fdZdefdZdefdZdefdZd Z	de
ee      fdZdd	Zdeed
f   fdZ	 ddeed
f   deej$                  e
e   f   fdZ xZS )broadcast_toz,Broadcast the expression given a shape inputreturnc                 \    || _         |j                  | _        t        t        |   |       y N)broadcast_shapeshape_shapesuperr	   __init__)selfexprr   	__class__s      Z/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/cvxpy/atoms/affine/broadcast_to.pyr   zbroadcast_to.__init__   s%    $jjlD*40    c                      y)NF r   s    r   _supports_cppzbroadcast_to._supports_cpp#   s    r   c                      yNTr   r   s    r   is_atom_log_log_convexz#broadcast_to.is_atom_log_log_convex&       r   c                      yr   r   r   s    r   is_atom_log_log_concavez$broadcast_to.is_atom_log_log_concave)   r   r   c                 J    t        j                  |d   | j                        S )Nr   r   )npr	   r   )r   valuess     r   numericzbroadcast_to.numeric,   s    vay0D0DEEr   c                     | j                   gS r   r   r   s    r   get_datazbroadcast_to.get_data/   s    $$%%r   c                     t        j                  t        j                  | j                  t        j                  g             | j
                         y )N)dtyper"   )r#   r	   emptyr   r*   r   r   s    r   validate_argumentszbroadcast_to.validate_arguments2   s1    
HHTZZrxx|4&&	
r   .c                     | j                   S r   r'   r   s    r   shape_from_argszbroadcast_to.shape_from_args8   s    ###r   r   c                 2    t        j                  ||      g fS )a  Broadcast an expression to a given shape.

        Parameters
        ----------
        arg_objs : list
            LinOp for each argument.
        shape : tuple
            The shape of the resulting expression.
        data :
            Additional data required by the atom. In this case data wraps axis

        Returns
        -------
        tuple
            (LinOp for the objective, list of constraints)
        )lur	   )r   arg_objsr   datas       r   graph_implementationz!broadcast_to.graph_implementation;   s    , %0"55r   )r
   Nr   )__name__
__module____qualname____doc__r   boolr   r   r    r%   r   r   intr(   r,   r   r.   loLinOpr   r3   __classcell__)r   s   @r   r	   r	      s    61
t   F&$x}- &
$sCx $ 	6 S#X6
 
rxxj))	*6r   r	   )r7   typingr   r   r   numpyr#   cvxpy.lin_ops.lin_oplin_opslin_opr:   cvxpy.lin_ops.lin_utils	lin_utilsr0   cvxpy.atoms.affine.affine_atomr   cvxpy.constraints.constraintr   r	   r   r   r   <module>rF      s3     ) (  ! ! $ $ 2 3667 66r   