+
    i[                        ^ RI Ht ^ RIHt ^RIHt ^RIHt ^RIH	t	H
t
Ht ^RIHtHtHtHtHtHtHtHtHtHtHtHtHtHtHt ^RIHtHtHtH t  ^RI!H"t"H#t#H$t$H%t% ^R	I&H't'H(t(H)t)H*t*H+t+H,t,H-t-H.t.H/t/H0t0H1t1H2t2H3t3H4t4 ^R
I5H6t6 RR./t7 ! R R]4      t8 ! R R]84      t9 ! R R]94      t: ! R R]:4      t; ! R R]4      t< ! R R]4      t=R# )    )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
matplotlibc                     a  ] tR t^/t o Rt]3R ltR t]R3R lt	R t
R tR tRR	 ltR
]3R ltRR ltRR ltRR ltR tRR ltR t]P                  ]n        ]P                  ]n        ]P                  ]n        ]P                  ]n        ]P                  ]
n        ]P                  ]n        ]P                  ]	n        ]P                  ]n        ]P                  ]n        ]P                  ]n        ] P                  ]n        ]!P                  ]n        ]P                  ]n        ]"P                  ]n        ]#P                  ]n        ]$P                  ]n        Rt%V t&R# )MatrixDeterminantzProvides basic matrix determinant operations. Should not be instantiated
directly. See ``determinant.py`` for their implementations.c                    \        WR 7      # ))
iszerofuncr   )selfr4   s   &&w/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/matrices/matrices.py_eval_det_bareiss#MatrixDeterminant._eval_det_bareiss3   s    D88    c                    \        V 4      # N)r   r6   s   &r7   _eval_det_berkowitz%MatrixDeterminant._eval_det_berkowitz6   s    d##r:   Nc                    \        WVR 7      # ))r4   simpfunc)r   )r6   r4   rA   s   &&&r7   _eval_det_luMatrixDeterminant._eval_det_lu9   s    tXFFr:   c                    \        V 4      # r<   )r   r=   s   &r7   _eval_det_bird MatrixDeterminant._eval_det_bird<   s    r:   c                    \        V 4      # r<   )r   r=   s   &r7   _eval_det_laplace#MatrixDeterminant._eval_det_laplace?       D!!r:   c                    \        V 4      # r<   r   r=   s   &r7   _eval_determinant#MatrixDeterminant._eval_determinantB       Dzr:   c                    \        WR 7      # method)r   r6   rS   s   &&r7   adjugateMatrixDeterminant.adjugateE   s    --r:   lambdac                    \        WVR 7      # ))xsimplify)r   r6   rY   rZ   s   &&&r7   charpolyMatrixDeterminant.charpolyH   s    X66r:   c                    \        WW#R 7      # rQ   )r   r6   ijrS   s   &&&&r7   cofactorMatrixDeterminant.cofactorK   s    !33r:   c                    \        WR 7      # rQ   )r   rT   s   &&r7   cofactor_matrix!MatrixDeterminant.cofactor_matrixN   s    44r:   c                    \        WVR 7      # ))rS   r4   rL   )r6   rS   r4   s   &&&r7   detMatrixDeterminant.detQ   s    DJ??r:   c                    \        V 4      # r<   )r   r=   s   &r7   perMatrixDeterminant.perT   rO   r:   c                    \        WW#R 7      # rQ   )r   r_   s   &&&&r7   minorMatrixDeterminant.minorW   s    dq00r:   c                    \        WV4      # r<   )r   r6   r`   ra   s   &&&r7   minor_submatrix!MatrixDeterminant.minor_submatrixZ   s    ++r:    	berkowitz)bareissN)'__name__
__module____qualname____firstlineno____doc__r   r8   r>   r   rB   rE   rH   rM   rU   r	   r\   rb   re   rh   rk   rn   rr   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell____classdict__s   @r7   r2   r2   /   sF    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:   r2   c                   4  a  ] tR t^ot o Rt]RR3R lt]R 4       t]R3R lt	R t
]RRR3R lt]P                  ]n        ]P                  ]n        ]P                  ]	n        ]P                  ]n        RR	 ltR
 tR tR tR tR tR tRR ltRR ltRtV tR# )MatrixReductionszProvides basic matrix row/column operations. Should not be instantiated
directly. See ``reductions.py`` for some of their implementations.Fc                    \        WVVR 7      # ))r4   rZ   with_pivots)r   )r6   r4   rZ   r   s   &&&&r7   echelon_formMatrixReductions.echelon_forms   s    T8') 	)r:   c                    \        V 4      # r<   )r   r=   s   &r7   
is_echelonMatrixReductions.is_echelonw   s    4  r:   c                    \        WVR 7      # ))r4   rZ   )r   )r6   r4   rZ   s   &&&r7   rankMatrixReductions.rank{   s    T8DDr:   c                    \        V P                  W P                  V P                  4      V4      4      w  r#VRRV P                  13,          VRVP                  ) R13,          3# )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]]))
:NNNN)r   hstackeyerowscols)r6   rhsr_s   &&  r7   rref_rhsMatrixReductions.rref_rhs~   sU    " T[[xx		':C@AJTYYJ1sxxij=!111r:   Tc                    \        WVW4R 7      # ))r4   rZ   pivotsnormalize_last)r   )r6   r4   rZ   r   r   s   &&&&&r7   rrefMatrixReductions.rref   s    T8: 	:r:   c                n   VR9  d   \        RP                  Wa4      4      hVR8X  d   V P                  MV P                  pVR8X  dX   Ve   TMTpVe   Vf   \        RP                  V4      4      h^ Tu;8:  d   V8  g   M \        RP                  Wb4      4      hEMVR8X  d   W#WE0P	                  R.4      p\        V4      ^8  d   W$V0P	                  R.4      p\        V4      ^8w  d   \        R	P                  V4      4      hVw  rE^ Tu;8:  d   V8  g   M \        RP                  Wd4      4      h^ Tu;8:  d   V8  g   M \        RP                  We4      4      hMVR8X  d   Vf   TMTpVf   TMTpVe	   Ve   Vf   \        R
P                  V4      4      hW%8X  d   \        RP                  V4      4      h^ Tu;8:  d   V8  g   M \        RP                  Wb4      4      h^ Tu;8:  d   V8  g   M \        RP                  We4      4      hM\        R\        V4      ,          4      hWW4V3# )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'colNzEFor a {0} operation 'n->kn' you must provide the kwargs `{0}` and `k`z#This matrix does not have a {} '{}'zIFor a {0} operation 'n<->m' you must provide the kwargs `{0}1` and `{0}2`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)r   r   r   )
ValueErrorformatr   r   
differencelenrepr)	r6   opr   kcol1col2	error_str	self_colsr   s	   &&&&&&&  r7   _normalize_op_args#MatrixReductions._normalize_op_args   sG    22 ??Evi?TV V "+e!3DII	 =#dC{ai  "88>y8IK K'i' !F!M!Mi!]^^ ( 7] D'22D6:D4y1}4(33TF;4yA~  "<<BF9<MO OJD(y( !F!M!Mi!^__(y( !F!M!Mi!^__ ) 9_+$3C<4TD{dlai  "AAG	ART T{  "117	1BD D'i' !F!M!Mi!]^^(y( !F!M!Mi!^__ ) 3d2h>??%%r:   c                f   a aa VVV 3R  lpS P                  S P                  S P                  V4      # )c                 H   < VS8X  d   SSW3,          ,          # SW3,          # r<   rt   )r`   ra   r   r   r6   s   &&r7   entryBMatrixReductions._eval_col_op_multiply_col_by_const.<locals>.entry   &    Cx4:~%:r:   _newr   r   )r6   r   r   r   s   fff r7   "_eval_col_op_multiply_col_by_const3MatrixReductions._eval_col_op_multiply_col_by_const   %    	 yyDIIu55r:   c                f   a aa VVV 3R  lpS P                  S P                  S P                  V4      # )c                 `   < VS8X  d   SV S3,          # VS8X  d   SV S3,          # SW3,          # r<   rt   )r`   ra   r   r   r6   s   &&r7   r   1MatrixReductions._eval_col_op_swap.<locals>.entry   s9    DyAtG}$dAtG}$:r:   r   )r6   r   r   r   s   fff r7   _eval_col_op_swap"MatrixReductions._eval_col_op_swap   %    	 yyDIIu55r:   c                j   a aaa VVVV 3R  lpS P                  S P                  S P                  V4      # )c                 h   < VS8X  d"   SW3,          SSV S3,          ,          ,           # SW3,          # r<   rt   )r`   ra   r   r   r   r6   s   &&r7   r   FMatrixReductions._eval_col_op_add_multiple_to_other_col.<locals>.entry   s4    CxADzAQW$555:r:   r   )r6   r   r   r   r   s   ffff r7   &_eval_col_op_add_multiple_to_other_col7MatrixReductions._eval_col_op_add_multiple_to_other_col   *    	 	 yyDIIu55r:   c                f   a aa VVV 3R  lpS P                  S P                  S P                  V4      # )c                 `   < V S8X  d   SSV3,          # V S8X  d   SSV3,          # SW3,          # r<   rt   )r`   ra   row1row2r6   s   &&r7   r   1MatrixReductions._eval_row_op_swap.<locals>.entry   s9    DyD!G}$dD!G}$:r:   r   )r6   r   r   r   s   fff r7   _eval_row_op_swap"MatrixReductions._eval_row_op_swap   r   r:   c                f   a aa VVV 3R  lpS P                  S P                  S P                  V4      # )c                 H   < V S8X  d   SSW3,          ,          # SW3,          # r<   rt   )r`   ra   r   rowr6   s   &&r7   r   BMatrixReductions._eval_row_op_multiply_row_by_const.<locals>.entry   r   r:   r   )r6   r   r   r   s   fff r7   "_eval_row_op_multiply_row_by_const3MatrixReductions._eval_row_op_multiply_row_by_const   r   r:   c                j   a aaa VVVV 3R  lpS P                  S P                  S P                  V4      # )c                 h   < V S8X  d"   SW3,          SSSV3,          ,          ,           # SW3,          # r<   rt   )r`   ra   r   r   r   r6   s   &&r7   r   FMatrixReductions._eval_row_op_add_multiple_to_other_row.<locals>.entry   s4    CxADzAT1W$555:r:   r   )r6   r   r   r   r   s   ffff r7   &_eval_row_op_add_multiple_to_other_row7MatrixReductions._eval_row_op_add_multiple_to_other_row   r   r:   Nc                    V P                  WW4VR4      w  rr4pVR8X  d   V P                  W#4      # VR8X  d   V P                  WE4      # VR8X  d   V P                  W#V4      # R# )a  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   )r6   r   r   r   r   r   s   &&&&&&r7   elementary_col_op"MatrixReductions.elementary_col_op  s    ( "&!8!8!4QV!W$ =::3BB=))$55?>>stLL r:   c                    V P                  WW4VR4      w  rr4pVR8X  d   V P                  W#4      # VR8X  d   V P                  WE4      # VR8X  d   V P                  W#V4      # R# )a  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   )r6   r   r   r   r   r   s   &&&&&&r7   elementary_row_op"MatrixReductions.elementary_row_op  r   r:   rt   )r   )r   NNNN)rx   ry   rz   r{   r|   r   r   propertyr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r}   r~   r   s   @r7   r   r   o   s     J '.5 ) ! ! & E2( &d:
 )00L&..J ==DL ==DL5&n666666M<M Mr:   r   c                      a  ] tR tRt o RtR
R ltR]3R ltR
R ltR t	]
P                  ]n        ]P                  ]n        ]P                  ]n        ]P                  ]	n        ]! ]	4      t	RtV tR	# )MatrixSubspacesi>  zProvides methods relating to the fundamental subspaces of a matrix.
Should not be instantiated directly. See ``subspaces.py`` for their
implementations.Fc                    \        WR 7      # )rZ   )r   r6   rZ   s   &&r7   columnspaceMatrixSubspaces.columnspaceC  s    D44r:   c                    \        WVR 7      # ))rZ   r4   )r   )r6   rZ   r4   s   &&&r7   	nullspaceMatrixSubspaces.nullspaceF  s    $jIIr:   c                    \        WR 7      # r   )r   r   s   &&r7   rowspaceMatrixSubspaces.rowspaceI  s    11r:   c                     \        V .VO5/ VB # r<   )r    )clsvecskwargss   &*,r7   orthogonalizeMatrixSubspaces.orthogonalizeO  s    c3D3F33r:   rt   NF)rx   ry   rz   r{   r|   r   r   r   r   r   r   r   r   r    classmethodr}   r~   r   s   @r7   r   r   >  sj     5 "'7 J24 )00K&..I%--H*22M'6Mr:   r   c                     a  ] tR tRt o RtRR ltR]3R ltRR ltRR lt	RR lt
RR	 lt]R
 4       t]R 4       t]R 4       t]R 4       t]R 4       tRR ltR tR t]P                  ]n        ]P                  ]n        ]P                  ]n        ]P                  ]	n        ]P                  ]n        ]P                  ]n        ]P                  ]n        ]P                  ]n        ]P                  ]n        ]P                  ]n        ]P                  ]n        ] P                  ]n        ]!P                  ]
n        ]"P                  ]n        Rt#V t$R# )MatrixEigeniZ  zProvides basic matrix eigenvalue/vector operations.
Should not be instantiated directly. See ``eigen.py`` for their
implementations.Tc                    \        V 3R V/VB # )error_when_incomplete)r!   )r6   r   flagss   &&,r7   	eigenvalsMatrixEigen.eigenvals_  s    $U6KUuUUr:   c                "    \        V 3R VRV/VB # )r   r4   )r"   )r6   r   r4   r   s   &&&,r7   
eigenvectsMatrixEigen.eigenvectsb  s)    4 07L 0%0).0 	0r:   c                    \        V 3R V/VB # )
reals_only)r%   )r6   r   r   s   &&,r7   is_diagonalizableMatrixEigen.is_diagonalizablef  s    !$H:HHHr:   c                    \        WVVR 7      # ))r   sort	normalize)r&   )r6   r   r  r  s   &&&&r7   diagonalizeMatrixEigen.diagonalizei  s    Dd#% 	%r:   c                    \        WR 7      # )upper)r#   r6   r  s   &&r7   bidiagonalizeMatrixEigen.bidiagonalizem  s    d00r:   c                    \        WR 7      # r  )r$   r	  s   &&r7   bidiagonal_decomposition$MatrixEigen.bidiagonal_decompositionp  s    (;;r:   c                    \        V 4      # r<   )r'   r=   s   &r7   is_positive_definite MatrixEigen.is_positive_definites      $T**r:   c                    \        V 4      # r<   )r(   r=   s   &r7   is_positive_semidefinite$MatrixEigen.is_positive_semidefinitew      (..r:   c                    \        V 4      # r<   )r)   r=   s   &r7   is_negative_definite MatrixEigen.is_negative_definite{  r  r:   c                    \        V 4      # r<   )r*   r=   s   &r7   is_negative_semidefinite$MatrixEigen.is_negative_semidefinite  r  r:   c                    \        V 4      # r<   )r+   r=   s   &r7   is_indefiniteMatrixEigen.is_indefinite  s    d##r:   c                    \        V 3R V/VB # )calc_transform)r,   )r6   r!  r   s   &&,r7   jordan_formMatrixEigen.jordan_form  s    DJJ6JJr:   c                    \        V 3/ VB # r<   )r-   r6   r   s   &,r7   left_eigenvectsMatrixEigen.left_eigenvects  s    ...r:   c                    \        V 4      # r<   )r.   r=   s   &r7   singular_valuesMatrixEigen.singular_values  s    %%r:   rt   NTr   )FFF)%rx   ry   rz   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.   r#   r$   r}   r~   r   s   @r7   r   r   Z  st    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                   J   a  ] tR tRt o RtRR/R ltR tR tR tR	 t	R
t
V tR# )MatrixCalculusi  z,Provides calculus-related matrix operations.evaluateTc                   ^ RI Hp V! V .VO5RV/ p\        V \        4      '       g   V'       d   VP	                  4       # V# )zCalculate 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
)ArrayDerivativer.  )$sympy.tensor.array.array_derivativesr0  
isinstancer   
as_mutable)r6   r.  argsr   r0  derivs   &$*,  r7   diffMatrixCalculus.diff  s?    * 	I?t?h?$&&8##%%r:   c                .   a V P                  V3R  l4      # )c                 &   < V P                  S4      # r<   r6  )rY   args   &r7   <lambda>1MatrixCalculus._eval_derivative.<locals>.<lambda>  s    sr:   	applyfunc)r6   r;  s   &fr7   _eval_derivativeMatrixCalculus._eval_derivative  s    ~~344r:   c                2   aa V P                  VV3R l4      # )af  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                 (   < V P                   ! S/ SB # r<   )	integrate)rY   r4  r   s   &r7   r<  *MatrixCalculus.integrate.<locals>.<lambda>  s    T(DV(Dr:   r>  )r6   r4  r   s   &jlr7   rD  MatrixCalculus.integrate  s    2 ~~DEEr:   c                  a a \        S\        4      '       g   S P                  S4      oS P                  ^ ,          ^8X  d   S P                  ^,          pM7S P                  ^,          ^8X  d   S P                  ^ ,          pM\	        R4      hSP                  ^ ,          ^8X  d   SP                  ^,          pM7SP                  ^,          ^8X  d   SP                  ^ ,          pM\	        R4      hS P                  W#VV 3R l4      # )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
z)``self`` must be a row or a column matrixz"X must be a row or a column matrixc                 B   < SV ,          P                  SV,          4      # r<   r:  )ra   r`   Xr6   s   &&r7   r<  )MatrixCalculus.jacobian.<locals>.<lambda>  s    DGLL1,>r:   )r2  r/   r   shape	TypeError)r6   rI  mns   ff  r7   jacobianMatrixCalculus.jacobian  s    H !Z((		!A ::a=A

1AZZ]a

1AGHH771:?
AWWQZ1_
A@AA yy>??r:   c                .   a V P                  V3R l4      # )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                 $   < V P                   ! S!  # r<   )limit)rY   r4  s   &r7   r<  &MatrixCalculus.limit.<locals>.<lambda>+  s    r:   r>  )r6   r4  s   &jr7   rS  MatrixCalculus.limit  s    * ~~677r:   rt   N)rx   ry   rz   r{   r|   r6  r@  rD  rO  rS  r}   r~   r   s   @r7   r-  r-    s0     64 85F67@r8 8r:   r-  c                      a  ] tR tRt o Rt]! R4      ]3R ltR tR t	R t
R tRR	 ltR
 tR tR tRR ltRR ltR tR tR tRtV tR# )MatrixDeprecatedi/  z+A class to house deprecated matrix methods.rW   c                &    V P                  VR 7      # ))rY   )r\   r[   s   &&&r7   berkowitz_charpoly#MatrixDeprecated.berkowitz_charpoly1  s    }}q}!!r:   c                &    V P                  RR7      # )zOComputes determinant using Berkowitz method.

See Also
========

det
berkowitz
rv   rR   rh   r=   s   &r7   berkowitz_detMatrixDeprecated.berkowitz_det4  s     xx{x++r:   c                &    V P                   ! R/ VB # )zWComputes eigenvalues of a Matrix using Berkowitz method.

See Also
========

berkowitz
rt   )r   r%  s   &,r7   berkowitz_eigenvals$MatrixDeprecated.berkowitz_eigenvals?  s     ~~&&&r:   c                    V P                   . r!V P                  4        F$  pVP                  WR,          ,          4       V) pK&  	  \        V4      # )zPComputes principal minors using Berkowitz method.

See Also
========

berkowitz
)onerv   appendtuple)r6   signminorspolys   &   r7   berkowitz_minors!MatrixDeprecated.berkowitz_minorsI  sE     xxfNN$DMM$b/*5D % V}r:   c                   ^ RI Hp RpV '       g   V# V P                  '       g   \        4       hY P                  rC^ .V^,
          ,          p\        V^R4       F  pV! V^,           V4      V^,
          rW8RV13,          ) VRV1V3,          rVRV1RV13,          W8V3,          ) rV
.p\        ^ V^,
          4       F!  pVP                  W<V,          ,          4       K#  	  \        V4       F  w  rW,          R,          W&   K  	  V P                  V.V,           p\        V4       F  pVRWm,
          ^,            W}R1V3&   K  	  WuV^,
          &   K  	  V P                  V P                  VR,          ) .4      .p\        V4       F#  w  rVP                  WV,          ,          4       K%  	  V\        \        \        V4      4      ,           # )r   )zerosN))   rc  )r   r   )sympy.matricesrm  	is_squarer   r   rangere  	enumeraterd  r   rf  map)r6   rm  berkAN
transformsrN  Tr   RCaitemsr`   Bpolyss   &               r7   rv   MatrixDeprecated.berkowitzY  s   (K~~~&((YY1SAE]
q!RAQ?AEq!eH9aAhqRaR!V9qAwhqCE1a!e_Qq\* % "%(E4= ) XXqME)E1X !%!),"a%  !"q1u' !* DHHqwh/01j)DALL1X& * eCu-...r:   c                &    V P                  VR 7      # rQ   )re   rT   s   &&r7   cofactorMatrixMatrixDeprecated.cofactorMatrix  s    ##6#22r:   c                    \        V 4      # r<   r5   r=   s   &r7   
det_bareisMatrixDeprecated.det_bareis  rJ   r:   c                &    V P                  RR7      # )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
lurR   r\  r=   s   &r7   det_LU_decomposition%MatrixDeprecated.det_LU_decomposition  s    & xxtx$$r:   c                &    V P                  W!R 7      # ))size
eigenvalue)jordan_block)r6   eigenvalrN  s   &&&r7   jordan_cellMatrixDeprecated.jordan_cell  s      a ==r:   c                H    V P                  4       w  r#W#P                  4       3# r<   )r"  get_diag_blocks)r6   calc_transformationPJs   &&  r7   jordan_cellsMatrixDeprecated.jordan_cells  s$    !##%%%r:   c                (    V P                  WVR 7      # rQ   )rn   r_   s   &&&&r7   
minorEntryMatrixDeprecated.minorEntry  s    zz!vz..r:   c                $    V P                  W4      # r<   )rr   rq   s   &&&r7   minorMatrixMatrixDeprecated.minorMatrix  s    ##A))r:   c                (    V P                  VRR7      # )zEPermute the rows of the matrix with the given permutation in reverse.backward	directionpermute_rowsr6   perms   &&r7   permuteBkwdMatrixDeprecated.permuteBkwd  s       <<r:   c                (    V P                  VRR7      # )z:Permute the rows of the matrix with the given permutation.forwardr  r  r  s   &&r7   
permuteFwdMatrixDeprecated.permuteFwd  s       ;;r:   rt   Nru   r+  )rx   ry   rz   r{   r|   r   r	   rY  r]  r`  rj  rv   r  r  r  r  r  r  r  r  r  r}   r~   r   s   @r7   rW  rW  /  s]     5#(?Y "	,' &/P3"%*>&/*=< <r:   rW  N)zMatrixEigen.is_indefinitez MatrixEigen.is_negative_definitez$MatrixEigen.is_negative_semidefinitez MatrixEigen.is_positive_definitez$MatrixEigen.is_positive_semidefinite)>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.   
matrixbaser/   __doctest_requires__r2   r   r   r   r-  rW  rt   r:   r7   <module>r     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:   