Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
defmatrix.cpython-313.pyc833 linesDownload Raw Back to __pycache__
1�

2z�j�|����/SQrSSKrSSKrSSKrSSKJs Jr SSKJrJ	r	 SSK3Jr SSKJ
r
 Sr\"S5S
Sj5r\"S5"S	S4\R 55rSr\"S5SSj5rg))�matrix�bmat�asmatrix�N)�concatenate�isscalar)�5set_module��matrix_powerc��SHnURUS5nM URS5n/n[U5H�upEURS5n/nUH<nUR5n	UR[	[6RU	55 M> US:Xa[U5n7O[U5W8:wa[S5eURU5 M� U$)Nz[]��;�,rzRows not the same size.)9�replace�split�	enumerate�extend�map�ast�literal_eval�len�10ValueError�append)�data�char�rows�newdata�count�row�trow�newrow�col�temp�Ncolss           �_D:\code\apps\devtools\python\user_packages\Python313\site-packages\numpy/matrixlib/defmatrix.py�_convert_from_stringr%s������|�|�D�"�%����:�:�c�?�D��G���o�11���y�y��~�����C��9�9�;�D��M�M�#�c�.�.��5�6���A�:���K�E�
��[�E�
!��6�7�7����v��&��N��numpyc��[XSS9$)a�12Interpret the input as a matrix.13 14Unlike `matrix`, `asmatrix` does not make a copy if the input is already15a matrix or an ndarray.  Equivalent to ``matrix(data, copy=False)``.16 17Parameters18----------19data : array_like20    Input data.21dtype : data-type22   Data-type of the output matrix.23 24Returns25-------26mat : matrix27    `data` interpreted as a matrix.28 29Examples30--------31>>> import numpy as np32>>> x = np.array([[1, 2], [3, 4]])33 34>>> m = np.asmatrix(x)35 36>>> x[0,0] = 537 38>>> m39matrix([[5, 2],40        [3, 4]])41 42F��dtype�copy)r)rr*s  r$rr$s��D�$�%�0�0r&c���\rSrSrSrSrS&SjrSrSrSr	S	r43S44rSrSr
S
rSrSrSrS'SjrS(SjrS)SjrS'SjrS*SjrS*SjrS'SjrS+SjrS+SjrS+SjrS+SjrS+SjrS+SjrS+Sjr\ S5r!\ S 5r"\ S!5r#S)S"jr$\ S#5r%\ S$5r&\%RNr(\"RNr)\#RNr*\&RNr+\!RNr,S%r-g),r�Ia&45matrix(data, dtype=None, copy=True)46 47Returns a matrix from an array-like object, or from a string of data.48 49A matrix is a specialized 2-D array that retains its 2-D nature50through operations.  It has certain special operators, such as ``*``51(matrix multiplication) and ``**`` (matrix power).52 53.. note:: It is no longer recommended to use this class, even for linear54          algebra. Instead use regular arrays. The class may be removed55          in the future.56 57Parameters58----------59data : array_like or string60   If `data` is a string, it is interpreted as a matrix with commas61   or spaces separating columns, and semicolons separating rows.62dtype : data-type63   Data-type of the output matrix.64copy : bool65   If `data` is already an `ndarray`, then this flag determines66   whether the data is copied (the default), or whether a view is67   constructed.68 69See Also70--------71array72 73Examples74--------75>>> import numpy as np76>>> a = np.matrix('1 2; 3 4')77>>> a78matrix([[1, 2],79        [3, 4]])80 81>>> np.matrix([[1, 2], [3, 4]])82matrix([[1, 2],83        [3, 4]])84 85g$@Nc���[R"S[SS9 [U[5(a0UR86nUcUnXB:Xa	U(dU$UR
U5$[U[R5(apUc
UR87nO[R88"U5nURU5nXQR89:waUR
U5$U(aUR5$U$[U[5(a[U5nU(dSOSn[R"XUS9nURnURn	US:�a[!S5eUS:XaSn	O
US	:XaS	U	S4n	S90n91US:XaUR"R$(aSn92U93(d+UR"R&(dUR5n[RR)X	UR94UU95S9nU$)
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.�)�96stacklevelTr)zmatrix must be 2-dimensionalr��r2r2�C�F)�buffer�order)�warnings�warn�PendingDeprecationWarning�97isinstancerr*�astype�N�ndarray�viewr+�strr%�array�ndim�shaper�flags�fortran�98contiguous�__new__)�subtyperr*r+�dtype2�intype�new�arrrArBr6�rets            r$rF�matrix.__new__ws����
�
�H�990�A�	?��d�F�#�#��Z�Z�F��
�����$����;�;�u�%�%��d�A�I�I�&�&��}������������)�)�G�$�C����#��z�z�&�)�)���x�x�z�!��100��d�C� � �'��-�D� �t�T���g�g�d�d�3���x�x���	�	���1�H��;�<�<�
�Q�Y��E�
�Q�Y���a��M�E����A�I�3�9�9�,�,��E�����-�-��(�(�*�C��i�i�����	�	�'*�&+� �-���101r&c�v�SUl[U[5(aUR(agURnUS:XagUS:�aF[	SUR10255n[
U5nUS:XaX0lgUS:�a[S5eOUR103nUS:XaSUlgUS:XaSUS4Ulg)NFr/c3�4# �UHoS:�dM104Uv� M g7f)r2N�)�.0�xs  r$�	<genexpr>�,matrix.__array_finalize__.<locals>.<genexpr>�s���<�105�1�!�e�Q�Q�106�s�	�	zshape too large to be a matrix.rr1r2)�_getitemr:rrA�tuplerBrr)�self�objrA�newshapes    r$�__array_finalize__�matrix.__array_finalize__�s�����
��s�F�#�#������y�y���A�I���1�H��<��107�108�<�<�H��x�=�D��q�y�%�109����(� �!B�C�C���z�z�H��1�9��D�J�	��Q�Y��X�a�[�)�D�J�r&c��SUl[RRX5nSUl[	U[R5(dU$UR110S:XaUS$UR111S:XaHURSn[U5nUS:�a[US5(aUS4UlU$SU4UlU$!SUlf=f![a SnNIf=f)NTFrrPr2)112rUr<r=�__getitem__r:rArBr�	Exceptionr)rW�index�out�sh�ns     r$r]�matrix.__getitem__�s�����
�	"��)�)�'�'��4�C�!�D�M��#�q�y�y�)�)��J��8�8�q�=��r�7�N��8�8�q�=����1��B�
���J���1�u��%��(�+�+���G��	��113���G��	��114��%"�D�M���
���
�s�B?�C�?	C�C�Cc��[U[R[[45(a [R115"U[
U55$[U5(d[US5(d[R116"X5$[$)N�__rmul__)117r:r<r=�listrV�dotrr�hasattr�NotImplemented�rW�others  r$�__mul__�matrix.__mul__�sY���e�a�i�i��u�5�6�6��5�5��x���/�/��E�?�?�'�%��"<�"<��5�5��%�%��r&c�.�[R"X5$�N)r<rgrjs  r$re�matrix.__rmul__�s���u�u�U�!�!r&c��X-USS&U$rorPrjs  r$�__imul__�matrix.__imul__�s���,��Q���r&c��[X5$ror	rjs  r$�__pow__�matrix.__pow__�s
���D�(�(r&c��X-USS&U$rorPrjs  r$�__ipow__�matrix.__ipow__�s���-��Q���r&c��[$ro)rirjs  r$�__rpow__�matrix.__rpow__�s���r&c�d�UcUS$US:XaU$US:XaUR5$[S5e)zNA convenience function for operations that need to preserve axis118orientation.119�rrrr2zunsupported axis)�	transposer�rW�axiss  r$�_align�
matrix._align�s?���<���:��
�Q�Y��K�
�Q�Y��>�>�#�#��/�0�0r&c��UcUS$U$)zqA convenience function for operations that want to collapse120to a scalar like _align, but are using keepdims=True121r~rPr�s  r$�	_collapse�matrix._collapses���<���:���Kr&c�>�UR5R5$)aR122Return the matrix as a (possibly nested) list.123 124See `ndarray.tolist` for full documentation.125 126See Also127--------128ndarray.tolist129 130Examples131--------132>>> x = np.matrix(np.arange(12).reshape((3,4))); x133matrix([[ 0,  1,  2,  3],134        [ 4,  5,  6,  7],135        [ 8,  9, 10, 11]])136>>> x.tolist()137[[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]]138 139)�	__array__�tolist�rWs r$r��
matrix.tolists��(�~�~��&�&�(�(r&c�^�[RRXX#SS9RU5$)aC140Returns the sum of the matrix elements, along the given axis.141 142Refer to `numpy.sum` for full documentation.143 144See Also145--------146numpy.sum147 148Notes149-----150This is the same as `ndarray.sum`, except that where an `ndarray` would151be returned, a `matrix` object is returned instead.152 153Examples154--------155>>> x = np.matrix([[1, 2], [4, 3]])156>>> x.sum()15710158>>> x.sum(axis=1)159matrix([[3],160        [7]])161>>> x.sum(axis=1, dtype='float')162matrix([[3.],163        [7.]])164>>> out = np.zeros((2, 1), dtype='float')165>>> x.sum(axis=1, dtype='float', out=np.asmatrix(out))166matrix([[3.],167        [7.]])168 169T��keepdims)r<r=�sumr��rWr�r*r`s    r$r��170matrix.sum's)��@�y�y�}�}�T��d�}�C�M�M�d�S�Sr&c�<�[RRXS9$)a171Return a possibly reshaped matrix.172 173Refer to `numpy.squeeze` for more documentation.174 175Parameters176----------177axis : None or int or tuple of ints, optional178    Selects a subset of the axes of length one in the shape.179    If an axis is selected with shape entry greater than one,180    an error is raised.181 182Returns183-------184squeezed : matrix185    The matrix, but as a (1, N) matrix if it had shape (N, 1).186 187See Also188--------189numpy.squeeze : related function190 191Notes192-----193If `m` has a single column then that column is returned194as the single row of a matrix.  Otherwise `m` is returned.195The returned matrix is always either `m` itself or a view into `m`.196Supplying an axis keyword argument will not affect the returned matrix197but it may cause an error to be raised.198 199Examples200--------201>>> c = np.matrix([[1], [2]])202>>> c203matrix([[1],204        [2]])205>>> c.squeeze()206matrix([[1, 2]])207>>> r = c.T208>>> r209matrix([[1, 2]])210>>> r.squeeze()211matrix([[1, 2]])212>>> m = np.matrix([[1, 2], [3, 4]])213>>> m.squeeze()214matrix([[1, 2],215        [3, 4]])216 217�r�)r<r=�squeezer�s  r$r��matrix.squeezeJs��b�y�y� � �� �1�1r&c�<�[RRXS9$)al218Return a flattened copy of the matrix.219 220All `N` elements of the matrix are placed into a single row.221 222Parameters223----------224order : {'C', 'F', 'A', 'K'}, optional225    'C' means to flatten in row-major (C-style) order. 'F' means to226    flatten in column-major (Fortran-style) order. 'A' means to227    flatten in column-major order if `m` is Fortran *contiguous* in228    memory, row-major order otherwise. 'K' means to flatten `m` in229    the order the elements occur in memory. The default is 'C'.230 231Returns232-------233y : matrix234    A copy of the matrix, flattened to a `(1, N)` matrix where `N`235    is the number of elements in the original matrix.236 237See Also238--------239ravel : Return a flattened array.240flat : A 1-D flat iterator over the matrix.241 242Examples243--------244>>> m = np.matrix([[1,2], [3,4]])245>>> m.flatten()246matrix([[1, 2, 3, 4]])247>>> m.flatten('F')248matrix([[1, 3, 2, 4]])249 250�r6)r<r=�flatten�rWr6s  r$r��matrix.flatten~s��F�y�y� � �� �3�3r&c�^�[RRXX#SS9RU5$)a251Returns the average of the matrix elements along the given axis.252 253Refer to `numpy.mean` for full documentation.254 255See Also256--------257numpy.mean258 259Notes260-----261Same as `ndarray.mean` except that, where that returns an `ndarray`,262this returns a `matrix` object.263 264Examples265--------266>>> x = np.matrix(np.arange(12).reshape((3, 4)))267>>> x268matrix([[ 0,  1,  2,  3],269        [ 4,  5,  6,  7],270        [ 8,  9, 10, 11]])271>>> x.mean()2725.5273>>> x.mean(0)274matrix([[4., 5., 6., 7.]])275>>> x.mean(1)276matrix([[ 1.5],277        [ 5.5],278        [ 9.5]])279 280Tr�)r<r=�meanr�r�s    r$r��matrix.mean�s)��@�y�y�~�~�d�%�t�~�D�N�N�t�T�Tr&c	�`�[RRXX#USS9RU5$)a�281Return the standard deviation of the array elements along the given axis.282 283Refer to `numpy.std` for full documentation.284 285See Also286--------287numpy.std288 289Notes290-----291This is the same as `ndarray.std`, except that where an `ndarray` would292be returned, a `matrix` object is returned instead.293 294Examples295--------296>>> x = np.matrix(np.arange(12).reshape((3, 4)))297>>> x298matrix([[ 0,  1,  2,  3],299        [ 4,  5,  6,  7],300        [ 8,  9, 10, 11]])301>>> x.std()3023.4520525295346629 # may vary303>>> x.std(0)304matrix([[ 3.26598632,  3.26598632,  3.26598632,  3.26598632]]) # may vary305>>> x.std(1)306matrix([[ 1.11803399],307        [ 1.11803399],308        [ 1.11803399]])309 310Tr�)r<r=�stdr��rWr�r*r`�ddofs     r$r��311matrix.std��1��@�y�y�}�}�T��T�&*��,�,5�I�d�O�	<r&c	�`�[RRXX#USS9RU5$)aj312Returns the variance of the matrix elements, along the given axis.313 314Refer to `numpy.var` for full documentation.315 316See Also317--------318numpy.var319 320Notes321-----322This is the same as `ndarray.var`, except that where an `ndarray` would323be returned, a `matrix` object is returned instead.324 325Examples326--------327>>> x = np.matrix(np.arange(12).reshape((3, 4)))328>>> x329matrix([[ 0,  1,  2,  3],330        [ 4,  5,  6,  7],331        [ 8,  9, 10, 11]])332>>> x.var()33311.916666666666666334>>> x.var(0)335matrix([[ 10.66666667,  10.66666667,  10.66666667,  10.66666667]]) # may vary336>>> x.var(1)337matrix([[1.25],338        [1.25],339        [1.25]])340 341Tr�)r<r=�varr�r�s     r$r��342matrix.var�r�r&c�^�[RRXX#SS9RU5$)a343Return the product of the array elements over the given axis.344 345Refer to `prod` for full documentation.346 347See Also348--------349prod, ndarray.prod350 351Notes352-----353Same as `ndarray.prod`, except, where that returns an `ndarray`, this354returns a `matrix` object instead.355 356Examples357--------358>>> x = np.matrix(np.arange(12).reshape((3,4))); x359matrix([[ 0,  1,  2,  3],360        [ 4,  5,  6,  7],361        [ 8,  9, 10, 11]])362>>> x.prod()3630364>>> x.prod(0)365matrix([[  0,  45, 120, 231]])366>>> x.prod(1)367matrix([[   0],368        [ 840],369        [7920]])370 371Tr�)r<r=�prodr�r�s    r$r��matrix.prods(��>�y�y�~�~�d�%�t�~�D�N�N�t�T�Tr&c�^�[RRXUSS9RU5$)a�372Test whether any array element along a given axis evaluates to True.373 374Refer to `numpy.any` for full documentation.375 376Parameters377----------378axis : int, optional379    Axis along which logical OR is performed380out : ndarray, optional381    Output to existing array instead of creating new one, must have382    same shape as expected output383 384Returns385-------386    any : bool, ndarray387        Returns a single bool if `axis` is ``None``; otherwise,388        returns `ndarray`389 390Tr�)r<r=�anyr��rWr�r`s   r$r��391matrix.any,s(��*�y�y�}�}�T��t�}�<�F�F�t�L�Lr&c�^�[RRXUSS9RU5$)a�392Test whether all matrix elements along a given axis evaluate to True.393 394Parameters395----------396See `numpy.all` for complete descriptions397 398See Also399--------400numpy.all401 402Notes403-----404This is the same as `ndarray.all`, but it returns a `matrix` object.405 406Examples407--------408>>> x = np.matrix(np.arange(12).reshape((3,4))); x409matrix([[ 0,  1,  2,  3],410        [ 4,  5,  6,  7],411        [ 8,  9, 10, 11]])412>>> y = x[0]; y413matrix([[0, 1, 2, 3]])414>>> (x == y)415matrix([[ True,  True,  True,  True],416        [False, False, False, False],417        [False, False, False, False]])418>>> (x == y).all()419False420>>> (x == y).all(0)421matrix([[False, False, False, False]])422>>> (x == y).all(1)423matrix([[ True],424        [False],425        [False]])426 427Tr�)r<r=�allr�r�s   r$r��428matrix.allCs)��L�y�y�}�}�T��t�}�<�F�F�t�L�Lr&c�^�[RRXUSS9RU5$)a429430Return the maximum value along an axis.431 432Parameters433----------434See `amax` for complete descriptions435 436See Also437--------438amax, ndarray.max439 440Notes441-----442This is the same as `ndarray.max`, but returns a `matrix` object443where `ndarray.max` would return an ndarray.444 445Examples446--------447>>> x = np.matrix(np.arange(12).reshape((3,4))); x448matrix([[ 0,  1,  2,  3],449        [ 4,  5,  6,  7],450        [ 8,  9, 10, 11]])451>>> x.max()45211453>>> x.max(0)454matrix([[ 8,  9, 10, 11]])455>>> x.max(1)456matrix([[ 3],457        [ 7],458        [11]])459 460Tr�)r<r=�maxr�r�s   r$r��461matrix.maxk�)��B�y�y�}�}�T��t�}�<�F�F�t�L�Lr&c�`�[RRXU5RU5$)a�462Indexes of the maximum values along an axis.463 464Return the indexes of the first occurrences of the maximum values465along the specified axis.  If axis is None, the index is for the466flattened matrix.467 468Parameters469----------470See `numpy.argmax` for complete descriptions471 472See Also473--------474numpy.argmax475 476Notes477-----478This is the same as `ndarray.argmax`, but returns a `matrix` object479where `ndarray.argmax` would return an `ndarray`.480 481Examples482--------483>>> x = np.matrix(np.arange(12).reshape((3,4))); x484matrix([[ 0,  1,  2,  3],485        [ 4,  5,  6,  7],486        [ 8,  9, 10, 11]])487>>> x.argmax()48811489>>> x.argmax(0)490matrix([[2, 2, 2, 2]])491>>> x.argmax(1)492matrix([[3],493        [3],494        [3]])495 496)r<r=�argmaxr�r�s   r$r��
matrix.argmax��'��J�y�y����C�0�7�7��=�=r&c�^�[RRXUSS9RU5$)a 497Return the minimum value along an axis.498 499Parameters500----------501See `amin` for complete descriptions.502 503See Also504--------505amin, ndarray.min506 507Notes508-----509This is the same as `ndarray.min`, but returns a `matrix` object510where `ndarray.min` would return an ndarray.511 512Examples513--------514>>> x = -np.matrix(np.arange(12).reshape((3,4))); x515matrix([[  0,  -1,  -2,  -3],516        [ -4,  -5,  -6,  -7],517        [ -8,  -9, -10, -11]])518>>> x.min()519-11520>>> x.min(0)521matrix([[ -8,  -9, -10, -11]])522>>> x.min(1)523matrix([[ -3],524        [ -7],525        [-11]])526 527Tr�)r<r=�minr�r�s   r$r��528matrix.min�r�r&c�`�[RRXU5RU5$)a�529Indexes of the minimum values along an axis.530 531Return the indexes of the first occurrences of the minimum values532along the specified axis.  If axis is None, the index is for the533flattened matrix.534 535Parameters536----------537See `numpy.argmin` for complete descriptions.538 539See Also540--------541numpy.argmin542 543Notes544-----545This is the same as `ndarray.argmin`, but returns a `matrix` object546where `ndarray.argmin` would return an `ndarray`.547 548Examples549--------550>>> x = -np.matrix(np.arange(12).reshape((3,4))); x551matrix([[  0,  -1,  -2,  -3],552        [ -4,  -5,  -6,  -7],553        [ -8,  -9, -10, -11]])554>>> x.argmin()55511556>>> x.argmin(0)557matrix([[2, 2, 2, 2]])558>>> x.argmin(1)559matrix([[3],560        [3],561        [3]])562 563)r<r=�argminr�r�s   r$r��
matrix.argmin�r�r&c�N�[R"XU5RU5$)a564Peak-to-peak (maximum - minimum) value along the given axis.565 566Refer to `numpy.ptp` for full documentation.567 568See Also569--------570numpy.ptp571 572Notes573-----574Same as `ndarray.ptp`, except, where that would return an `ndarray` object,575this returns a `matrix` object.576 577Examples578--------579>>> x = np.matrix(np.arange(12).reshape((3,4))); x580matrix([[ 0,  1,  2,  3],581        [ 4,  5,  6,  7],582        [ 8,  9, 10, 11]])583>>> x.ptp()58411585>>> x.ptp(0)586matrix([[8, 8, 8, 8]])587>>> x.ptp(1)588matrix([[3],589        [3],590        [3]])591 592)r<�ptpr�r�s   r$r��593matrix.ptp�s ��>�u�u�T��%�,�,�T�2�2r&c�d�URupX:XaSSKJn OSSKJn [	U"U55$)aa594Returns the (multiplicative) inverse of invertible `self`.595 596Parameters597----------598None599 600Returns601-------602ret : matrix object603    If `self` is non-singular, `ret` is such that ``ret * self`` ==604    ``self * ret`` == ``np.matrix(np.eye(self[0,:].size))`` all return605    ``True``.606 607Raises608------609numpy.linalg.LinAlgError: Singular matrix610    If `self` is singular.611 612See Also613--------614linalg.inv615 616Examples617--------618>>> m = np.matrix('[1, 2; 3, 4]'); m619matrix([[1, 2],620        [3, 4]])621>>> m.getI()622matrix([[-2. ,  1. ],623        [ 1.5, -0.5]])624>>> m.getI() * m625matrix([[ 1.,  0.], # may vary626        [ 0.,  1.]])627 628r)�inv)�pinv)rB�numpy.linalgr�r�r)rW�Mr<�funcs    r$�I�matrix.I s*��L�z�z����6�0�1���T�629�#�#r&c�"�UR5$)a�630Return `self` as an `ndarray` object.631 632Equivalent to ``np.asarray(self)``.633 634Parameters635----------636None637 638Returns639-------640ret : ndarray641    `self` as an `ndarray`642 643Examples644--------645>>> x = np.matrix(np.arange(12).reshape((3,4))); x646matrix([[ 0,  1,  2,  3],647        [ 4,  5,  6,  7],648        [ 8,  9, 10, 11]])649>>> x.getA()650array([[ 0,  1,  2,  3],651       [ 4,  5,  6,  7],652       [ 8,  9, 10, 11]])653 654)r�r�s r$�A�matrix.AMs��8�~�~��r&c�>�UR5R5$)ax655Return `self` as a flattened `ndarray`.656 657Equivalent to ``np.asarray(x).ravel()``658 659Parameters660----------661None662 663Returns664-------665ret : ndarray666    `self`, 1-D, as an `ndarray`667 668Examples669--------670>>> x = np.matrix(np.arange(12).reshape((3,4))); x671matrix([[ 0,  1,  2,  3],672        [ 4,  5,  6,  7],673        [ 8,  9, 10, 11]])674>>> x.getA1()675array([ 0,  1,  2, ...,  9, 10, 11])676 677 678)r��ravelr�s r$�A1�	matrix.A1ks��6�~�~��%�%�'�'r&c�<�[RRXS9$)a!679Return a flattened matrix.680 681Refer to `numpy.ravel` for more documentation.682 683Parameters684----------685order : {'C', 'F', 'A', 'K'}, optional686    The elements of `m` are read using this index order. 'C' means to687    index the elements in C-like order, with the last axis index688    changing fastest, back to the first axis index changing slowest.689    'F' means to index the elements in Fortran-like index order, with690    the first index changing fastest, and the last index changing691    slowest. Note that the 'C' and 'F' options take no account of the692    memory layout of the underlying array, and only refer to the order693    of axis indexing.  'A' means to read the elements in Fortran-like694    index order if `m` is Fortran *contiguous* in memory, C-like order695    otherwise.  'K' means to read the elements in the order they occur696    in memory, except for reversing the data when strides are negative.697    By default, 'C' index order is used.698 699Returns700-------701ret : matrix702    Return the matrix flattened to shape `(1, N)` where `N`703    is the number of elements in the original matrix.704    A copy is made only if necessary.705 706See Also707--------708matrix.flatten : returns a similar output matrix but always a copy709matrix.flat : a flat iterator on the array.710numpy.ravel : related function which returns an ndarray711 712r�)r<r=r�r�s  r$r��matrix.ravel�s��H�y�y���t��1�1r&c�"�UR5$)a�713Returns the transpose of the matrix.714 715Does *not* conjugate!  For the complex conjugate transpose, use ``.H``.716 717Parameters718----------719None720 721Returns722-------723ret : matrix object724    The (non-conjugated) transpose of the matrix.725 726See Also727--------728transpose, getH729 730Examples731--------732>>> m = np.matrix('[1, 2; 3, 4]')733>>> m734matrix([[1, 2],735        [3, 4]])736>>> m.getT()737matrix([[1, 3],738        [2, 4]])739 740)rr�s r$�T�matrix.T�s��>�~�~��r&c���[URR[R5(aUR5R
5$UR5$)a�741Returns the (complex) conjugate transpose of `self`.742 743Equivalent to ``np.transpose(self)`` if `self` is real-valued.744 745Parameters746----------747None748 749Returns750-------751ret : matrix object752    complex conjugate transpose of `self`753 754Examples755--------756>>> x = np.matrix(np.arange(12).reshape((3,4)))757>>> z = x - 1j*x; z758matrix([[  0. +0.j,   1. -1.j,   2. -2.j,   3. -3.j],759        [  4. -4.j,   5. -5.j,   6. -6.j,   7. -7.j],760        [  8. -8.j,   9. -9.j,  10.-10.j,  11.-11.j]])761>>> z.getH()762matrix([[ 0. -0.j,  4. +4.j,  8. +8.j],763        [ 1. +1.j,  5. +5.j,  9. +9.j],764        [ 2. +2.j,  6. +6.j, 10.+10.j],765        [ 3. +3.j,  7. +7.j, 11.+11.j]])766 767)�768issubclassr*�typer<�complexfloatingr�	conjugater�s r$�H�matrix.H�sB��<�d�j�j�o�o�q�'8�'8�9�9��>�>�#�-�-�/�/��>�>�#�#r&)rUrB)NT)NNNro)r3)NNNr�NN).�__name__�769__module__�__qualname__�__firstlineno__�__doc__�__array_priority__rFrZr]rlrerrrurxr{r�r�r�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�getI�__static_attributes__rPr&r$rrIsC��)�T��5�n�.�4�"��)���1��)�. T�F12�h#4�J U�D!<�F!<�FU�BM�.&M�P!M�F%>�N!M�F%>�N3�B�*$��*$�X� �� �:�(��(�8$2�L� �� �@� $�� $�F
�6�6�D��6�6�D��G�G�E��6�6�D��6�6�Dr&rc	���URS5n/nUH�nURS5n/nUH"nURUR55 M$ Un/n	UH)n770U771R5n772X*nU	RU5 M+ UR[
U	SS95 M� [
USS9$![a+ XnNM![an[	SU773<S35SeSnAff=ff=f)Nr
rzname z is not defined�����r�r)rr�strip�KeyError�	NameErrorrr)
r?�gdict�ldictr�rowtuprrr rR�coltupr!�thismat�es
             r$�_from_stringr��s����9�9�S�>�D�
�F����y�y��~�����A��M�M�!�'�'�)�$�������C��)�)�+�C�
N��*��
�M�M�'�"��	�
�
�k�&�r�2�3�%�&�v�A�&�&���
N�N�#�j�G���N�#�e�C�7�/�$B�C��M��N��
N�s*�.B.�.774C#�9B?�?775C	�	C	�C	�C#c�6�[U[5(aTUc8[R"5RnUR776nURnOUnUn[[XU55$[U[[45(ak/nUHPn[U[R5(a[[USS95s $UR[USS95 MR [[USS95$[U[R5(a[U5$g)a777Build a matrix object from a string, nested sequence, or array.778 779Parameters780----------781obj : str or array_like782    Input data. If a string, variables in the current scope may be783    referenced by name.784ldict : dict, optional785    A dictionary that replaces local operands in current frame.786    Ignored if `obj` is not a string or `gdict` is None.787gdict : dict, optional788    A dictionary that replaces global operands in current frame.789    Ignored if `obj` is not a string.790 791Returns792-------793out : matrix794    Returns a matrix object, which is a specialized 2-D array.795 796See Also797--------798block :799    A generalization of this function for N-d arrays, that returns normal800    ndarrays.801 802Examples803--------804>>> import numpy as np805>>> A = np.asmatrix('1 1; 1 1')806>>> B = np.asmatrix('2 2; 2 2')807>>> C = np.asmatrix('3 4; 5 6')808>>> D = np.asmatrix('7 8; 9 0')809 810All the following expressions construct the same block matrix:811 812>>> np.bmat([[A, B], [C, D]])813matrix([[1, 1, 2, 2],814        [1, 1, 2, 2],815        [3, 4, 7, 8],816        [5, 6, 9, 0]])817>>> np.bmat(np.r_[np.c_[A, B], np.c_[C, D]])818matrix([[1, 1, 2, 2],819        [1, 1, 2, 2],820        [3, 4, 7, 8],821        [5, 6, 9, 0]])822>>> np.bmat('A,B; C,D')823matrix([[1, 1, 2, 2],824        [1, 1, 2, 2],825        [3, 4, 7, 8],826        [5, 6, 9, 0]])827 828Nr�r�r)r:r?�sys�	_getframe�f_back�	f_globals�f_localsrr�rVrfr<r=rr)rXr�r��frame�	glob_dict�loc_dict�arr_rowsrs        r$rrs���n�#�s����=��M�M�O�*�*�E����I��~�~�H��I��H��l�3�8�<�=�=��#��t�}�%�%����C��#�q�y�y�)�)��k�#�B�7�8�8�����C�b� 9�:�	�829�k�(��3�4�4��#�q�y�y�!�!��c�{��"r&ror�)�__all__rr�r7�numpy._core.numeric�_core�numericr<rr�numpy._utilsrr�r830r%rr=rr�rrPr&r$�<module>rs���831(��832�833����5�#�&��(�G��!1��!1�H�G��m�Q�Y�Y�m��m�^'�2�G��L��Lr&
codekingpro/portable-devtools · Team Ai