
    Cpj                          " S  S5      r g)c                   &  ^  \ rS rSr% SrSr\\S4   \S'   \	S 5       r
\	S 5       r\	S 5       r\	S	 5       r\	S
 5       r\	S 5       r\	S 5       rS rS rS rS rS r\	" \\SS9rS rS rS rSS jrS rS rS rSU 4S jjr\S 5       r Sr!U =r"$ ) spmatrix   av  This class provides a base class for all sparse matrix classes.

.. warning::

   SciPy sparse is shifting from a sparse matrix interface to a sparse
   array interface. In the next few releases we expect to deprecate the
   sparse matrix interface. For documentation of the matrix
   interface, see the :ref:`spmatrix interface docs <spmatrix_api>`.
   For guidance on converting existing code to sparse arrays, see
   :ref:`Migration from spmatrix to sparray <migration_to_sparray>`.

This class also serves as the namespace for SciPy sparse matrix types.
It cannot be instantiated.  Most of the work is provided by subclasses.
)   .	_allow_ndc                     SSK Jn  U$ )Nr   )
bsr_matrix)_bsrr   )selfr   s     P/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/scipy/sparse/_matrix.py_bsr_containerspmatrix._bsr_container       $    c                     SSK Jn  U$ )Nr   )
coo_matrix)_coor   )r
   r   s     r   _coo_containerspmatrix._coo_container   r   r   c                     SSK Jn  U$ )Nr   )
csc_matrix)_cscr   )r
   r   s     r   _csc_containerspmatrix._csc_container   r   r   c                     SSK Jn  U$ )Nr   )
csr_matrix)_csrr   )r
   r   s     r   _csr_containerspmatrix._csr_container!   r   r   c                     SSK Jn  U$ )Nr   )
dia_matrix)_diar    )r
   r    s     r   _dia_containerspmatrix._dia_container&   r   r   c                     SSK Jn  U$ )Nr   )
dok_matrix)_dokr%   )r
   r%   s     r   _dok_containerspmatrix._dok_container+   r   r   c                     SSK Jn  U$ )Nr   )
lil_matrix)_lilr*   )r
   r*   s     r   _lil_containerspmatrix._lil_container0   r   r   c                 $    U R                  U5      $ N)_matmul_dispatchr
   others     r   __mul__spmatrix.__mul__6   s    $$U++r   c                 $    U R                  U5      $ r/   )_rmatmul_dispatchr1   s     r   __rmul__spmatrix.__rmul__9   s    %%e,,r   c                     SSK Jn  U" X5      $ )Nr   )matrix_power)linalgr:   )r
   powerr:   s      r   __pow__spmatrix.__pow__=   s    (D((r   c                 x    U R                  USS9R                  U R                  5      nUR                  U l        g)z$Set the shape of the matrix in-placeF)copyN)reshapeasformatformat__dict__)r
   shapenew_selfs      r   	set_shapespmatrix.set_shapeD   s2     <<E<2;;DKKH ))r   c                     U R                   $ )zGet the shape of the matrix)_shaper
   s    r   	get_shapespmatrix.get_shapeK       {{r   zShape of the matrix)fgetfsetdocc                 "    U R                  5       $ )z7Upcast matrix to a floating point format (if necessary))	_asfptyperK   s    r   asfptypespmatrix.asfptypeR   s    ~~r   c                 "    U R                  5       $ )z3Maximum number of elements to display when printed.)_getmaxprintrK   s    r   getmaxprintspmatrix.getmaxprintV   s      ""r   c                     U R                   $ )zMatrix storage format)rC   rK   s    r   	getformatspmatrix.getformatZ   rN   r   c                      U R                  US9$ )zNumber of stored values, including explicit zeros.

Parameters
----------
axis : None, 0, or 1
    Select between the number of values across the whole array, in
    each column, or in each row.
)axis)_getnnz)r
   r^   s     r   getnnzspmatrix.getnnz^   s     |||&&r   c                 >    U R                  5       R                  5       $ )zReturn the Hermitian transpose of this matrix.

See Also
--------
numpy.matrix.getH : NumPy's implementation of `getH` for matrices
)	conjugate	transposerK   s    r   getHspmatrix.getHi   s     ~~))++r   c                 $    U R                  U5      $ )zWReturns a copy of column j of the matrix, as an (m x 1) sparse
matrix (column vector).
)_getcol)r
   js     r   getcolspmatrix.getcolr        ||Ar   c                 $    U R                  U5      $ )zPReturns a copy of row i of the matrix, as a (1 x n) sparse
matrix (row vector).
)_getrow)r
   is     r   getrowspmatrix.getrowx   rl   r   c                 "   > [         TU ]  X5      $ )a  
Return a dense representation of this sparse matrix.

Parameters
----------
order : {'C', 'F'}, optional
    Whether to store multi-dimensional data in C (row-major)
    or Fortran (column-major) order in memory. The default
    is 'None', which provides no ordering guarantees.
    Cannot be specified in conjunction with the `out`
    argument.

out : ndarray, 2-D, optional
    If specified, uses this array (or `numpy.matrix`) as the
    output buffer instead of allocating a new array to
    return. The provided array must have the same shape and
    dtype as the sparse matrix on which you are calling the
    method.

Returns
-------
arr : numpy.matrix, 2-D
    A NumPy matrix object with the same shape and containing
    the same data represented by the sparse matrix, with the
    requested memory order. If `out` was passed and was an
    array (rather than a `numpy.matrix`), it will be filled
    with the appropriate values and returned wrapped in a
    `numpy.matrix` object that shares the same memory.
)supertodense)r
   orderout	__class__s      r   rt   spmatrix.todense~   s    < wu**r   c                    SSK Jn  U" X5      $ )aU  
Return a parametrized wrapper around the `~scipy.sparse.spmatrix` type.

.. versionadded:: 1.16.0

Returns
-------
alias : types.GenericAlias
    A parametrized `~scipy.sparse.spmatrix` type.

Examples
--------
>>> import numpy as np
>>> from scipy.sparse import coo_matrix

>>> coo_matrix[np.int8]
scipy.sparse._coo.coo_matrix[numpy.int8]
    )GenericAlias)typesr{   )clsargr{   s      r   __class_getitem__spmatrix.__class_getitem__   s    ( 	'C%%r   )rD   r/   )NN)#__name__
__module____qualname____firstlineno____doc__r   tupleint__annotations__propertyr   r   r   r   r"   r'   r,   r3   r7   r=   rG   rL   rE   rT   rX   r[   r`   re   rj   rp   rt   classmethodr   __static_attributes____classcell__)rw   s   @r   r   r      s    "&IuS#X%             
,-)* )).0E #	',+@ & &r   r   N)r    r   r   <module>r      s   r& r&r   