
    sg[                        d dl mZ d dlmZ ddlmZ ddlmZ ddlm	Z	m
Z
mZ ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZmZmZm Z  dd	l!m"Z"m#Z#m$Z$m%Z% dd
l&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4 ddl5m6Z6 ddgiZ7 G d de      Z8 G d de8      Z9 G d de9      Z: G d de:      Z; G d de      Z< G d de      Z=y)    )Basic)Dummy   )MatrixCommon)NonSquareMatrixError)_iszero_is_zero_after_expand_mul	_simplify)_find_reasonable_pivot_find_reasonable_pivot_naive	_adjugate	_charpoly	_cofactor_cofactor_matrix_per_det_det_bareiss_det_berkowitz	_det_bird_det_laplace_det_LU_minor_minor_submatrix)_is_echelon_echelon_form_rank_rref)_columnspace
_nullspace	_rowspace_orthogonalize)
_eigenvals_eigenvects_bidiagonalize_bidiagonal_decomposition_is_diagonalizable_diagonalize_is_positive_definite_is_positive_semidefinite_is_negative_definite_is_negative_semidefinite_is_indefinite_jordan_form_left_eigenvects_singular_values)
MatrixBase)zMatrixEigen.is_indefinitez MatrixEigen.is_negative_definitez$MatrixEigen.is_negative_semidefinitez MatrixEigen.is_positive_definitez$MatrixEigen.is_positive_semidefinite
matplotlibc                      e Zd ZdZefdZd ZedfdZd Z	d Z
d Zdd	Zd
efdZddZddZddZd ZddZd Zej                  e_        ej                  e_        ej                  e_        ej                  e_        ej                  e	_        ej                  e
_        ej                  e_        ej                  e_        ej                  e_        ej                  e_        ej                  e_        e j                  e_        ej                  e_        e!j                  e_        e"j                  e_        e#j                  e_        y)MatrixDeterminantzProvides basic matrix determinant operations. Should not be instantiated
    directly. See ``determinant.py`` for their implementations.c                     t        | |      S )N)
iszerofuncr   )selfr5   s     J/var/www/html/venv/lib/python3.12/site-packages/sympy/matrices/matrices.py_eval_det_bareissz#MatrixDeterminant._eval_det_bareiss3   s    DZ88    c                     t        |       S N)r   r7   s    r8   _eval_det_berkowitzz%MatrixDeterminant._eval_det_berkowitz6   s    d##r:   Nc                     t        | ||      S )N)r5   simpfunc)r   )r7   r5   r@   s      r8   _eval_det_luzMatrixDeterminant._eval_det_lu9   s    t
XFFr:   c                     t        |       S r<   )r   r=   s    r8   _eval_det_birdz MatrixDeterminant._eval_det_bird<   s    r:   c                     t        |       S r<   )r   r=   s    r8   _eval_det_laplacez#MatrixDeterminant._eval_det_laplace?       D!!r:   c                     t        |       S r<   r   r=   s    r8   _eval_determinantz#MatrixDeterminant._eval_determinantB       Dzr:   c                     t        | |      S Nmethod)r   r7   rN   s     r8   adjugatezMatrixDeterminant.adjugateE   s    f--r:   lambdac                     t        | ||      S )N)xsimplify)r   r7   rS   rT   s      r8   charpolyzMatrixDeterminant.charpolyH   s    X66r:   c                      t        | |||      S rL   )r   r7   ijrN   s       r8   cofactorzMatrixDeterminant.cofactorK   s    q!F33r:   c                     t        | |      S rL   )r   rO   s     r8   cofactor_matrixz!MatrixDeterminant.cofactor_matrixN   s    V44r:   c                     t        | ||      S )N)rN   r5   rH   )r7   rN   r5   s      r8   detzMatrixDeterminant.detQ   s    DJ??r:   c                     t        |       S r<   )r   r=   s    r8   perzMatrixDeterminant.perT   rJ   r:   c                      t        | |||      S rL   )r   rX   s       r8   minorzMatrixDeterminant.minorW   s    dAq00r:   c                     t        | ||      S r<   )r   r7   rY   rZ   s      r8   minor_submatrixz!MatrixDeterminant.minor_submatrixZ   s    a++r:   	berkowitz)bareissN)$__name__
__module____qualname____doc__r	   r9   r>   r   rA   rC   rE   rI   rP   r
   rV   r[   r]   r_   ra   rc   rf   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r:   r8   r3   r3   /   s@   C ,E 9$ '. G". "I 745@1, ,B+I+I"+G+O+O (+7+?+?+9+A+A(1(9(9N+7+?+?+2??L+/<<+4+<+<H+4+<+<H+4+<+<H+;+C+CO+/<<CK+/<<CK+1>>EM+;+C+COr:   r3   c                      e Zd ZdZeddfdZed        ZedfdZd Z	edddfdZ
ej                  e_        ej                  e_        ej                  e_        ej                  e
_        dd	Zd
 Zd Zd Zd Zd Zd ZddZddZy)MatrixReductionszProvides basic matrix row/column operations. Should not be instantiated
    directly. See ``reductions.py`` for some of their implementations.Fc                      t        | |||      S )N)r5   rT   with_pivots)r   )r7   r5   rT   rr   s       r8   echelon_formzMatrixReductions.echelon_forms   s    Tj8') 	)r:   c                     t        |       S r<   )r   r=   s    r8   
is_echelonzMatrixReductions.is_echelonw   s    4  r:   c                     t        | ||      S )N)r5   rT   )r   )r7   r5   rT   s      r8   rankzMatrixReductions.rank{   s    Tj8DDr:   c                     t        | j                  | | j                  | j                        |            \  }}|ddd| j                  f   |dd|j                   df   fS )a  Return reduced row-echelon form of matrix, matrix showing
        rhs after reduction steps. ``rhs`` must have the same number
        of rows as ``self``.

        Examples
        ========

        >>> from sympy import Matrix, symbols
        >>> r1, r2 = symbols('r1 r2')
        >>> Matrix([[1, 1], [2, 1]]).rref_rhs(Matrix([r1, r2]))
        (Matrix([
        [1, 0],
        [0, 1]]), Matrix([
        [ -r1 + r2],
        [2*r1 - r2]]))
        N)r   hstackeyerowscols)r7   rhsr_s       r8   rref_rhszMatrixReductions.rref_rhs~   sY    " T[[txx		':C@A1JTYYJ1sxxij=!111r:   Tc                 "    t        | ||||      S )N)r5   rT   pivotsnormalize_last)r   )r7   r5   rT   r   r   s        r8   rrefzMatrixReductions.rref   s    Tj8.: 	:r:   c                    |dvrt        dj                  ||            |dk(  r| j                  n| j                  }|dk(  rM||n|}||t        dj                  |            d|cxk  r|k  sn t        dj                  ||            |d	k(  r||||hj	                  dg      }t        |      d
kD  r|||hj	                  dg      }t        |      d
k7  rt        dj                  |            |\  }}d|cxk  r|k  sn t        dj                  ||            d|cxk  r|k  sn t        dj                  ||            |dk(  r||n|}||n|}|||t        dj                  |            ||k(  rt        dj                  |            d|cxk  r|k  sn t        dj                  ||            d|cxk  r|k  s4n t        dj                  ||            t        dt        |      z        |||||fS )zValidate the arguments for a row/column operation.  ``error_str``
        can be one of "row" or "col" depending on the arguments being parsed.)n->knn<->mn->n+kmzOUnknown {} operation '{}'. Valid col operations are 'n->kn', 'n<->m', 'n->n+km'colr   NzEFor a {0} operation 'n->kn' you must provide the kwargs `{0}` and `k`r   z#This matrix does not have a {} '{}'r      zIFor a {0} operation 'n<->m' you must provide the kwargs `{0}1` and `{0}2`r   zPFor a {0} operation 'n->n+km' you must provide the kwargs `{0}`, `k`, and `{0}2`zAFor a {0} operation 'n->n+km' `{0}` and `{0}2` must be different.zinvalid operation %s)
ValueErrorformatr|   r{   
differencelenrepr)	r7   opr   kcol1col2	error_str	self_colsr|   s	            r8   _normalize_op_argsz#MatrixReductions._normalize_op_args   sT    22 ??EviQS?TV V "+e!3DII	 =#dC{ai  "88>y8IK K'i' !F!M!MiY\!]^^7] D$'22D6:D4y1}T4(33TF;4yA~  "<<BF9<MO OJD$(y( !F!M!MiY]!^__(y( !F!M!MiY]!^__9_+$3C<4TD{dlai  "AAG	ART Td{  "117	1BD D'i' !F!M!MiY\!]^^(y( !F!M!MiY]!^__ 3d2h>??34%%r:   c                 d      fd} j                   j                   j                  |      S )Nc                 0    |k(  r
| |f   z  S | |f   S r<   rn   )rY   rZ   r   r   r7   s     r8   entryzBMatrixReductions._eval_col_op_multiply_col_by_const.<locals>.entry   *    Cx41:~%1:r:   _newr{   r|   )r7   r   r   r   s   ``` r8   "_eval_col_op_multiply_col_by_constz3MatrixReductions._eval_col_op_multiply_col_by_const   %    	 yyDIIu55r:   c                 d      fd} j                   j                   j                  |      S )Nc                 B    |k(  r| f   S |k(  r| f   S | |f   S r<   rn   )rY   rZ   r   r   r7   s     r8   r   z1MatrixReductions._eval_col_op_swap.<locals>.entry   s;    DyAtG}$dAtG}$1:r:   r   )r7   r   r   r   s   ``` r8   _eval_col_op_swapz"MatrixReductions._eval_col_op_swap   %    	 yyDIIu55r:   c                 h      fd} j                   j                   j                  |      S )Nc                 @    |k(  r| |f   | f   z  z   S | |f   S r<   rn   )rY   rZ   r   r   r   r7   s     r8   r   zFMatrixReductions._eval_col_op_add_multiple_to_other_col.<locals>.entry   s8    CxAqDzAQW$5551:r:   r   )r7   r   r   r   r   s   ```` r8   &_eval_col_op_add_multiple_to_other_colz7MatrixReductions._eval_col_op_add_multiple_to_other_col   %    	 yyDIIu55r:   c                 d      fd} j                   j                   j                  |      S )Nc                 B    | k(  r|f   S | k(  r|f   S | |f   S r<   rn   )rY   rZ   row1row2r7   s     r8   r   z1MatrixReductions._eval_row_op_swap.<locals>.entry   s;    DyD!G}$dD!G}$1:r:   r   )r7   r   r   r   s   ``` r8   _eval_row_op_swapz"MatrixReductions._eval_row_op_swap   r   r:   c                 d      fd} j                   j                   j                  |      S )Nc                 0    | k(  r
| |f   z  S | |f   S r<   rn   )rY   rZ   r   rowr7   s     r8   r   zBMatrixReductions._eval_row_op_multiply_row_by_const.<locals>.entry   r   r:   r   )r7   r   r   r   s   ``` r8   "_eval_row_op_multiply_row_by_constz3MatrixReductions._eval_row_op_multiply_row_by_const   r   r:   c                 h      fd} j                   j                   j                  |      S )Nc                 @    | k(  r| |f   |f   z  z   S | |f   S r<   rn   )rY   rZ   r   r   r   r7   s     r8   r   zFMatrixReductions._eval_row_op_add_multiple_to_other_row.<locals>.entry   s8    CxAqDzAT1W$5551:r:   r   )r7   r   r   r   r   s   ```` r8   &_eval_row_op_add_multiple_to_other_rowz7MatrixReductions._eval_row_op_add_multiple_to_other_row   r   r:   Nc                     | j                  |||||d      \  }}}}}|dk(  r| j                  ||      S |dk(  r| j                  ||      S |dk(  r| j                  |||      S y)ad  Performs the elementary column operation `op`.

        `op` may be one of

            * ``"n->kn"`` (column n goes to k*n)
            * ``"n<->m"`` (swap column n and column m)
            * ``"n->n+km"`` (column n goes to column n + k*column m)

        Parameters
        ==========

        op : string; the elementary row operation
        col : the column to apply the column operation
        k : the multiple to apply in the column operation
        col1 : one column of a column swap
        col2 : second column of a column swap or column "m" in the column operation
               "n->n+km"
        r   r   r   r   N)r   r   r   r   )r7   r   r   r   r   r   s         r8   elementary_col_opz"MatrixReductions.elementary_col_op      ( "&!8!8S!T4QV!WCD$ =::3BB=))$55?>>sAtLL r:   c                     | j                  |||||d      \  }}}}}|dk(  r| j                  ||      S |dk(  r| j                  ||      S |dk(  r| j                  |||      S y)a4  Performs the elementary row operation `op`.

        `op` may be one of

            * ``"n->kn"`` (row n goes to k*n)
            * ``"n<->m"`` (swap row n and row m)
            * ``"n->n+km"`` (row n goes to row n + k*row m)

        Parameters
        ==========

        op : string; the elementary row operation
        row : the row to apply the row operation
        k : the multiple to apply in the row operation
        row1 : one row of a row swap
        row2 : second row of a row swap or row "m" in the row operation
               "n->n+km"
        r   r   r   r   N)r   r   r   r   )r7   r   r   r   r   r   s         r8   elementary_row_opz"MatrixReductions.elementary_row_op  r   r:   )r   )r   NNNN)rj   rk   rl   rm   r   rs   propertyru   rw   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rn   r:   r8   rp   rp   o   s    J '.5 ) ! ! & E2( &d:
 )00L&..J ==DL ==DL5&n666666M<Mr:   rp   c                       e Zd ZdZddZdefdZddZd Ze	j                  e_        e
j                  e_        ej                  e_        ej                  e_         ee      Zy)	MatrixSubspaceszProvides methods relating to the fundamental subspaces of a matrix.
    Should not be instantiated directly. See ``subspaces.py`` for their
    implementations.Fc                     t        | |      S N)rT   )r   r7   rT   s     r8   columnspacezMatrixSubspaces.columnspaceC  s    D844r:   c                     t        | ||      S )N)rT   r5   )r   )r7   rT   r5   s      r8   	nullspacezMatrixSubspaces.nullspaceF  s    $jIIr:   c                     t        | |      S r   )r    r   s     r8   rowspacezMatrixSubspaces.rowspaceI  s    11r:   c                      t        | g|i |S r<   )r!   )clsvecskwargss      r8   orthogonalizezMatrixSubspaces.orthogonalizeO  s    c3D3F33r:   NF)rj   rk   rl   rm   r   r   r   r   r   r   r   r    r!   classmethodrn   r:   r8   r   r   >  sg    5 "'7 J24 )00K&..I%--H*22M'6Mr:   r   c                      e Zd ZdZddZdefdZddZddZddZ	ddZ
ed	        Zed
        Zed        Zed        Zed        ZddZd Zd Zej                  e_        ej                  e_        ej                  e_        ej                  e_        ej                  e_        ej                  e_        ej                  e_        ej                  e_        ej                  e_        ej                  e_        ej                  e_        ej                  e_        e j                  e	_        e!j                  e
_        y)MatrixEigenzProvides basic matrix eigenvalue/vector operations.
    Should not be instantiated directly. See ``eigen.py`` for their
    implementations.Tc                     t        | fd|i|S )Nerror_when_incomplete)r"   )r7   r   flagss      r8   	eigenvalszMatrixEigen.eigenvals_  s    $U6KUuUUr:   c                      t        | f||d|S )N)r   r5   )r#   )r7   r   r5   r   s       r8   
eigenvectszMatrixEigen.eigenvectsb  s$    4 07L%0).0 	0r:   c                     t        | fd|i|S )N
reals_only)r&   )r7   r   r   s      r8   is_diagonalizablezMatrixEigen.is_diagonalizablef  s    !$H:HHHr:   c                      t        | |||      S )N)r   sort	normalize)r'   )r7   r   r   r   s       r8   diagonalizezMatrixEigen.diagonalizei  s    DZd#% 	%r:   c                     t        | |      S N)upper)r$   r7   r   s     r8   bidiagonalizezMatrixEigen.bidiagonalizem  s    d%00r:   c                     t        | |      S r   )r%   r   s     r8   bidiagonal_decompositionz$MatrixEigen.bidiagonal_decompositionp  s    (U;;r:   c                     t        |       S r<   )r(   r=   s    r8   is_positive_definitez MatrixEigen.is_positive_definites      $T**r:   c                     t        |       S r<   )r)   r=   s    r8   is_positive_semidefinitez$MatrixEigen.is_positive_semidefinitew      (..r:   c                     t        |       S r<   )r*   r=   s    r8   is_negative_definitez MatrixEigen.is_negative_definite{  r   r:   c                     t        |       S r<   )r+   r=   s    r8   is_negative_semidefinitez$MatrixEigen.is_negative_semidefinite  r   r:   c                     t        |       S r<   )r,   r=   s    r8   is_indefinitezMatrixEigen.is_indefinite  s    d##r:   c                     t        | fd|i|S )Ncalc_transform)r-   )r7   r   r   s      r8   jordan_formzMatrixEigen.jordan_form  s    DJJ6JJr:   c                     t        | fi |S r<   )r.   r7   r   s     r8   left_eigenvectszMatrixEigen.left_eigenvects  s    ...r:   c                     t        |       S r<   )r/   r=   s    r8   singular_valueszMatrixEigen.singular_values  s    %%r:   NTr   )FFF)"rj   rk   rl   rm   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r"   r#   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r$   r%   rn   r:   r8   r   r   Z  sn   V 04 0I%1< + + / / + + / / $ $K/& *4););I)4)<)<J);)C)C)5)=)=K)>)F)F )B)J)J$)>)F)F )B)J)J$)7)?)?M)5)=)=K)9)A)AO)9)A)AO)7)?)?M)B)J)J$r:   r   c                   4    e Zd ZdZdddZd Zd Zd Zd Zy	)
MatrixCalculusz,Provides calculus-related matrix operations.T)evaluatec                n    ddl m}  || g|d|i}t        | t              s|r|j	                         S |S )ae  Calculate the derivative of each element in the matrix.

        Examples
        ========

        >>> from sympy import Matrix
        >>> from sympy.abc import x, y
        >>> M = Matrix([[x, y], [1, 0]])
        >>> M.diff(x)
        Matrix([
        [1, 0],
        [0, 0]])

        See Also
        ========

        integrate
        limit
        r   )ArrayDerivativer   )$sympy.tensor.array.array_derivativesr   
isinstancer   
as_mutable)r7   r   argsr   r   derivs         r8   diffzMatrixCalculus.diff  s<    * 	I?t?h?$&8##%%r:   c                 ,    | j                  fd      S )Nc                 &    | j                        S r<   r   )rS   args    r8   <lambda>z1MatrixCalculus._eval_derivative.<locals>.<lambda>  s    s r:   	applyfunc)r7   r  s    `r8   _eval_derivativezMatrixCalculus._eval_derivative  s    ~~344r:   c                 0    | j                  fd      S )a  Integrate each element of the matrix.  ``args`` will
        be passed to the ``integrate`` function.

        Examples
        ========

        >>> from sympy import Matrix
        >>> from sympy.abc import x, y
        >>> M = Matrix([[x, y], [1, 0]])
        >>> M.integrate((x, ))
        Matrix([
        [x**2/2, x*y],
        [     x,   0]])
        >>> M.integrate((x, 0, 2))
        Matrix([
        [2, 2*y],
        [2,   0]])

        See Also
        ========

        limit
        diff
        c                 (     | j                   i S r<   )	integrate)rS   r   r   s    r8   r  z*MatrixCalculus.integrate.<locals>.<lambda>  s    T(DV(D r:   r  )r7   r   r   s    ``r8   r
  zMatrixCalculus.integrate  s    2 ~~DEEr:   c                     t        t              s j                         j                  d   dk(  r j                  d   }n- j                  d   dk(  r j                  d   }nt	        d      j                  d   dk(  rj                  d   }n-j                  d   dk(  rj                  d   }nt	        d       j                  || fd      S )a  Calculates the Jacobian matrix (derivative of a vector-valued function).

        Parameters
        ==========

        ``self`` : vector of expressions representing functions f_i(x_1, ..., x_n).
        X : set of x_i's in order, it can be a list or a Matrix

        Both ``self`` and X can be a row or a column matrix in any order
        (i.e., jacobian() should always work).

        Examples
        ========

        >>> from sympy import sin, cos, Matrix
        >>> from sympy.abc import rho, phi
        >>> X = Matrix([rho*cos(phi), rho*sin(phi), rho**2])
        >>> Y = Matrix([rho, phi])
        >>> X.jacobian(Y)
        Matrix([
        [cos(phi), -rho*sin(phi)],
        [sin(phi),  rho*cos(phi)],
        [   2*rho,             0]])
        >>> X = Matrix([rho*cos(phi), rho*sin(phi)])
        >>> X.jacobian(Y)
        Matrix([
        [cos(phi), -rho*sin(phi)],
        [sin(phi),  rho*cos(phi)]])

        See Also
        ========

        hessian
        wronskian
        r   r   z)``self`` must be a row or a column matrixz"X must be a row or a column matrixc                 2    |    j                  |         S r<   r  )rZ   rY   Xr7   s     r8   r  z)MatrixCalculus.jacobian.<locals>.<lambda>  s    DGLL1,> r:   )r   r0   r   shape	TypeError)r7   r  mns   ``  r8   jacobianzMatrixCalculus.jacobian  s    H !Z(		!A ::a=A

1AZZ]a

1AGHH771:?
AWWQZ1_
A@AA yyA>??r:   c                 ,    | j                  fd      S )a  Calculate the limit of each element in the matrix.
        ``args`` will be passed to the ``limit`` function.

        Examples
        ========

        >>> from sympy import Matrix
        >>> from sympy.abc import x, y
        >>> M = Matrix([[x, y], [1, 0]])
        >>> M.limit(x, 2)
        Matrix([
        [2, y],
        [1, 0]])

        See Also
        ========

        integrate
        diff
        c                 "     | j                    S r<   )limit)rS   r   s    r8   r  z&MatrixCalculus.limit.<locals>.<lambda>+  s     r:   r  )r7   r   s    `r8   r  zMatrixCalculus.limit  s    * ~~677r:   N)	rj   rk   rl   rm   r   r  r
  r  r  rn   r:   r8   r   r     s$    6#' 85F67@r8r:   r   c                   |    e Zd ZdZ ed      efdZd Zd Zd Z	d Z
ddZd	 Zd
 Zd ZddZddZd Zd Zd Zy)MatrixDeprecatedz+A class to house deprecated matrix methods.rQ   c                 &    | j                  |      S )N)rS   )rV   rU   s      r8   berkowitz_charpolyz#MatrixDeprecated.berkowitz_charpoly1  s    }}q}!!r:   c                 &    | j                  d      S )zwComputes determinant using Berkowitz method.

        See Also
        ========

        det
        berkowitz
        rh   rM   r_   r=   s    r8   berkowitz_detzMatrixDeprecated.berkowitz_det4  s     xx{x++r:   c                 &     | j                   di |S )zwComputes eigenvalues of a Matrix using Berkowitz method.

        See Also
        ========

        berkowitz
        rn   )r   r   s     r8   berkowitz_eigenvalsz$MatrixDeprecated.berkowitz_eigenvals?  s     t~~&&&r:   c                     | j                   g }}| j                         D ]  }|j                  ||d   z         | } t        |      S )zpComputes principal minors using Berkowitz method.

        See Also
        ========

        berkowitz
        )onerh   appendtuple)r7   signminorspolys       r8   berkowitz_minorsz!MatrixDeprecated.berkowitz_minorsI  sN     xxfNN$ 	DMM$b/*5D	 V}r:   c                    ddl m} d}| s|S | j                  s
t               | | j                  }}dg|dz
  z  }t        |dd      D ]  } ||dz   |      |dz
  }}||d |f    |d ||f   }
}	|d |d |f   |||f    }}|
g}t        d|dz
        D ]  }|j                  |||   z          t        |      D ]  \  }}|	|z  d   ||<    | j                  |g|z   }t        |      D ]  }|d ||z
  dz    ||d |f<    |||dz
  <    | j                  | j                  |d    g      g}t        |      D ]  \  }}|j                  |||   z          |t        t        t        |            z   S )Nr   )zeros))r   r   r   r   )r   r   )sympy.matricesr)  	is_squarer   r{   ranger"  	enumerater!  r   r#  map)r7   r)  berkAN
transformsr  Tr   RCaitemsrY   Bpolyss                   r8   rh   zMatrixDeprecated.berkowitzY  s   (K~~&((TYY1SAE]
q!R 	"AQ?AEqAa!eH9aAhqARaR!V9qAwhqACE1a!e_ +Qq\*+ "%( )1E4=a) XXqME)E1X - !a%!),!"a%- !"Jq1u'	"* DHHqwh/01j) 	'DAqLLU1X&	' eCu-...r:   c                 &    | j                  |      S rL   )r]   rO   s     r8   cofactorMatrixzMatrixDeprecated.cofactorMatrix  s    ##6#22r:   c                     t        |       S r<   r6   r=   s    r8   
det_bareiszMatrixDeprecated.det_bareis  rF   r:   c                 &    | j                  d      S )a  Compute matrix determinant using LU decomposition.


        Note that this method fails if the LU decomposition itself
        fails. In particular, if the matrix has no inverse this method
        will fail.

        TODO: Implement algorithm for sparse matrices (SFF),
        https://www.eecis.udel.edu/~saunders/papers/sffge/it5.ps

        See Also
        ========


        det
        det_bareiss
        berkowitz_det
        lurM   r  r=   s    r8   det_LU_decompositionz%MatrixDeprecated.det_LU_decomposition  s    & xxtx$$r:   c                 (    | j                  ||      S )N)size
eigenvalue)jordan_block)r7   eigenvalr  s      r8   jordan_cellzMatrixDeprecated.jordan_cell  s      aH ==r:   c                 L    | j                         \  }}||j                         fS r<   )r   get_diag_blocks)r7   calc_transformationPJs       r8   jordan_cellszMatrixDeprecated.jordan_cells  s(    !1!##%%%r:   c                 *    | j                  |||      S rL   )rc   rX   s       r8   
minorEntryzMatrixDeprecated.minorEntry  s    zz!Qvz..r:   c                 &    | j                  ||      S r<   )rf   re   s      r8   minorMatrixzMatrixDeprecated.minorMatrix  s    ##Aq))r:   c                 (    | j                  |d      S )zEPermute the rows of the matrix with the given permutation in reverse.backward	directionpermute_rowsr7   perms     r8   permuteBkwdzMatrixDeprecated.permuteBkwd  s       <<r:   c                 (    | j                  |d      S )z:Permute the rows of the matrix with the given permutation.forwardrS  rU  rW  s     r8   
permuteFwdzMatrixDeprecated.permuteFwd  s       ;;r:   Nrg   r   )rj   rk   rl   rm   r   r
   r  r  r  r'  rh   r;  r=  r@  rF  rL  rN  rP  rY  r\  rn   r:   r8   r  r  /  sU    5#(?Y "	,' &/P3"%*>&/*=<r:   r  N)>sympy.core.basicr   sympy.core.symbolr   commonr   
exceptionsr   	utilitiesr   r	   r
   determinantr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   
reductionsr   r   r   r   	subspacesr   r   r    r!   eigenr"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   
matrixbaser0   __doctest_requires__r3   rp   r   r   r   r  rn   r:   r8   <module>rh     s   
 # #   , D D     A @ J J6 6 6 6 #- 0<n =D =D@LM( LM^7& 78CK/ CKLK8\ K8^@<| @<r:   