§
    µ³Ùgòq  ã                   ó†  — d Z ddlZddlZddlmZ ddlmZmZm	Z	m
Z
 ddgZ G d„ d¦  «        Z G d„ d	e¦  «        Z G d
„ de¦  «        Z G d„ de¦  «        Zdd„Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Zd„ ZdS )aU  Abstract linear algebra library.

This module defines a class hierarchy that implements a kind of "lazy"
matrix representation, called the ``LinearOperator``. It can be used to do
linear algebra with extremely large sparse or structured matrices, without
representing those explicitly in memory. Such matrices can be added,
multiplied, transposed, etc.

As a motivating example, suppose you want have a matrix where almost all of
the elements have the value one. The standard sparse matrix representation
skips the storage of zeros, but not ones. By contrast, a LinearOperator is
able to represent such matrices efficiently. First, we need a compact way to
represent an all-ones matrix::

    >>> import numpy as np
    >>> from scipy.sparse.linalg._interface import LinearOperator
    >>> class Ones(LinearOperator):
    ...     def __init__(self, shape):
    ...         super().__init__(dtype=None, shape=shape)
    ...     def _matvec(self, x):
    ...         return np.repeat(x.sum(), self.shape[0])

Instances of this class emulate ``np.ones(shape)``, but using a constant
amount of storage, independent of ``shape``. The ``_matvec`` method specifies
how this linear operator multiplies with (operates on) a vector. We can now
add this operator to a sparse matrix that stores only offsets from one::

    >>> from scipy.sparse.linalg._interface import aslinearoperator
    >>> from scipy.sparse import csr_array
    >>> offsets = csr_array([[1, 0, 2], [0, -1, 0], [0, 0, 3]])
    >>> A = aslinearoperator(offsets) + Ones(offsets.shape)
    >>> A.dot([1, 2, 3])
    array([13,  4, 15])

The result is the same as that given by its dense, explicitly-stored
counterpart::

    >>> (np.ones(A.shape, A.dtype) + offsets.toarray()).dot([1, 2, 3])
    array([13,  4, 15])

Several algorithms in the ``scipy.sparse`` library are able to operate on
``LinearOperator`` instances.
é    N)Úissparse)ÚisshapeÚ	isintlikeÚasmatrixÚis_pydata_spmatrixÚLinearOperatorÚaslinearoperatorc                   óø   ‡ — e Zd ZdZdZdZˆ fd„Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z ee¦  «        Z d„ Z! ee!¦  «        Z"d„ Z#d„ Z$ˆ xZ%S ) r   al  Common interface for performing matrix vector products

    Many iterative methods (e.g. cg, gmres) do not need to know the
    individual entries of a matrix to solve a linear system A@x=b.
    Such solvers only require the computation of matrix vector
    products, A@v where v is a dense vector.  This class serves as
    an abstract interface between iterative solvers and matrix-like
    objects.

    To construct a concrete LinearOperator, either pass appropriate
    callables to the constructor of this class, or subclass it.

    A subclass must implement either one of the methods ``_matvec``
    and ``_matmat``, and the attributes/properties ``shape`` (pair of
    integers) and ``dtype`` (may be None). It may call the ``__init__``
    on this class to have these attributes validated. Implementing
    ``_matvec`` automatically implements ``_matmat`` (using a naive
    algorithm) and vice-versa.

    Optionally, a subclass may implement ``_rmatvec`` or ``_adjoint``
    to implement the Hermitian adjoint (conjugate transpose). As with
    ``_matvec`` and ``_matmat``, implementing either ``_rmatvec`` or
    ``_adjoint`` implements the other automatically. Implementing
    ``_adjoint`` is preferable; ``_rmatvec`` is mostly there for
    backwards compatibility.

    Parameters
    ----------
    shape : tuple
        Matrix dimensions (M, N).
    matvec : callable f(v)
        Returns returns A @ v.
    rmatvec : callable f(v)
        Returns A^H @ v, where A^H is the conjugate transpose of A.
    matmat : callable f(V)
        Returns A @ V, where V is a dense matrix with dimensions (N, K).
    dtype : dtype
        Data type of the matrix.
    rmatmat : callable f(V)
        Returns A^H @ V, where V is a dense matrix with dimensions (M, K).

    Attributes
    ----------
    args : tuple
        For linear operators describing products etc. of other linear
        operators, the operands of the binary operation.
    ndim : int
        Number of dimensions (this is always 2)

    See Also
    --------
    aslinearoperator : Construct LinearOperators

    Notes
    -----
    The user-defined matvec() function must properly handle the case
    where v has shape (N,) as well as the (N,1) case.  The shape of
    the return type is handled internally by LinearOperator.

    It is highly recommended to explicitly specify the `dtype`, otherwise
    it is determined automatically at the cost of a single matvec application
    on `int8` zero vector using the promoted `dtype` of the output.
    Python `int` could be difficult to automatically cast to numpy integers
    in the definition of the `matvec` so the determination may be inaccurate.
    It is assumed that `matmat`, `rmatvec`, and `rmatmat` would result in
    the same dtype of the output given an `int8` input as `matvec`.

    LinearOperator instances can also be multiplied, added with each
    other and exponentiated, all lazily: the result of these operations
    is always a new, composite LinearOperator, that defers linear
    operations to the original operators and combines the results.

    More details regarding how to subclass a LinearOperator and several
    examples of concrete LinearOperator instances can be found in the
    external project `PyLops <https://pylops.readthedocs.io>`_.


    Examples
    --------
    >>> import numpy as np
    >>> from scipy.sparse.linalg import LinearOperator
    >>> def mv(v):
    ...     return np.array([2*v[0], 3*v[1]])
    ...
    >>> A = LinearOperator((2,2), matvec=mv)
    >>> A
    <2x2 _CustomLinearOperator with dtype=int8>
    >>> A.matvec(np.ones(2))
    array([ 2.,  3.])
    >>> A @ np.ones(2)
    array([ 2.,  3.])

    é   Nc                 óh  •— | t           u r&t          ¦   «                              t          ¦  «        S t          ¦   «                              | ¦  «        }t	          |¦  «        j        t           j        k    r>t	          |¦  «        j        t           j        k    rt          j        dt          d¬¦  «         |S )NzMLinearOperator subclass should implement at least one of _matvec and _matmat.r   )ÚcategoryÚ
stacklevel)
r   ÚsuperÚ__new__Ú_CustomLinearOperatorÚtypeÚ_matvecÚ_matmatÚwarningsÚwarnÚRuntimeWarning)ÚclsÚargsÚkwargsÚobjÚ	__class__s       €úT/granary/edev/quantum/lib/python3.11/site-packages/scipy/sparse/linalg/_interface.pyr   zLinearOperator.__new__š   s—   ø€ Ø•.Ð Ð å‘7”7—?’?Õ#8Ñ9Ô9Ð9å‘'”'—/’/ #Ñ&Ô&ˆCå�S‘	”	Ô!¥^Ô%;Ò;Ð;Ý˜S™	œ	Ô)­^Ô-CÒCÐCÝ”ð Få'5À!ðEñ Eô Eð Eð ˆJó    c                 ó°   — |�t          j        |¦  «        }t          |¦  «        }t          |¦  «        st	          d|›d�¦  «        ‚|| _        || _        dS )z¡Initialize this LinearOperator.

        To be called by subclasses. ``dtype`` may be None; ``shape`` should
        be convertible to a length-2 tuple.
        Nzinvalid shape z (must be 2-d))ÚnpÚdtypeÚtupler   Ú
ValueErrorÚshape)Úselfr!   r$   s      r   Ú__init__zLinearOperator.__init__©   s]   € ð ÐÝ”H˜U‘O”OˆEå�e‘”ˆÝ�u‰~Œ~ð 	GÝÐE¨eÐEÐEÐEÑFÔFÐFàˆŒ
ØˆŒ
ˆ
ˆ
r   c                 ó4  — | j         €�t          j        | j        d         t          j        ¬¦  «        }	 t          j        |                      |¦  «        ¦  «        }|j         | _         dS # t          $ r" t          j         t          ¦  «        | _         Y dS w xY wdS )aø  Determine the dtype by executing `matvec` on an `int8` test vector.

        In `np.promote_types` hierarchy, the type `int8` is the smallest,
        so we call `matvec` on `int8` and use the promoted dtype of the output
        to set the default `dtype` of the `LinearOperator`.
        We assume that `matmat`, `rmatvec`, and `rmatmat` would result in
        the same dtype of the output given an `int8` input as `matvec`.

        Called from subclasses at the end of the __init__ routine.
        Néÿÿÿÿ)r!   )	r!   r    Úzerosr$   Úint8ÚasarrayÚmatvecÚOverflowErrorÚint)r%   ÚvÚmatvec_vs      r   Ú_init_dtypezLinearOperator._init_dtype¹   s�   € ð Œ:ÐÝ”˜œ Bœ­r¬wÐ7Ñ7Ô7ˆAð,Ýœ: d§k¢k°!¡n¤nÑ5Ô5�ð
 &œ^�”
�
�
øõ	 !ð +ð +ð +åœX¥c™]œ]�”
�
�
�
ð+øøøð	 Ðs   ´'A) Á)(BÂBc                 óN   ‡ — t          j        ˆ fd„|j        D ¦   «         ¦  «        S )zÌDefault matrix-matrix multiplication handler.

        Falls back on the user-defined _matvec method, so defining that will
        define matrix multiplication (though in a very suboptimal way).
        c                 ób   •— g | ]+}‰                      |                     d d¦  «        ¦  «        ‘Œ,S ©r(   é   )r,   Úreshape©Ú.0Úcolr%   s     €r   ú
<listcomp>z*LinearOperator._matmat.<locals>.<listcomp>Õ   s3   ø€ ÐHÐHÐH¸S˜$Ÿ+š+ c§k¢k°"°QÑ&7Ô&7Ñ8Ô8ÐHÐHÐHr   )r    ÚhstackÚT©r%   ÚXs   ` r   r   zLinearOperator._matmatÎ   s,   ø€ õ ŒyÐHÐHÐHÐHÀAÄCÐHÑHÔHÑIÔIÐIr   c                 óT   — |                       |                     dd¦  «        ¦  «        S )ay  Default matrix-vector multiplication handler.

        If self is a linear operator of shape (M, N), then this method will
        be called on a shape (N,) or (N, 1) ndarray, and should return a
        shape (M,) or (M, 1) ndarray.

        This default implementation falls back on _matmat, so defining that
        will define matrix-vector multiplication as well.
        r(   r5   )Úmatmatr6   ©r%   Úxs     r   r   zLinearOperator._matvec×   s$   € ð �{Š{˜1Ÿ9š9 R¨Ñ+Ô+Ñ,Ô,Ð,r   c                 óÜ  — t          j        |¦  «        }| j        \  }}|j        |fk    r|j        |dfk    rt          d¦  «        ‚|                      |¦  «        }t          |t           j        ¦  «        rt          |¦  «        }nt          j        |¦  «        }|j	        dk    r| 
                    |¦  «        }n1|j	        dk    r| 
                    |d¦  «        }nt          d¦  «        ‚|S )ax  Matrix-vector multiplication.

        Performs the operation y=A@x where A is an MxN linear
        operator and x is a column vector or 1-d array.

        Parameters
        ----------
        x : {matrix, ndarray}
            An array with shape (N,) or (N,1).

        Returns
        -------
        y : {matrix, ndarray}
            A matrix or ndarray with shape (M,) or (M,1) depending
            on the type and shape of the x argument.

        Notes
        -----
        This matvec wraps the user-specified matvec routine or overridden
        _matvec method to ensure that y has the correct shape and type.

        r5   údimension mismatchr   z/invalid shape returned by user-defined matvec())r    Ú
asanyarrayr$   r#   r   Ú
isinstanceÚmatrixr   r+   Úndimr6   ©r%   rB   ÚMÚNÚys        r   r,   zLinearOperator.matvecã   sÕ   € õ0 ŒM˜!ÑÔˆàŒj‰ˆˆ!àŒ7�q�dŠ?ˆ?˜qœw¨1¨Q¨%Ò/Ð/ÝÐ1Ñ2Ô2Ð2à�LŠL˜‰OŒOˆå�a�œÑ#Ô#ð 	Ý˜‘”ˆAˆAå”
˜1‘”ˆAàŒ6�QŠ;ˆ;Ø—	’	˜!‘”ˆAˆAØŒV�qŠ[ˆ[Ø—	’	˜!˜A‘”ˆAˆAåÐNÑOÔOÐOàˆr   c                 óÜ  — t          j        |¦  «        }| j        \  }}|j        |fk    r|j        |dfk    rt          d¦  «        ‚|                      |¦  «        }t          |t           j        ¦  «        rt          |¦  «        }nt          j        |¦  «        }|j	        dk    r| 
                    |¦  «        }n1|j	        dk    r| 
                    |d¦  «        }nt          d¦  «        ‚|S )a‰  Adjoint matrix-vector multiplication.

        Performs the operation y = A^H @ x where A is an MxN linear
        operator and x is a column vector or 1-d array.

        Parameters
        ----------
        x : {matrix, ndarray}
            An array with shape (M,) or (M,1).

        Returns
        -------
        y : {matrix, ndarray}
            A matrix or ndarray with shape (N,) or (N,1) depending
            on the type and shape of the x argument.

        Notes
        -----
        This rmatvec wraps the user-specified rmatvec routine or overridden
        _rmatvec method to ensure that y has the correct shape and type.

        r5   rD   r   z0invalid shape returned by user-defined rmatvec())r    rE   r$   r#   Ú_rmatvecrF   rG   r   r+   rH   r6   rI   s        r   ÚrmatveczLinearOperator.rmatvec  s×   € õ0 ŒM˜!ÑÔˆàŒj‰ˆˆ!àŒ7�q�dŠ?ˆ?˜qœw¨1¨Q¨%Ò/Ð/ÝÐ1Ñ2Ô2Ð2à�MŠM˜!ÑÔˆå�a�œÑ#Ô#ð 	Ý˜‘”ˆAˆAå”
˜1‘”ˆAàŒ6�QŠ;ˆ;Ø—	’	˜!‘”ˆAˆAØŒV�qŠ[ˆ[Ø—	’	˜!˜A‘”ˆAˆAåÐOÑPÔPÐPàˆr   c                 óˆ   — t          | ¦  «        j        t          j        k    rt          ‚| j                             |¦  «        S )z6Default implementation of _rmatvec; defers to adjoint.)r   Ú_adjointr   ÚNotImplementedErrorÚHr,   rA   s     r   rN   zLinearOperator._rmatvecA  s3   € å�‰:Œ:Ô¥.Ô"9Ò9Ð9å%Ð%à”6—=’= Ñ#Ô#Ð#r   c                 ó(  — t          |¦  «        s#t          |¦  «        st          j        |¦  «        }|j        dk    rt          d|j        › d�¦  «        ‚|j        d         | j        d         k    rt          d| j        › d|j        › �¦  «        ‚	 |                      |¦  «        }nA# t          $ r4}t          |¦  «        st          |¦  «        rt          d¦  «        |‚‚ d	}~ww xY wt          |t          j        ¦  «        rt          |¦  «        }|S )
aP  Matrix-matrix multiplication.

        Performs the operation y=A@X where A is an MxN linear
        operator and X dense N*K matrix or ndarray.

        Parameters
        ----------
        X : {matrix, ndarray}
            An array with shape (N,K).

        Returns
        -------
        Y : {matrix, ndarray}
            A matrix or ndarray with shape (M,K) depending on
            the type of the X argument.

        Notes
        -----
        This matmat wraps any user-specified matmat routine or overridden
        _matmat method to ensure that y has the correct type.

        r   z$expected 2-d ndarray or matrix, not z-dr   r5   údimension mismatch: ú, zdUnable to multiply a LinearOperator with a sparse matrix. Wrap the matrix in aslinearoperator first.N)r   r   r    rE   rH   r#   r$   r   Ú	ExceptionÚ	TypeErrorrF   rG   r   ©r%   r>   ÚYÚes       r   r@   zLinearOperator.matmatI  s-  € õ. ˜‘”ð 	!Õ1°!Ñ4Ô4ð 	!Ý”˜aÑ Ô ˆAàŒ6�QŠ;ˆ;ÝÐNÀAÄFÐNÐNÐNÑOÔOÐOàŒ7�1Œ:˜œ AœÒ&Ð&ÝÐK°D´JÐKÐKÀ!Ä'ÐKÐKÑLÔLÐLð	Ø—’˜Q‘”ˆAˆAøÝð 	ð 	ð 	Ý˜‰{Œ{ð Õ0°Ñ3Ô3ð ÝðBñô ð ðð øøøøð	øøøõ �a�œÑ#Ô#ð 	Ý˜‘”ˆAàˆs   ÂB( Â(
C&Â2/C!Ã!C&c                 ó&  — t          |¦  «        s#t          |¦  «        st          j        |¦  «        }|j        dk    rt          d|j        z  ¦  «        ‚|j        d         | j        d         k    rt          d| j        › d|j        › �¦  «        ‚	 |                      |¦  «        }nA# t          $ r4}t          |¦  «        st          |¦  «        rt          d¦  «        |‚‚ d}~ww xY wt          |t          j        ¦  «        rt          |¦  «        }|S )a;  Adjoint matrix-matrix multiplication.

        Performs the operation y = A^H @ x where A is an MxN linear
        operator and x is a column vector or 1-d array, or 2-d array.
        The default implementation defers to the adjoint.

        Parameters
        ----------
        X : {matrix, ndarray}
            A matrix or 2D array.

        Returns
        -------
        Y : {matrix, ndarray}
            A matrix or 2D array depending on the type of the input.

        Notes
        -----
        This rmatmat wraps the user-specified rmatmat routine.

        r   z(expected 2-d ndarray or matrix, not %d-dr   rU   rV   zfUnable to multiply a LinearOperator with a sparse matrix. Wrap the matrix in aslinearoperator() first.N)r   r   r    rE   rH   r#   r$   Ú_rmatmatrW   rX   rF   rG   r   rY   s       r   ÚrmatmatzLinearOperator.rmatmatx  s4  € õ, ˜‘”ð 	!Õ1°!Ñ4Ô4ð 	!Ý”˜aÑ Ô ˆAàŒ6�QŠ;ˆ;ÝÐGØ œvñ&ñ 'ô 'ð 'ð Œ7�1Œ:˜œ AœÒ&Ð&ÝÐK°D´JÐKÐKÀ!Ä'ÐKÐKÑLÔLÐLð	Ø—’˜aÑ Ô ˆAˆAøÝð 	ð 	ð 	Ý˜‰{Œ{ð Õ0°Ñ3Ô3ð ÝðDñô ð ðð øøøøð	øøøõ �a�œÑ#Ô#ð 	Ý˜‘”ˆAØˆs   ÂB' Â'
C%Â1/C Ã C%c                 óÆ   ‡ — t          ‰ ¦  «        j        t          j        k    r%t          j        ˆ fd„|j        D ¦   «         ¦  «        S ‰ j                             |¦  «        S )z@Default implementation of _rmatmat defers to rmatvec or adjoint.c                 ób   •— g | ]+}‰                      |                     d d¦  «        ¦  «        ‘Œ,S r4   )rO   r6   r7   s     €r   r:   z+LinearOperator._rmatmat.<locals>.<listcomp>©  s3   ø€ ÐNÐNÐNÀ3˜dŸlšl¨3¯;ª;°r¸1Ñ+=Ô+=Ñ>Ô>ÐNÐNÐNr   )r   rQ   r   r    r;   r<   rS   r@   r=   s   ` r   r]   zLinearOperator._rmatmat¦  sU   ø€ å�‰:Œ:Ô¥.Ô"9Ò9Ð9Ý”9ÐNÐNÐNÐNÈ!Ì#ÐNÑNÔNÑOÔOÐOà”6—=’= Ñ#Ô#Ð#r   c                 ó   — | |z  S ©N© rA   s     r   Ú__call__zLinearOperator.__call__­  s   € Ø�A‰vˆr   c                 ó,   — |                       |¦  «        S rb   )ÚdotrA   s     r   Ú__mul__zLinearOperator.__mul__°  s   € Ø�xŠx˜‰{Œ{Ðr   c                 ón   — t          j        |¦  «        st          d¦  «        ‚t          | d|z  ¦  «        S )Nz.Can only divide a linear operator by a scalar.g      ð?)r    Úisscalarr#   Ú_ScaledLinearOperator©r%   Úothers     r   Ú__truediv__zLinearOperator.__truediv__³  s8   € ÝŒ{˜5Ñ!Ô!ð 	OÝÐMÑNÔNÐNå$ T¨3¨u©9Ñ5Ô5Ð5r   c                 óÔ  — t          |t          ¦  «        rt          | |¦  «        S t          j        |¦  «        rt          | |¦  «        S t          |¦  «        s#t          |¦  «        st          j        |¦  «        }|j	        dk    s|j	        dk    r&|j
        d         dk    r|                      |¦  «        S |j	        dk    r|                      |¦  «        S t          d|›�¦  «        ‚)ar  Matrix-matrix or matrix-vector multiplication.

        Parameters
        ----------
        x : array_like
            1-d or 2-d array, representing a vector or matrix.

        Returns
        -------
        Ax : array
            1-d or 2-d array (depending on the shape of x) that represents
            the result of applying this linear operator on x.

        r5   r   ú)expected 1-d or 2-d array or matrix, got )rF   r   Ú_ProductLinearOperatorr    ri   rj   r   r   r+   rH   r$   r,   r@   r#   rA   s     r   rf   zLinearOperator.dot¹  sØ   € õ �a�Ñ(Ô(ð 	TÝ)¨$°Ñ2Ô2Ð2ÝŒ[˜‰^Œ^ð 	TÝ(¨¨qÑ1Ô1Ð1å˜A‘;”;ð "Õ'9¸!Ñ'<Ô'<ð "å”J˜q‘M”M�àŒv˜Š{ˆ{˜aœf¨šk˜k¨a¬g°a¬j¸Aªo¨oØ—{’{ 1‘~”~Ð%Ø”˜1’�Ø—{’{ 1‘~”~Ð%å Ð!RÈQÐ!RÐ!RÑSÔSÐSr   c                 ór   — t          j        |¦  «        rt          d¦  «        ‚|                      |¦  «        S ©Nz0Scalar operands are not allowed, use '*' instead)r    ri   r#   rg   rk   s     r   Ú
__matmul__zLinearOperator.__matmul__Ø  s=   € ÝŒ;�uÑÔð 	0Ýð /ñ 0ô 0ð 0à�|Š|˜EÑ"Ô"Ð"r   c                 ór   — t          j        |¦  «        rt          d¦  «        ‚|                      |¦  «        S rr   )r    ri   r#   Ú__rmul__rk   s     r   Ú__rmatmul__zLinearOperator.__rmatmul__Þ  s=   € ÝŒ;�uÑÔð 	0Ýð /ñ 0ô 0ð 0à�}Š}˜UÑ#Ô#Ð#r   c                 ót   — t          j        |¦  «        rt          | |¦  «        S |                      |¦  «        S rb   )r    ri   rj   Ú_rdotrA   s     r   ru   zLinearOperator.__rmul__ä  s2   € ÝŒ;�q‰>Œ>ð 	!Ý(¨¨qÑ1Ô1Ð1à—:’:˜a‘=”=Ð r   c                 ó  — t          |t          ¦  «        rt          || ¦  «        S t          j        |¦  «        rt          | |¦  «        S t          |¦  «        s#t          |¦  «        st          j        |¦  «        }|j	        dk    s|j	        dk    r5|j
        d         dk    r$| j                             |j        ¦  «        j        S |j	        dk    r$| j                             |j        ¦  «        j        S t          d|›�¦  «        ‚)aï  Matrix-matrix or matrix-vector multiplication from the right.

        Parameters
        ----------
        x : array_like
            1-d or 2-d array, representing a vector or matrix.

        Returns
        -------
        xA : array
            1-d or 2-d array (depending on the shape of x) that represents
            the result of applying this linear operator on x from the right.

        Notes
        -----
        This is copied from dot to implement right multiplication.
        r5   r   r   ro   )rF   r   rp   r    ri   rj   r   r   r+   rH   r$   r<   r,   r@   r#   rA   s     r   rx   zLinearOperator._rdotê  sì   € õ$ �a�Ñ(Ô(ð 	TÝ)¨!¨TÑ2Ô2Ð2ÝŒ[˜‰^Œ^ð 	TÝ(¨¨qÑ1Ô1Ð1å˜A‘;”;ð "Õ'9¸!Ñ'<Ô'<ð "å”J˜q‘M”M�ð Œv˜Š{ˆ{˜aœf¨šk˜k¨a¬g°a¬j¸Aªo¨oØ”v—}’} Q¤SÑ)Ô)Ô+Ð+Ø”˜1’�Ø”v—}’} Q¤SÑ)Ô)Ô+Ð+å Ð!RÈQÐ!RÐ!RÑSÔSÐSr   c                 óX   — t          j        |¦  «        rt          | |¦  «        S t          S rb   )r    ri   Ú_PowerLinearOperatorÚNotImplemented)r%   Úps     r   Ú__pow__zLinearOperator.__pow__  s(   € ÝŒ;�q‰>Œ>ð 	"Ý'¨¨aÑ0Ô0Ð0å!Ð!r   c                 óZ   — t          |t          ¦  «        rt          | |¦  «        S t          S rb   )rF   r   Ú_SumLinearOperatorr|   rA   s     r   Ú__add__zLinearOperator.__add__  s*   € Ý�a�Ñ(Ô(ð 	"Ý% d¨AÑ.Ô.Ð.å!Ð!r   c                 ó"   — t          | d¦  «        S )Nr(   )rj   ©r%   s    r   Ú__neg__zLinearOperator.__neg__  s   € Ý$ T¨2Ñ.Ô.Ð.r   c                 ó.   — |                       | ¦  «        S rb   )r�   rA   s     r   Ú__sub__zLinearOperator.__sub__  s   € Ø�|Š|˜Q˜BÑÔÐr   c                 ó~   — | j         \  }}| j        €d}ndt          | j        ¦  «        z   }d||| j        j        |fz  S )Nzunspecified dtypezdtype=z<%dx%d %s with %s>)r$   r!   Ústrr   Ú__name__)r%   rJ   rK   Údts       r   Ú__repr__zLinearOperator.__repr__   sG   € ØŒj‰ˆˆ!ØŒ:ÐØ$ˆBˆBà�C ¤
™OœOÑ+ˆBà# q¨!¨T¬^Ô-DÀbÐ&IÑIÐIr   c                 ó*   — |                       ¦   «         S )aƒ  Hermitian adjoint.

        Returns the Hermitian adjoint of self, aka the Hermitian
        conjugate or Hermitian transpose. For a complex matrix, the
        Hermitian adjoint is equal to the conjugate transpose.

        Can be abbreviated self.H instead of self.adjoint().

        Returns
        -------
        A_H : LinearOperator
            Hermitian adjoint of self.
        )rQ   rƒ   s    r   ÚadjointzLinearOperator.adjoint)  s   € ð �}Š}‰ŒÐr   c                 ó*   — |                       ¦   «         S )z´Transpose this linear operator.

        Returns a LinearOperator that represents the transpose of this one.
        Can be abbreviated self.T instead of self.transpose().
        )Ú
_transposerƒ   s    r   Ú	transposezLinearOperator.transpose;  s   € ð �ŠÑ Ô Ð r   c                 ó    — t          | ¦  «        S )z6Default implementation of _adjoint; defers to rmatvec.)Ú_AdjointLinearOperatorrƒ   s    r   rQ   zLinearOperator._adjointE  s   € å% dÑ+Ô+Ð+r   c                 ó    — t          | ¦  «        S )z? Default implementation of _transpose; defers to rmatvec + conj)Ú_TransposedLinearOperatorrƒ   s    r   r�   zLinearOperator._transposeI  s   € å(¨Ñ.Ô.Ð.r   )&r‰   Ú
__module__Ú__qualname__Ú__doc__rH   Ú__array_ufunc__r   r&   r1   r   r   r,   rO   rN   r@   r^   r]   rd   rg   rm   rf   rs   rv   ru   rx   r~   r�   r„   r†   r‹   r�   ÚpropertyrS   r�   r<   rQ   r�   Ú__classcell__©r   s   @r   r   r   7   s  ø€ € € € € ð\ð \ð| €Dà€Oðð ð ð ð ðð ð ð ,ð ,ð ,ð*Jð Jð Jð
-ð 
-ð 
-ð-ð -ð -ð^-ð -ð -ð^$ð $ð $ð-ð -ð -ð^,ð ,ð ,ð\$ð $ð $ðð ð ðð ð ð6ð 6ð 6ðTð Tð Tð>#ð #ð #ð$ð $ð $ð!ð !ð !ð"Tð "Tð "TðH"ð "ð "ð"ð "ð "ð/ð /ð /ð ð  ð  ðJð Jð Jðð ð ð  	ˆ�ÑÔ€Að!ð !ð !ð 	ˆ�ÑÔ€Að,ð ,ð ,ð/ð /ð /ð /ð /ð /ð /r   c                   óN   ‡ — e Zd ZdZ	 	 d	ˆ fd„	Zˆ fd„Zd„ Zd„ Zˆ fd„Zd„ Z	ˆ xZ
S )
r   z>Linear operator defined in terms of user-specified operations.Nc                 óº   •— t          ¦   «                              ||¦  «         d| _        || _        || _        || _        || _        |                      ¦   «          d S )Nrc   )r   r&   r   Ú"_CustomLinearOperator__matvec_implÚ#_CustomLinearOperator__rmatvec_implÚ#_CustomLinearOperator__rmatmat_implÚ"_CustomLinearOperator__matmat_implr1   )r%   r$   r,   rO   r@   r!   r^   r   s          €r   r&   z_CustomLinearOperator.__init__Q  s\   ø€ å‰Œ×Ò˜ Ñ&Ô&Ð&àˆŒ	à#ˆÔØ%ˆÔØ%ˆÔØ#ˆÔà×ÒÑÔÐÐÐr   c                 ó~   •— | j         �|                       |¦  «        S t          ¦   «                              |¦  «        S rb   )r¡   r   r   ©r%   r>   r   s     €r   r   z_CustomLinearOperator._matmat^  s6   ø€ ØÔÐ)Ø×%Ò% aÑ(Ô(Ð(å‘7”7—?’? 1Ñ%Ô%Ð%r   c                 ó,   — |                       |¦  «        S rb   )rž   rA   s     r   r   z_CustomLinearOperator._matvecd  s   € Ø×!Ò! !Ñ$Ô$Ð$r   c                 ó\   — | j         }|€t          d¦  «        ‚|                       |¦  «        S )Nzrmatvec is not defined)rŸ   rR   )r%   rB   Úfuncs      r   rN   z_CustomLinearOperator._rmatvecg  s2   € ØÔ"ˆØˆ<Ý%Ð&>Ñ?Ô?Ð?Ø×"Ò" 1Ñ%Ô%Ð%r   c                 ó~   •— | j         �|                       |¦  «        S t          ¦   «                              |¦  «        S rb   )r    r   r]   r£   s     €r   r]   z_CustomLinearOperator._rmatmatm  s8   ø€ ØÔÐ*Ø×&Ò& qÑ)Ô)Ð)å‘7”7×#Ò# AÑ&Ô&Ð&r   c                 óŽ   — t          | j        d         | j        d         f| j        | j        | j        | j        | j        ¬¦  «        S )Nr5   r   )r$   r,   rO   r@   r^   r!   )r   r$   rŸ   rž   r    r¡   r!   rƒ   s    r   rQ   z_CustomLinearOperator._adjoints  sI   € Ý$¨D¬J°q¬M¸4¼:Àa¼=Ð+IØ,0Ô,?Ø-1Ô-?Ø,0Ô,?Ø-1Ô-?Ø+/¬:ð7ñ 7ô 7ð 	7r   )NNNN)r‰   r•   r–   r—   r&   r   r   rN   r]   rQ   rš   r›   s   @r   r   r   N  s¨   ø€ € € € € ØHÐHà;?Ø%)ðð ð ð ð ð ð&ð &ð &ð &ð &ð%ð %ð %ð&ð &ð &ð'ð 'ð 'ð 'ð 'ð7ð 7ð 7ð 7ð 7ð 7ð 7r   r   c                   ó:   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zd„ Zd„ Zˆ xZ	S )r’   z$Adjoint of arbitrary Linear Operatorc                 óª   •— |j         d         |j         d         f}t          ¦   «                              |j        |¬¦  «         || _        |f| _        d S ©Nr5   r   )r!   r$   ©r$   r   r&   r!   ÚAr   ©r%   r­   r$   r   s      €r   r&   z_AdjointLinearOperator.__init__  óL   ø€ Ø”˜”˜QœW QœZÐ(ˆÝ‰Œ×Ò˜qœw¨eÐÑ4Ô4Ð4ØˆŒØ�DˆŒ	ˆ	ˆ	r   c                 ó6   — | j                              |¦  «        S rb   )r­   rN   rA   s     r   r   z_AdjointLinearOperator._matvec…  ó   € ØŒv�Š˜qÑ!Ô!Ð!r   c                 ó6   — | j                              |¦  «        S rb   )r­   r   rA   s     r   rN   z_AdjointLinearOperator._rmatvecˆ  ó   € ØŒv�~Š~˜aÑ Ô Ð r   c                 ó6   — | j                              |¦  «        S rb   )r­   r]   rA   s     r   r   z_AdjointLinearOperator._matmat‹  r±   r   c                 ó6   — | j                              |¦  «        S rb   )r­   r   rA   s     r   r]   z_AdjointLinearOperator._rmatmatŽ  r³   r   ©
r‰   r•   r–   r—   r&   r   rN   r   r]   rš   r›   s   @r   r’   r’   |  sz   ø€ € € € € Ø.Ð.ðð ð ð ð ð"ð "ð "ð!ð !ð !ð"ð "ð "ð!ð !ð !ð !ð !ð !ð !r   r’   c                   ó:   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zd„ Zd„ Zˆ xZ	S )r”   z*Transposition of arbitrary Linear Operatorc                 óª   •— |j         d         |j         d         f}t          ¦   «                              |j        |¬¦  «         || _        |f| _        d S r«   r¬   r®   s      €r   r&   z"_TransposedLinearOperator.__init__”  r¯   r   c                 ó~   — t          j        | j                             t          j        |¦  «        ¦  «        ¦  «        S rb   )r    Úconjr­   rN   rA   s     r   r   z!_TransposedLinearOperator._matvecš  ó(   € åŒw�t”v—’¥r¤w¨q¡z¤zÑ2Ô2Ñ3Ô3Ð3r   c                 ó~   — t          j        | j                             t          j        |¦  «        ¦  «        ¦  «        S rb   )r    rº   r­   r   rA   s     r   rN   z"_TransposedLinearOperator._rmatvecž  ó(   € ÝŒw�t”v—~’~¥b¤g¨a¡j¤jÑ1Ô1Ñ2Ô2Ð2r   c                 ó~   — t          j        | j                             t          j        |¦  «        ¦  «        ¦  «        S rb   )r    rº   r­   r]   rA   s     r   r   z!_TransposedLinearOperator._matmat¡  r»   r   c                 ó~   — t          j        | j                             t          j        |¦  «        ¦  «        ¦  «        S rb   )r    rº   r­   r   rA   s     r   r]   z"_TransposedLinearOperator._rmatmat¥  r½   r   r¶   r›   s   @r   r”   r”   ‘  sz   ø€ € € € € Ø4Ð4ðð ð ð ð ð4ð 4ð 4ð3ð 3ð 3ð4ð 4ð 4ð3ð 3ð 3ð 3ð 3ð 3ð 3r   r”   c                 óˆ   — |€g }| D ].}|�*t          |d¦  «        r|                     |j        ¦  «         Œ/t          j        |Ž S )Nr!   )ÚhasattrÚappendr!   r    Úresult_type)Ú	operatorsÚdtypesr   s      r   Ú
_get_dtyperÆ   ¨  sP   € Ø€~ØˆØð %ð %ˆØˆ?�w s¨GÑ4Ô4ˆ?Ø�MŠM˜#œ)Ñ$Ô$Ð$øÝŒ>˜6Ð"Ð"r   c                   ó<   ‡ — e Zd Zˆ fd„Zd„ Zd„ Zd„ Zd„ Zd„ Zˆ xZ	S )r€   c                 óD  •— t          |t          ¦  «        rt          |t          ¦  «        st          d¦  «        ‚|j        |j        k    rt          d|› d|› d�¦  «        ‚||f| _        t          ¦   «                              t          ||g¦  «        |j        ¦  «         d S )Nú)both operands have to be a LinearOperatorzcannot add ú and ú: shape mismatch)rF   r   r#   r$   r   r   r&   rÆ   ©r%   r­   ÚBr   s      €r   r&   z_SumLinearOperator.__init__²  s¢   ø€ Ý˜!�^Ñ,Ô,ð 	JÝ˜q¥.Ñ1Ô1ð	JåÐHÑIÔIÐIØŒ7�a”gÒÐÝÐF¨1ÐFÐF°1ÐFÐFÐFÑGÔGÐGØ˜�FˆŒ	Ý‰Œ×Ò� Q¨ FÑ+Ô+¨Q¬WÑ5Ô5Ð5Ð5Ð5r   c                 ó„   — | j         d                              |¦  «        | j         d                              |¦  «        z   S ©Nr   r5   ©r   r,   rA   s     r   r   z_SumLinearOperator._matvec»  ó5   € ØŒy˜Œ|×"Ò" 1Ñ%Ô%¨¬	°!¬×(;Ò(;¸AÑ(>Ô(>Ñ>Ð>r   c                 ó„   — | j         d                              |¦  «        | j         d                              |¦  «        z   S rÏ   ©r   rO   rA   s     r   rN   z_SumLinearOperator._rmatvec¾  ó5   € ØŒy˜Œ|×#Ò# AÑ&Ô&¨¬°1¬×)=Ò)=¸aÑ)@Ô)@Ñ@Ð@r   c                 ó„   — | j         d                              |¦  «        | j         d                              |¦  «        z   S rÏ   ©r   r^   rA   s     r   r]   z_SumLinearOperator._rmatmatÁ  rÔ   r   c                 ó„   — | j         d                              |¦  «        | j         d                              |¦  «        z   S rÏ   ©r   r@   rA   s     r   r   z_SumLinearOperator._matmatÄ  rÑ   r   c                 ó4   — | j         \  }}|j        |j        z   S rb   ©r   rS   ©r%   r­   rÍ   s      r   rQ   z_SumLinearOperator._adjointÇ  ó   € ØŒy‰ˆˆ1ØŒs�Q”S‰yÐr   ©
r‰   r•   r–   r&   r   rN   r]   r   rQ   rš   r›   s   @r   r€   r€   ±  s‰   ø€ € € € € ð6ð 6ð 6ð 6ð 6ð?ð ?ð ?ðAð Að AðAð Að Að?ð ?ð ?ðð ð ð ð ð ð r   r€   c                   ó<   ‡ — e Zd Zˆ fd„Zd„ Zd„ Zd„ Zd„ Zd„ Zˆ xZ	S )rp   c                 ó‚  •— t          |t          ¦  «        rt          |t          ¦  «        st          d¦  «        ‚|j        d         |j        d         k    rt          d|› d|› d�¦  «        ‚t	          ¦   «                              t          ||g¦  «        |j        d         |j        d         f¦  «         ||f| _        d S )NrÉ   r5   r   zcannot multiply rÊ   rË   )rF   r   r#   r$   r   r&   rÆ   r   rÌ   s      €r   r&   z_ProductLinearOperator.__init__Í  sÁ   ø€ Ý˜!�^Ñ,Ô,ð 	JÝ˜q¥.Ñ1Ô1ð	JåÐHÑIÔIÐIØŒ7�1Œ:˜œ œÒ#Ð#ÝÐK°ÐKÐK¸ÐKÐKÐKÑLÔLÐLÝ‰Œ×Ò� Q¨ FÑ+Ô+Ø67´g¸a´jÀ!Ä'È!Ä*Ð5Mñ	Oô 	Oð 	Oà˜�FˆŒ	ˆ	ˆ	r   c                 ó~   — | j         d                              | j         d                              |¦  «        ¦  «        S rÏ   rÐ   rA   s     r   r   z_ProductLinearOperator._matvec×  ó0   € ØŒy˜Œ|×"Ò" 4¤9¨Q¤<×#6Ò#6°qÑ#9Ô#9Ñ:Ô:Ð:r   c                 ó~   — | j         d                              | j         d                              |¦  «        ¦  «        S ©Nr5   r   rÓ   rA   s     r   rN   z_ProductLinearOperator._rmatvecÚ  ó0   € ØŒy˜Œ|×#Ò# D¤I¨a¤L×$8Ò$8¸Ñ$;Ô$;Ñ<Ô<Ð<r   c                 ó~   — | j         d                              | j         d                              |¦  «        ¦  «        S rã   rÖ   rA   s     r   r]   z_ProductLinearOperator._rmatmatÝ  rä   r   c                 ó~   — | j         d                              | j         d                              |¦  «        ¦  «        S rÏ   rØ   rA   s     r   r   z_ProductLinearOperator._matmatà  rá   r   c                 ó4   — | j         \  }}|j        |j        z  S rb   rÚ   rÛ   s      r   rQ   z_ProductLinearOperator._adjointã  rÜ   r   rÝ   r›   s   @r   rp   rp   Ì  sƒ   ø€ € € € € ðð ð ð ð ð;ð ;ð ;ð=ð =ð =ð=ð =ð =ð;ð ;ð ;ðð ð ð ð ð ð r   rp   c                   ó<   ‡ — e Zd Zˆ fd„Zd„ Zd„ Zd„ Zd„ Zd„ Zˆ xZ	S )rj   c                 ó|  •— t          |t          ¦  «        st          d¦  «        ‚t          j        |¦  «        st          d¦  «        ‚t          |t
          ¦  «        r|j        \  }}||z  }t          |gt          |¦  «        g¦  «        }t          ¦   «          
                    ||j        ¦  «         ||f| _        d S )NúLinearOperator expected as Azscalar expected as alpha)rF   r   r#   r    ri   rj   r   rÆ   r   r   r&   r$   )r%   r­   ÚalphaÚalpha_originalr!   r   s        €r   r&   z_ScaledLinearOperator.__init__é  s´   ø€ Ý˜!�^Ñ,Ô,ð 	=ÝÐ;Ñ<Ô<Ð<ÝŒ{˜5Ñ!Ô!ð 	9ÝÐ7Ñ8Ô8Ð8Ý�aÕ.Ñ/Ô/ð 	+Ø !¤ÑˆAˆ~ð ˜NÑ*ˆEå˜A˜3¥ e¡¤ Ñ.Ô.ˆÝ‰Œ×Ò˜ ¤Ñ(Ô(Ð(Ø˜�JˆŒ	ˆ	ˆ	r   c                 ó^   — | j         d         | j         d                              |¦  «        z  S rã   rÐ   rA   s     r   r   z_ScaledLinearOperator._matvecù  ó'   € ØŒy˜Œ|˜dœi¨œl×1Ò1°!Ñ4Ô4Ñ4Ð4r   c                 ó‚   — t          j        | j        d         ¦  «        | j        d                              |¦  «        z  S rã   )r    rº   r   rO   rA   s     r   rN   z_ScaledLinearOperator._rmatvecü  ó1   € ÝŒw�t”y ”|Ñ$Ô$ t¤y°¤|×';Ò';¸AÑ'>Ô'>Ñ>Ð>r   c                 ó‚   — t          j        | j        d         ¦  «        | j        d                              |¦  «        z  S rã   )r    rº   r   r^   rA   s     r   r]   z_ScaledLinearOperator._rmatmatÿ  rð   r   c                 ó^   — | j         d         | j         d                              |¦  «        z  S rã   rØ   rA   s     r   r   z_ScaledLinearOperator._matmat  rî   r   c                 óN   — | j         \  }}|j        t          j        |¦  «        z  S rb   )r   rS   r    rº   )r%   r­   rë   s      r   rQ   z_ScaledLinearOperator._adjoint  s"   € Ø”9‰ˆˆ5ØŒs•R”W˜U‘^”^Ñ#Ð#r   rÝ   r›   s   @r   rj   rj   è  sƒ   ø€ € € € € ðð ð ð ð ð 5ð 5ð 5ð?ð ?ð ?ð?ð ?ð ?ð5ð 5ð 5ð$ð $ð $ð $ð $ð $ð $r   rj   c                   óB   ‡ — e Zd Zˆ fd„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	ˆ xZ
S )r{   c                 óp  •— t          |t          ¦  «        st          d¦  «        ‚|j        d         |j        d         k    rt          d|›�¦  «        ‚t	          |¦  «        r|dk     rt          d¦  «        ‚t          ¦   «                              t          |g¦  «        |j        ¦  «         ||f| _        d S )Nrê   r   r5   z$square LinearOperator expected, got z"non-negative integer expected as p)	rF   r   r#   r$   r   r   r&   rÆ   r   )r%   r­   r}   r   s      €r   r&   z_PowerLinearOperator.__init__  s«   ø€ Ý˜!�^Ñ,Ô,ð 	=ÝÐ;Ñ<Ô<Ð<ØŒ7�1Œ:˜œ œÒ#Ð#ÝÐIÀAÐIÐIÑJÔJÐJÝ˜‰|Œ|ð 	C˜q 1šu˜uÝÐAÑBÔBÐBå‰Œ×Ò� Q C™œ¨!¬'Ñ2Ô2Ð2Ø˜�FˆŒ	ˆ	ˆ	r   c                 ó‚   — t          j        |d¬¦  «        }t          | j        d         ¦  «        D ]} ||¦  «        }Œ|S )NT)Úcopyr5   )r    ÚarrayÚranger   )r%   ÚfunrB   ÚresÚis        r   Ú_powerz_PowerLinearOperator._power  sG   € ÝŒh�q˜tÐ$Ñ$Ô$ˆÝ�t”y ”|Ñ$Ô$ð 	ð 	ˆAØ�#�c‘(”(ˆCˆCØˆ
r   c                 óN   — |                       | j        d         j        |¦  «        S ©Nr   )rý   r   r,   rA   s     r   r   z_PowerLinearOperator._matvec  ó   € Ø�{Š{˜4œ9 Qœ<Ô.°Ñ2Ô2Ð2r   c                 óN   — |                       | j        d         j        |¦  «        S rÿ   )rý   r   rO   rA   s     r   rN   z_PowerLinearOperator._rmatvec  ó   € Ø�{Š{˜4œ9 Qœ<Ô/°Ñ3Ô3Ð3r   c                 óN   — |                       | j        d         j        |¦  «        S rÿ   )rý   r   r^   rA   s     r   r]   z_PowerLinearOperator._rmatmat"  r  r   c                 óN   — |                       | j        d         j        |¦  «        S rÿ   )rý   r   r@   rA   s     r   r   z_PowerLinearOperator._matmat%  r   r   c                 ó*   — | j         \  }}|j        |z  S rb   rÚ   )r%   r­   r}   s      r   rQ   z_PowerLinearOperator._adjoint(  s   € ØŒy‰ˆˆ1ØŒs�a‰xˆr   )r‰   r•   r–   r&   rý   r   rN   r]   r   rQ   rš   r›   s   @r   r{   r{   
  s’   ø€ € € € € ð	ð 	ð 	ð 	ð 	ðð ð ð3ð 3ð 3ð4ð 4ð 4ð4ð 4ð 4ð3ð 3ð 3ðð ð ð ð ð ð r   r{   c                   ó*   ‡ — e Zd Zˆ fd„Zd„ Zd„ Zˆ xZS )ÚMatrixLinearOperatorc                 óŒ   •— t          ¦   «                              |j        |j        ¦  «         || _        d | _        |f| _        d S rb   )r   r&   r!   r$   r­   Ú_MatrixLinearOperator__adjr   )r%   r­   r   s     €r   r&   zMatrixLinearOperator.__init__.  s<   ø€ Ý‰Œ×Ò˜œ !¤'Ñ*Ô*Ð*ØˆŒØˆŒ
Ø�DˆŒ	ˆ	ˆ	r   c                 ó6   — | j                              |¦  «        S rb   )r­   rf   r=   s     r   r   zMatrixLinearOperator._matmat4  s   € ØŒv�zŠz˜!‰}Œ}Ðr   c                 óF   — | j         €t          | ¦  «        | _         | j         S rb   )r	  Ú_AdjointMatrixOperatorrƒ   s    r   rQ   zMatrixLinearOperator._adjoint7  s!   € ØŒ:ÐÝ/°Ñ5Ô5ˆDŒJØŒzÐr   )r‰   r•   r–   r&   r   rQ   rš   r›   s   @r   r  r  -  sV   ø€ € € € € ðð ð ð ð ðð ð ðð ð ð ð ð ð r   r  c                   ó0   — e Zd Zd„ Zed„ ¦   «         Zd„ ZdS )r  c                 ó¨   — |j         j                             ¦   «         | _         || _        |f| _        |j        d         |j        d         f| _        d S rã   )r­   r<   rº   Ú_AdjointMatrixOperator__adjointr   r$   )r%   r�   s     r   r&   z_AdjointMatrixOperator.__init__=  sG   € Ø””×!Ò!Ñ#Ô#ˆŒØ ˆŒØ�JˆŒ	Ø”] 1Ô% w¤}°QÔ'7Ð7ˆŒ
ˆ
ˆ
r   c                 ó   — | j         j        S rb   )r  r!   rƒ   s    r   r!   z_AdjointMatrixOperator.dtypeC  s   € àŒ~Ô#Ð#r   c                 ó   — | j         S rb   )r  rƒ   s    r   rQ   z_AdjointMatrixOperator._adjointG  s
   € ØŒ~Ðr   N)r‰   r•   r–   r&   r™   r!   rQ   rc   r   r   r  r  <  sM   € € € € € ð8ð 8ð 8ð ð$ð $ñ „Xð$ðð ð ð ð r   r  c                   ó>   ‡ — e Zd Zdˆ fd„	Zd„ Zd„ Zd„ Zd„ Zd„ Zˆ xZ	S )	ÚIdentityOperatorNc                 óL   •— t          ¦   «                              ||¦  «         d S rb   )r   r&   )r%   r$   r!   r   s      €r   r&   zIdentityOperator.__init__L  s#   ø€ Ý‰Œ×Ò˜ Ñ&Ô&Ð&Ð&Ð&r   c                 ó   — |S rb   rc   rA   s     r   r   zIdentityOperator._matvecO  ó   € Øˆr   c                 ó   — |S rb   rc   rA   s     r   rN   zIdentityOperator._rmatvecR  r  r   c                 ó   — |S rb   rc   rA   s     r   r]   zIdentityOperator._rmatmatU  r  r   c                 ó   — |S rb   rc   rA   s     r   r   zIdentityOperator._matmatX  r  r   c                 ó   — | S rb   rc   rƒ   s    r   rQ   zIdentityOperator._adjoint[  s   € Øˆr   rb   rÝ   r›   s   @r   r  r  K  sˆ   ø€ € € € € ð'ð 'ð 'ð 'ð 'ð 'ðð ð ðð ð ðð ð ðð ð ðð ð ð ð ð ð r   r  c                 óÀ  — t          | t          ¦  «        r| S t          | t          j        ¦  «        st          | t          j        ¦  «        rO| j        dk    rt          d¦  «        ‚t          j        t          j        | ¦  «        ¦  «        } t          | ¦  «        S t          | ¦  «        st          | ¦  «        rt          | ¦  «        S t          | d¦  «        ryt          | d¦  «        rid}d}d}t          | d¦  «        r| j        }t          | d¦  «        r| j        }t          | d¦  «        r| j        }t          | j        | j        |||¬	¦  «        S t%          d
¦  «        ‚)aÿ  Return A as a LinearOperator.

    'A' may be any of the following types:
     - ndarray
     - matrix
     - sparse array (e.g. csr_array, lil_array, etc.)
     - LinearOperator
     - An object with .shape and .matvec attributes

    See the LinearOperator documentation for additional information.

    Notes
    -----
    If 'A' has no .dtype attribute, the data type is determined by calling
    :func:`LinearOperator.matvec()` - set the .dtype attribute to prevent this
    call upon the linear operator creation.

    Examples
    --------
    >>> import numpy as np
    >>> from scipy.sparse.linalg import aslinearoperator
    >>> M = np.array([[1,2,3],[4,5,6]], dtype=np.int32)
    >>> aslinearoperator(M)
    <2x3 MatrixLinearOperator with dtype=int32>
    r   zarray must have ndim <= 2r$   r,   NrO   r^   r!   )rO   r^   r!   ztype not understood)rF   r   r    ÚndarrayrG   rH   r#   Ú
atleast_2dr+   r  r   r   rÁ   rO   r^   r!   r$   r,   rX   )r­   rO   r^   r!   s       r   r	   r	   _  sg  € õ4 �!•^Ñ$Ô$ð 3Øˆå	�A•r”zÑ	"Ô	"ð 3¥j°µB´IÑ&>Ô&>ð 3ØŒ6�AŠ:ˆ:ÝÐ8Ñ9Ô9Ð9ÝŒM�"œ* Q™-œ-Ñ(Ô(ˆÝ# AÑ&Ô&Ð&å	�!‰Œð 3Õ*¨1Ñ-Ô-ð 3Ý# AÑ&Ô&Ð&õ �1�gÑÔð 	3¥7¨1¨hÑ#7Ô#7ð 	3ØˆGØˆGØˆEå�q˜)Ñ$Ô$ð $Øœ)�Ý�q˜)Ñ$Ô$ð $Øœ)�Ý�q˜'Ñ"Ô"ð  Øœ�Ý! !¤'¨1¬8¸WØ*1¸ð@ñ @ô @ð @õ Ð1Ñ2Ô2Ð2r   rb   )r—   r   Únumpyr    Úscipy.sparser   Úscipy.sparse._sputilsr   r   r   r   Ú__all__r   r   r’   r”   rÆ   r€   rp   rj   r{   r  r  r  r	   rc   r   r   ú<module>r"     sn  ðð*ð *ðX €€€à Ð Ð Ð à !Ð !Ð !Ð !Ð !Ð !Ø RÐ RÐ RÐ RÐ RÐ RÐ RÐ RÐ RÐ RÐ RÐ RàÐ/Ð
0€ðT/ð T/ð T/ð T/ð T/ñ T/ô T/ð T/ðn+7ð +7ð +7ð +7ð +7˜Nñ +7ô +7ð +7ð\!ð !ð !ð !ð !˜^ñ !ô !ð !ð*3ð 3ð 3ð 3ð 3 ñ 3ô 3ð 3ð.#ð #ð #ð #ðð ð ð ð ˜ñ ô ð ð6ð ð ð ð ˜^ñ ô ð ð8$ð $ð $ð $ð $˜Nñ $ô $ð $ðD ð  ð  ð  ð  ˜>ñ  ô  ð  ðFð ð ð ð ˜>ñ ô ð ðð ð ð ð Ð1ñ ô ð ðð ð ð ð �~ñ ô ð ð(63ð 63ð 63ð 63ð 63r   