L iGddZy)ceZdZdZdZedZedZedZedZ edZ edZ ed Z d Z d Zd Zd ZdZeeedZdZdZdZddZdZdZdZdfd ZedZxZS)spmatrixzThis class provides a base class for all sparse matrix classes. It cannot be instantiated. Most of the work is provided by subclasses. )cddlm}|S)N) bsr_matrix)_bsrr)selfrs Z/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/scipy/sparse/_matrix.py_bsr_containerzspmatrix._bsr_container $cddlm}|S)Nr) coo_matrix)_coor)r rs r _coo_containerzspmatrix._coo_container r r cddlm}|S)Nr) csc_matrix)_cscr)r rs r _csc_containerzspmatrix._csc_containerr r cddlm}|S)Nr) csr_matrix)_csrr)r rs r _csr_containerzspmatrix._csr_containerr r cddlm}|S)Nr) dia_matrix)_diar)r rs r _dia_containerzspmatrix._dia_containerr r cddlm}|S)Nr) dok_matrix)_dokr)r rs r _dok_containerzspmatrix._dok_container!r r cddlm}|S)Nr) lil_matrix)_lilr#)r r#s r _lil_containerzspmatrix._lil_container&r r c$|j|SN)_matmul_dispatchr others r __mul__zspmatrix.__mul__,s$$U++r c$|j|Sr')_rmatmul_dispatchr)s r __rmul__zspmatrix.__rmul__/s%%e,,r c ddlm}|||S)Nr) matrix_power)linalgr0)r powerr0s r __pow__zspmatrix.__pow__3s(D%((r c~|j|dj|j}|j|_y)z$Set the shape of the matrix in-placeF)copyN)reshapeasformatformat__dict__)r shapenew_selfs r set_shapezspmatrix.set_shape:s2<<E<2;;DKKH )) r c|jS)zGet the shape of the matrix)_shaper s r get_shapezspmatrix.get_shapeA {{r zShape of the matrix)fgetfsetdocc"|jS)z7Upcast matrix to a floating point format (if necessary)) _asfptyper?s r asfptypezspmatrix.asfptypeHs~~r c"|jS)z3Maximum number of elements to display when printed.) _getmaxprintr?s r getmaxprintzspmatrix.getmaxprintLs  ""r c|jS)zMatrix storage format)r8r?s r getformatzspmatrix.getformatPrAr c&|j|S)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 rNs r getnnzzspmatrix.getnnzTs|||&&r c>|jjS)zReturn the Hermitian transpose of this matrix. See Also -------- numpy.matrix.getH : NumPy's implementation of `getH` for matrices ) conjugate transposer?s r getHz spmatrix.getH_s~~))++r c$|j|S)zgReturns a copy of column j of the matrix, as an (m x 1) sparse matrix (column vector). )_getcol)r js r getcolzspmatrix.getcolh||Ar c$|j|S)z`Returns a copy of row i of the matrix, as a (1 x n) sparse matrix (row vector). )_getrow)r is r getrowzspmatrix.getrownrYr c$t|||S)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. )supertodense)r orderout __class__s r r`zspmatrix.todensets<wuc**r c ddlm}|||S)a 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)typesrf)clsargrfs r __class_getitem__zspmatrix.__class_getitem__s( 'C%%r r')NN)__name__ __module__ __qualname____doc__ _allow_ndpropertyr rrrrr!r%r+r.r3r<r@r:rGrJrLrPrTrXr]r` classmethodrj __classcell__)rcs@r rrsI  ,-)* )). 0E # ',  +@&&r rN)rr r rtsh&h&r