§ <ˆjÀwãó —gd¢ZddlZddlZddlZddlmZddlmcmZ ddlm Z m Z ddl m Z d„Zed¦«dd „¦«Zed¦«Gd „d e j¦«¦«Zd „Zed¦«dd „¦«ZeZdS))ÚmatrixÚbmatÚmatÚasmatrixéNé)Ú set_module)Ú concatenateÚisscalar©Ú matrix_powercóÖ—dD]}| |d¦«}Œ| d¦«}g}d}|D]±}| d¦«}g}|D]C}| ¦«} | ttj| ¦«¦«ŒD|dkrt |¦«} n"t |¦«| krtd¦«‚|dz }| |¦«Œ²|S)Nz[]Úú;rú,zRows not the same size.é) ÚreplaceÚsplitÚextendÚmapÚastÚ literal_evalÚlenÚ ValueErrorÚappend) ÚdataÚcharÚrowsÚnewdataÚcountÚrowÚtrowÚnewrowÚcolÚtempÚNcolss úP/opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/matrixlib/defmatrix.pyÚ_convert_from_stringr'sù€Øð&ð&ˆØ�|Š|˜D "Ñ%Ô%ˆˆà �:Š:�c‰?Œ?€DØ€GØ €EØð ð ˆØ�yŠy˜‰~Œ~ˆØˆØð 7ð 7ˆCØ—9’9‘;”;ˆDØ �MŠM�#�cÔ.°Ñ5Ô5Ñ 6Ô 6Ð 6Ð 6Ø �AŠ:ˆ:ݘ‘K”KˆEˆEÝ �‰[Œ[˜EÒ !Ð !ÝÐ6Ñ7Ô7Ð 7Ø �‰ ˆØ�Š�vÑÔÐÐØ €NóÚnumpycó&—t||d¬¦«S)a@ Interpret the input as a matrix. Unlike `matrix`, `asmatrix` does not make a copy if the input is already a matrix or an ndarray. Equivalent to ``matrix(data, copy=False)``. Parameters ---------- data : array_like Input data. dtype : data-type Data-type of the output matrix. Returns ------- mat : matrix `data` interpreted as a matrix. Examples -------- >>> x = np.array([[1, 2], [3, 4]]) >>> m = np.asmatrix(x) >>> x[0,0] = 5 >>> m matrix([[5, 2], [3, 4]]) F©ÚdtypeÚcopy)r)rr,s r&rr%s€õB �$˜e¨%Ð 0Ñ 0Ô 0Ð0r(cóŒ—eZdZdZdZd'd„Zd„Zd„Zd„Zd „Z d „Z d „Z d „Z d „Z d„Zd„Zd„Zd(d„Zd)d„Zd*d„Zd(d„Zd+d„Zd+d„Zd(d„Zd,d„Zd,d„Zd,d„Zd,d„Zd,d„Zd,d„Zd,d „Zed!„¦«Z ed"„¦«Z!ed#„¦«Z"d*d$„Z#ed%„¦«Z$ed&„¦«Z%e$j&Z'e!j&Z(e"j&Z)e%j&Z*e j&Z+dS)-raŽ matrix(data, dtype=None, copy=True) .. note:: It is no longer recommended to use this class, even for linear algebra. Instead use regular arrays. The class may be removed in the future. Returns a matrix from an array-like object, or from a string of data. A matrix is a specialized 2-D array that retains its 2-D nature through operations. It has certain special operators, such as ``*`` (matrix multiplication) and ``**`` (matrix power). Parameters ---------- data : array_like or string If `data` is a string, it is interpreted as a matrix with commas or spaces separating columns, and semicolons separating rows. dtype : data-type Data-type of the output matrix. copy : bool If `data` is already an `ndarray`, then this flag determines whether the data is copied (the default), or whether a view is constructed. See Also -------- array Examples -------- >>> a = np.matrix('1 2; 3 4') >>> a matrix([[1, 2], [3, 4]]) >>> np.matrix([[1, 2], [3, 4]]) matrix([[1, 2], [3, 4]]) g$@NTcóv—tjdtd¬¦«t|t¦«r*|j}|€|}||kr|s|S| |¦«St|tj¦«rk|€|j}ntj|¦«}|  |¦«}||jkr| |¦«S|r|  ¦«S|St|t¦«rt|¦«}tj |||¬¦«}|j}|j} |dkrt!d¦«‚|dkrd} n|dkr d| df} d } |dkr|jjrd } | s |jjs|  ¦«}tj || |j|| ¬ ¦«} | S) NzÙthe matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.r)Ú stacklevelr+zmatrix must be 2-dimensionalr©rrrÚCÚF)ÚbufferÚorder)ÚwarningsÚwarnÚPendingDeprecationWarningÚ isinstancerr,ÚastypeÚNÚndarrayÚviewr-Ústrr'ÚarrayÚndimÚshaperÚflagsÚfortranÚ contiguousÚ__new__) Úsubtyperr,r-Údtype2ÚintypeÚnewÚarrr@rAr5Úrets r&rEzmatrix.__new__tsۀ݌ ðHõ 0¸Að  ?ñ ?ô ?ð ?õ �d�FÑ #Ô #ð &Ø”ZˆFØ� Ø�ؘ%’�¨$�Ø� Ø—;’;˜uÑ%Ô%Ð %å �d�AœIÑ &Ô &ð Øˆ}Øœ��圠™œ�Ø—)’)˜GÑ$Ô$ˆCؘœÒ#Ð#Ø—z’z &Ñ)Ô)Ð)Øð ˜CŸHšH™JœJÐ&Ø�*å �d�CÑ Ô ð .Ý'¨Ñ-Ô-ˆDõŒg�d %¨dÐ3Ñ3Ô3ˆØŒxˆØ” ˆØ �1ŠHˆHÝÐ;Ñ<Ô<Ð <Ø �QŠYˆY؈EˆEØ �QŠYˆYؘ˜aœ�MˆEàˆØ �AŠIˆI˜3œ9Ô,ˆI؈Eà𠘜Ô-ð Ø—(’(‘*”*ˆCåŒi×Ò ¨°´ Ø'*Ø&+ð ñ-ô-ˆðˆ r(cór—d|_t|t¦«r |jrdS|j}|dkrdS|dkrRt d„|jD¦«¦«}t |¦«}|dkr ||_dS|dkrtd¦«‚n|j}|dkrd|_n|dkrd|df|_dS)NFrcó—g|] }|dk¯|‘Œ S)r©)Ú.0Úxs r&ú z-matrix.__array_finalize__..¯s€Ð=Ð=Ð= A°q¸1²u°u˜a°u°u°ur(zshape too large to be a matrix.rr1r)Ú_getitemr9rr@ÚtuplerArr)ÚselfÚobjr@Únewshapes r&Ú__array_finalize__zmatrix.__array_finalize__¨sր؈Œ Ý �s�FÑ #Ô #Ð=¨¬ Ð=°v°vØŒyˆØ �AŠIˆIØ ˆFØ �1ŠHˆHÝÐ=Ð=¨¬Ð=Ñ=Ô=Ñ>Ô>ˆHÝ�x‘=”=ˆDØ�qŠyˆyØ%�” Ø�ؘ’(�(Ý Ð!BÑCÔCÐCðð”zˆHØ �1Š9ˆ9؈DŒJˆJØ �QŠYˆYؘX aœ[Ð)ˆDŒJ؈r(có®—d|_ tj ||¦«}d|_n #d|_wxYwt |tj¦«s|S|jdkr|dS|jdkr^|jd} t|¦«}n#t$rd}YnwxYw|dkrt|d¦«r |df|_n d|f|_|S)NTFrrNr) rRr;r<Ú __getitem__r9r@rArÚ Exceptionr )rTÚindexÚoutÚshÚns r&rYzmatrix.__getitem__¾sð€ØˆŒ ð "Ý”)×'Ò'¨¨eÑ4Ô4ˆCà!ˆDŒMˆMø˜EˆDŒMÐ !Ð !Ð !Ð !å˜#�qœyÑ)Ô)ð ØˆJà Œ8�qŠ=ˆ=Ø�r”7ˆNØ Œ8�qŠ=ˆ=Ø”˜1”ˆBð ݘ‘J”J��øÝð ð ð Ø���ð øøøà�1Šuˆu� %¨¤(Ñ+Ô+ˆuØ ˜G�” � à ˜G�” ؈ s‰ 1± :ÂB B$Â#B$có —t|tjttf¦«r"tj|t |¦«¦«St|¦«st|d¦«stj||¦«StS)NÚ__rmul__) r9r;r<ÚlistrSÚdotrr ÚhasattrÚNotImplemented©rTÚothers r&Ú__mul__zmatrix.__mul__Øsl€Ý �e�aœi­­uÐ5Ñ 6Ô 6ð 0å”5˜�x¨™œÑ/Ô/Ð /Ý �E‰?Œ?ð &¥'¨%°Ñ"<Ô"<ð &Ý”5˜˜uÑ%Ô%Ð %ÝÐr(có,—tj||¦«S©N)r;rbres r&r`zmatrix.__rmul__às€ÝŒu�U˜DÑ!Ô!Ð!r(có—||z|dd…<|SrirNres r&Ú__imul__zmatrix.__imul__ãs€Ø˜‘,ˆˆQˆQˆQ‰Øˆ r(có"—t||¦«Srir res r&Ú__pow__zmatrix.__pow__çs€Ý˜D %Ñ(Ô(Ð(r(có—||z|dd…<|SrirNres r&Ú__ipow__zmatrix.__ipow__ês€Ø˜%‘-ˆˆQˆQˆQ‰Øˆ r(có—tSri)rdres r&Ú__rpow__zmatrix.__rpow__îs€ÝÐr(cóx—|€|dS|dkr|S|dkr| ¦«Std¦«‚)z^A convenience function for operations that need to preserve axis orientation. N©rrrrzunsupported axis)Ú transposer©rTÚaxiss r&Ú_alignz matrix._alignñsI€ð ˆ<ؘ”:Ð Ø �1ŠWˆW؈KØ �1ŠWˆWØ—>’>Ñ#Ô#Ð #åÐ/Ñ0Ô0Ð 0r(có—|€|dS|S)z�A convenience function for operations that want to collapse to a scalar like _align, but are using keepdims=True NrsrNrus r&Ú _collapsezmatrix._collapseþs€ð ˆ<ؘ”:Ð àˆKr(cóN—| ¦« ¦«S)a Return the matrix as a (possibly nested) list. See `ndarray.tolist` for full documentation. See Also -------- ndarray.tolist Examples -------- >>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.tolist() [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]] )Ú __array__Útolist©rTs r&r|z matrix.tolist s €ð(�~Š~ÑÔ×&Ò&Ñ(Ô(Ð(r(cóp—tj ||||d¬¦« |¦«S)a  Returns the sum of the matrix elements, along the given axis. Refer to `numpy.sum` for full documentation. See Also -------- numpy.sum Notes ----- This is the same as `ndarray.sum`, except that where an `ndarray` would be returned, a `matrix` object is returned instead. Examples -------- >>> x = np.matrix([[1, 2], [4, 3]]) >>> x.sum() 10 >>> x.sum(axis=1) matrix([[3], [7]]) >>> x.sum(axis=1, dtype='float') matrix([[3.], [7.]]) >>> out = np.zeros((2, 1), dtype='float') >>> x.sum(axis=1, dtype='float', out=np.asmatrix(out)) matrix([[3.], [7.]]) T©Úkeepdims)r;r<Úsumry©rTrvr,r\s r&r�z matrix.sum s1€õ@Œy�}Š}˜T 4¨°¸dˆ}ÑCÔC×MÒMÈdÑSÔSÐSr(cóD—tj ||¬¦«S)aD Return a possibly reshaped matrix. Refer to `numpy.squeeze` for more documentation. Parameters ---------- axis : None or int or tuple of ints, optional Selects a subset of the axes of length one in the shape. If an axis is selected with shape entry greater than one, an error is raised. Returns ------- squeezed : matrix The matrix, but as a (1, N) matrix if it had shape (N, 1). See Also -------- numpy.squeeze : related function Notes ----- If `m` has a single column then that column is returned as the single row of a matrix. Otherwise `m` is returned. The returned matrix is always either `m` itself or a view into `m`. Supplying an axis keyword argument will not affect the returned matrix but it may cause an error to be raised. Examples -------- >>> c = np.matrix([[1], [2]]) >>> c matrix([[1], [2]]) >>> c.squeeze() matrix([[1, 2]]) >>> r = c.T >>> r matrix([[1, 2]]) >>> r.squeeze() matrix([[1, 2]]) >>> m = np.matrix([[1, 2], [3, 4]]) >>> m.squeeze() matrix([[1, 2], [3, 4]]) ©rv)r;r<Úsqueezerus r&r…zmatrix.squeezeDs €õbŒy× Ò  ¨DÐ Ñ1Ô1Ð1r(r2cóD—tj ||¬¦«S)aD Return a flattened copy of the matrix. All `N` elements of the matrix are placed into a single row. Parameters ---------- order : {'C', 'F', 'A', 'K'}, optional 'C' means to flatten in row-major (C-style) order. 'F' means to flatten in column-major (Fortran-style) order. 'A' means to flatten in column-major order if `m` is Fortran *contiguous* in memory, row-major order otherwise. 'K' means to flatten `m` in the order the elements occur in memory. The default is 'C'. Returns ------- y : matrix A copy of the matrix, flattened to a `(1, N)` matrix where `N` is the number of elements in the original matrix. See Also -------- ravel : Return a flattened array. flat : A 1-D flat iterator over the matrix. Examples -------- >>> m = np.matrix([[1,2], [3,4]]) >>> m.flatten() matrix([[1, 2, 3, 4]]) >>> m.flatten('F') matrix([[1, 3, 2, 4]]) ©r5)r;r<Úflatten©rTr5s r&rˆzmatrix.flattenys €õFŒy× Ò  ¨UÐ Ñ3Ô3Ð3r(cóp—tj ||||d¬¦« |¦«S)aÜ Returns the average of the matrix elements along the given axis. Refer to `numpy.mean` for full documentation. See Also -------- numpy.mean Notes ----- Same as `ndarray.mean` except that, where that returns an `ndarray`, this returns a `matrix` object. Examples -------- >>> x = np.matrix(np.arange(12).reshape((3, 4))) >>> x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.mean() 5.5 >>> x.mean(0) matrix([[4., 5., 6., 7.]]) >>> x.mean(1) matrix([[ 1.5], [ 5.5], [ 9.5]]) Tr)r;r<Úmeanryr‚s r&r‹z matrix.meanžs1€õ@Œy�~Š~˜d D¨%°¸tˆ~ÑDÔD×NÒNÈtÑTÔTÐTr(rcór—tj |||||d¬¦« |¦«S)aU Return the standard deviation of the array elements along the given axis. Refer to `numpy.std` for full documentation. See Also -------- numpy.std Notes ----- This is the same as `ndarray.std`, except that where an `ndarray` would be returned, a `matrix` object is returned instead. Examples -------- >>> x = np.matrix(np.arange(12).reshape((3, 4))) >>> x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.std() 3.4520525295346629 # may vary >>> x.std(0) matrix([[ 3.26598632, 3.26598632, 3.26598632, 3.26598632]]) # may vary >>> x.std(1) matrix([[ 1.11803399], [ 1.11803399], [ 1.11803399]]) Tr)r;r<Ústdry©rTrvr,r\Úddofs r&r�z matrix.stdÀó4€õ@Œy�}Š}˜T 4¨°°TÀDˆ}ÑIÔI×SÒSÐTXÑYÔYÐYr(cór—tj |||||d¬¦« |¦«S)a2 Returns the variance of the matrix elements, along the given axis. Refer to `numpy.var` for full documentation. See Also -------- numpy.var Notes ----- This is the same as `ndarray.var`, except that where an `ndarray` would be returned, a `matrix` object is returned instead. Examples -------- >>> x = np.matrix(np.arange(12).reshape((3, 4))) >>> x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.var() 11.916666666666666 >>> x.var(0) matrix([[ 10.66666667, 10.66666667, 10.66666667, 10.66666667]]) # may vary >>> x.var(1) matrix([[1.25], [1.25], [1.25]]) Tr)r;r<ÚvarryrŽs r&r’z matrix.varâr�r(cóp—tj ||||d¬¦« |¦«S)aÕ Return the product of the array elements over the given axis. Refer to `prod` for full documentation. See Also -------- prod, ndarray.prod Notes ----- Same as `ndarray.prod`, except, where that returns an `ndarray`, this returns a `matrix` object instead. Examples -------- >>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.prod() 0 >>> x.prod(0) matrix([[ 0, 45, 120, 231]]) >>> x.prod(1) matrix([[ 0], [ 840], [7920]]) Tr)r;r<Úprodryr‚s r&r”z matrix.prods0€õ>Œy�~Š~˜d D¨%°¸tˆ~ÑDÔD×NÒNÈtÑTÔTÐTr(cón—tj |||d¬¦« |¦«S)aG Test whether any array element along a given axis evaluates to True. Refer to `numpy.any` for full documentation. Parameters ---------- axis : int, optional Axis along which logical OR is performed out : ndarray, optional Output to existing array instead of creating new one, must have same shape as expected output Returns ------- any : bool, ndarray Returns a single bool if `axis` is ``None``; otherwise, returns `ndarray` Tr)r;r<Úanyry©rTrvr\s r&r–z matrix.any%s.€õ*Œy�}Š}˜T 4¨°tˆ}Ñ<Ô<×FÒFÀtÑLÔLÐLr(cón—tj |||d¬¦« |¦«S)aÈ Test whether all matrix elements along a given axis evaluate to True. Parameters ---------- See `numpy.all` for complete descriptions See Also -------- numpy.all Notes ----- This is the same as `ndarray.all`, but it returns a `matrix` object. Examples -------- >>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> y = x[0]; y matrix([[0, 1, 2, 3]]) >>> (x == y) matrix([[ True, True, True, True], [False, False, False, False], [False, False, False, False]]) >>> (x == y).all() False >>> (x == y).all(0) matrix([[False, False, False, False]]) >>> (x == y).all(1) matrix([[ True], [False], [False]]) Tr)r;r<Úallryr—s r&r™z matrix.all<s/€õLŒy�}Š}˜T 4¨°tˆ}Ñ<Ô<×FÒFÀtÑLÔLÐLr(cón—tj |||d¬¦« |¦«S)aÚ Return the maximum value along an axis. Parameters ---------- See `amax` for complete descriptions See Also -------- amax, ndarray.max Notes ----- This is the same as `ndarray.max`, but returns a `matrix` object where `ndarray.max` would return an ndarray. Examples -------- >>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.max() 11 >>> x.max(0) matrix([[ 8, 9, 10, 11]]) >>> x.max(1) matrix([[ 3], [ 7], [11]]) Tr)r;r<Úmaxryr—s r&r›z matrix.maxdó/€õBŒy�}Š}˜T 4¨°tˆ}Ñ<Ô<×FÒFÀtÑLÔLÐLr(cój—tj |||¦« |¦«S)aš Indexes of the maximum values along an axis. Return the indexes of the first occurrences of the maximum values along the specified axis. If axis is None, the index is for the flattened matrix. Parameters ---------- See `numpy.argmax` for complete descriptions See Also -------- numpy.argmax Notes ----- This is the same as `ndarray.argmax`, but returns a `matrix` object where `ndarray.argmax` would return an `ndarray`. Examples -------- >>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.argmax() 11 >>> x.argmax(0) matrix([[2, 2, 2, 2]]) >>> x.argmax(1) matrix([[3], [3], [3]]) )r;r<Úargmaxrwr—s r&ržz matrix.argmax‡ó-€õJŒy×Ò  d¨CÑ0Ô0×7Ò7¸Ñ=Ô=Ð=r(cón—tj |||d¬¦« |¦«S)að Return the minimum value along an axis. Parameters ---------- See `amin` for complete descriptions. See Also -------- amin, ndarray.min Notes ----- This is the same as `ndarray.min`, but returns a `matrix` object where `ndarray.min` would return an ndarray. Examples -------- >>> x = -np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, -1, -2, -3], [ -4, -5, -6, -7], [ -8, -9, -10, -11]]) >>> x.min() -11 >>> x.min(0) matrix([[ -8, -9, -10, -11]]) >>> x.min(1) matrix([[ -3], [ -7], [-11]]) Tr)r;r<Úminryr—s r&r¡z matrix.min®rœr(cój—tj |||¦« |¦«S)a¨ Indexes of the minimum values along an axis. Return the indexes of the first occurrences of the minimum values along the specified axis. If axis is None, the index is for the flattened matrix. Parameters ---------- See `numpy.argmin` for complete descriptions. See Also -------- numpy.argmin Notes ----- This is the same as `ndarray.argmin`, but returns a `matrix` object where `ndarray.argmin` would return an `ndarray`. Examples -------- >>> x = -np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, -1, -2, -3], [ -4, -5, -6, -7], [ -8, -9, -10, -11]]) >>> x.argmin() 11 >>> x.argmin(0) matrix([[2, 2, 2, 2]]) >>> x.argmin(1) matrix([[3], [3], [3]]) )r;r<Úargminrwr—s r&r£z matrix.argminÑrŸr(cój—tj |||¦« |¦«S)aÀ Peak-to-peak (maximum - minimum) value along the given axis. Refer to `numpy.ptp` for full documentation. See Also -------- numpy.ptp Notes ----- Same as `ndarray.ptp`, except, where that would return an `ndarray` object, this returns a `matrix` object. Examples -------- >>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.ptp() 11 >>> x.ptp(0) matrix([[8, 8, 8, 8]]) >>> x.ptp(1) matrix([[3], [3], [3]]) )r;r<Úptprwr—s r&r¥z matrix.ptpøs*€õ>Œy�}Š}˜T 4¨Ñ-Ô-×4Ò4°TÑ:Ô:Ð:r(cól—|j\}}||krddlm}nddlm}t ||¦«¦«S)aI Returns the (multiplicative) inverse of invertible `self`. Parameters ---------- None Returns ------- ret : matrix object If `self` is non-singular, `ret` is such that ``ret * self`` == ``self * ret`` == ``np.matrix(np.eye(self[0,:].size))`` all return ``True``. Raises ------ numpy.linalg.LinAlgError: Singular matrix If `self` is singular. See Also -------- linalg.inv Examples -------- >>> m = np.matrix('[1, 2; 3, 4]'); m matrix([[1, 2], [3, 4]]) >>> m.getI() matrix([[-2. , 1. ], [ 1.5, -0.5]]) >>> m.getI() * m matrix([[ 1., 0.], # may vary [ 0., 1.]]) r)Úinv)Úpinv)rAÚ numpy.linalgr§r¨r)rTÚMr;Úfuncs r&ÚIzmatrix.IsV€ðLŒz‰ˆˆ1Ø �Š6ˆ6Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0à 1Ð 1Ð 1Ð 1Ð 1Ð 1ݘ˜˜T™ œ Ñ#Ô#Ð#r(có*—| ¦«S)a1 Return `self` as an `ndarray` object. Equivalent to ``np.asarray(self)``. Parameters ---------- None Returns ------- ret : ndarray `self` as an `ndarray` Examples -------- >>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.getA() array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) )r{r}s r&ÚAzmatrix.AFs€ð8�~Š~ÑÔÐr(cóN—| ¦« ¦«S)a Return `self` as a flattened `ndarray`. Equivalent to ``np.asarray(x).ravel()`` Parameters ---------- None Returns ------- ret : ndarray `self`, 1-D, as an `ndarray` Examples -------- >>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.getA1() array([ 0, 1, 2, ..., 9, 10, 11]) )r{Úravelr}s r&ÚA1z matrix.A1ds €ð6�~Š~ÑÔ×%Ò%Ñ'Ô'Ð'r(cóD—tj ||¬¦«S)a  Return a flattened matrix. Refer to `numpy.ravel` for more documentation. Parameters ---------- order : {'C', 'F', 'A', 'K'}, optional The elements of `m` are read using this index order. 'C' means to index the elements in C-like order, with the last axis index changing fastest, back to the first axis index changing slowest. 'F' means to index the elements in Fortran-like index order, with the first index changing fastest, and the last index changing slowest. Note that the 'C' and 'F' options take no account of the memory layout of the underlying array, and only refer to the order of axis indexing. 'A' means to read the elements in Fortran-like index order if `m` is Fortran *contiguous* in memory, C-like order otherwise. 'K' means to read the elements in the order they occur in memory, except for reversing the data when strides are negative. By default, 'C' index order is used. Returns ------- ret : matrix Return the matrix flattened to shape `(1, N)` where `N` is the number of elements in the original matrix. A copy is made only if necessary. See Also -------- matrix.flatten : returns a similar output matrix but always a copy matrix.flat : a flat iterator on the array. numpy.ravel : related function which returns an ndarray r‡)r;r<r°r‰s r&r°z matrix.ravel‚s€õHŒy�Š˜t¨5ˆÑ1Ô1Ð1r(có*—| ¦«S)a@ Returns the transpose of the matrix. Does *not* conjugate! For the complex conjugate transpose, use ``.H``. Parameters ---------- None Returns ------- ret : matrix object The (non-conjugated) transpose of the matrix. See Also -------- transpose, getH Examples -------- >>> m = np.matrix('[1, 2; 3, 4]') >>> m matrix([[1, 2], [3, 4]]) >>> m.getT() matrix([[1, 3], [2, 4]]) )rtr}s r&ÚTzmatrix.T¨s€ð>�~Š~ÑÔÐr(có¾—t|jjtj¦«r&| ¦« ¦«S| ¦«S)a: Returns the (complex) conjugate transpose of `self`. Equivalent to ``np.transpose(self)`` if `self` is real-valued. Parameters ---------- None Returns ------- ret : matrix object complex conjugate transpose of `self` Examples -------- >>> x = np.matrix(np.arange(12).reshape((3,4))) >>> z = x - 1j*x; z matrix([[ 0. +0.j, 1. -1.j, 2. -2.j, 3. -3.j], [ 4. -4.j, 5. -5.j, 6. -6.j, 7. -7.j], [ 8. -8.j, 9. -9.j, 10.-10.j, 11.-11.j]]) >>> z.getH() matrix([[ 0. -0.j, 4. +4.j, 8. +8.j], [ 1. +1.j, 5. +5.j, 9. +9.j], [ 2. +2.j, 6. +6.j, 10.+10.j], [ 3. +3.j, 7. +7.j, 11.+11.j]]) )Ú issubclassr,Útyper;ÚcomplexfloatingrtÚ conjugater}s r&ÚHzmatrix.HÉsI€õ< �d”j”o¥qÔ'8Ñ 9Ô 9ð $Ø—>’>Ñ#Ô#×-Ò-Ñ/Ô/Ð /à—>’>Ñ#Ô#Ð #r()NT)NNNri)r2)NNNr©NN),Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú__array_priority__rErWrYrgr`rkrmrorqrwryr|r�r…rˆr‹r�r’r”r–r™r›ržr¡r£r¥Úpropertyr¬r®r±r°r´rºÚfgetÚgetTÚgetAÚgetA1ÚgetHÚgetIrNr(r&rrIs耀€€€ð'ð'ðPÐð2ð2ð2ð2ðhððð,ððð4ððð"ð"ð"ðððð)ð)ð)ððððððð 1ð 1ð 1ðððð)ð)ð)ð. Tð Tð Tð TðH12ð12ð12ð12ðj#4ð#4ð#4ð#4ðJ Uð Uð Uð UðD Zð Zð Zð ZðD Zð Zð Zð ZðDUðUðUðUðBMðMðMðMð.&Mð&Mð&Mð&MðP!Mð!Mð!Mð!MðF%>ð%>ð%>ð%>ðN!Mð!Mð!Mð!MðF%>ð%>ð%>ð%>ðN;ð;ð;ð;ðBð*$ð*$ñ„Xð*$ðXð ð ñ„Xð ð:ð(ð(ñ„Xð(ð:$2ð$2ð$2ð$2ðLð ð ñ„Xð ð@ð $ð $ñ„Xð $ðF Œ6€DØ Œ6€DØ ŒG€EØ Œ6€DØ Œ6€D€D€Dr(rc ó"—| d¦«}g}|D]å}| d¦«}g}|D])}| | ¦«¦«Œ*|}g} |D]u} |  ¦«} || } n@#t$r3 || } n&#t$r} t d| ›d�¦«d‚d} ~ wwxYwYnwxYw|  | ¦«Œv| t | d¬¦«¦«Œæt |d¬¦«S)Nrrzname z is not definedéÿÿÿÿr„r)rrÚstripÚKeyErrorÚ NameErrorrr ) r>ÚgdictÚldictrÚrowtupr r!r"rPÚcoltupr#ÚthismatÚes r&Ú _from_stringrÓós^€Ø �9Š9�S‰>Œ>€DØ €FØð4ð4ˆØ�yŠy˜‰~Œ~ˆØˆØð %ð %ˆAØ �MŠM˜!Ÿ'š'™)œ)Ñ $Ô $Ð $Ð $؈؈Øð #ð #ˆCØ—)’)‘+”+ˆCð NØ œ*��øÝð Nð Nð NðNØ# Cœj�G�GøÝðNðNðNÝ#Ð$B¨CÐ$BÐ$BÐ$BÑCÔCÈÐMøøøøðNøøøð�Gð Nøøøð �MŠM˜'Ñ "Ô "Ð "Ð "Ø� Š •k &¨rÐ2Ñ2Ô2Ñ3Ô3Ð3Ð3Ý �v AÐ &Ñ &Ô &Ð&s6Á<B CÂBÂC B< Â#B7 Â7B< Â<CÃCcóV—t|t¦«rK|€'tj¦«j}|j}|j}n|}|}tt|||¦«¦«St|ttf¦«rƒg}|D]`}t|tj ¦«r tt|d¬¦«¦«cS| t|d¬¦«¦«Œatt|d¬¦«¦«St|tj ¦«rt|¦«SdS)aˆ Build a matrix object from a string, nested sequence, or array. Parameters ---------- obj : str or array_like Input data. If a string, variables in the current scope may be referenced by name. ldict : dict, optional A dictionary that replaces local operands in current frame. Ignored if `obj` is not a string or `gdict` is None. gdict : dict, optional A dictionary that replaces global operands in current frame. Ignored if `obj` is not a string. Returns ------- out : matrix Returns a matrix object, which is a specialized 2-D array. See Also -------- block : A generalization of this function for N-d arrays, that returns normal ndarrays. Examples -------- >>> A = np.mat('1 1; 1 1') >>> B = np.mat('2 2; 2 2') >>> C = np.mat('3 4; 5 6') >>> D = np.mat('7 8; 9 0') All the following expressions construct the same block matrix: >>> np.bmat([[A, B], [C, D]]) matrix([[1, 1, 2, 2], [1, 1, 2, 2], [3, 4, 7, 8], [5, 6, 9, 0]]) >>> np.bmat(np.r_[np.c_[A, B], np.c_[C, D]]) matrix([[1, 1, 2, 2], [1, 1, 2, 2], [3, 4, 7, 8], [5, 6, 9, 0]]) >>> np.bmat('A,B; C,D') matrix([[1, 1, 2, 2], [1, 1, 2, 2], [3, 4, 7, 8], [5, 6, 9, 0]]) NrÉr„r)r9r>ÚsysÚ _getframeÚf_backÚ f_globalsÚf_localsrrÓrSrar;r<r r)rUrÎrÍÚframeÚ glob_dictÚloc_dictÚarr_rowsr s r&rr s$€õl�#•sÑÔð >Ø ˆ=å”M‘O”OÔ*ˆEØœˆIØ”~ˆHˆHàˆI؈Hå•l 3¨ °8Ñ<Ô<Ñ=Ô=Ð=å�#��t�}Ñ%Ô%ð5àˆØð ;ð ;ˆCݘ#�qœyÑ)Ô)ð ;Ý�k¨#°BÐ7Ñ7Ô7Ñ8Ô8Ð8Ð8Ð8à—’¥ ¨C°bÐ 9Ñ 9Ô 9Ñ:Ô:Ð:Ð:Ý•k (°Ð3Ñ3Ô3Ñ4Ô4Ð4Ý�#•q”yÑ!Ô!ðÝ�c‰{Œ{Ðððr(rir»)Ú__all__rÕr6rÚ_utilsrÚnumpy.core.numericÚcoreÚnumericr;r r r©r r'rr<rrÓrrrNr(r&úrãsUðØ /Ð /Ð /€à € € € Ø€€€Ø € € € àÐÐÐÐÐØÐÐÐÐÐÐÐÐØ4Ð4Ð4Ð4Ð4Ð4Ð4Ð4ð&Ð%Ð%Ð%Ð%Ð%ðððð, €ˆGÑÔð 1ð 1ð 1ñÔð 1ðF €ˆGÑÔðgðgðgðgðgˆQŒYñgôgñÔðgðR'ð'ð'ð2 €ˆGÑÔðKðKðKñÔðKðZ€€€r(