+
    i                     ^    ^ RI Ht ^ RIHt ^ RIHt ^ RIHt R t ! R R]4      t	R t
R	 tR
# )    )
MatrixExpr)Basic)Tuple)floorc                     \        V \        4      '       d$   V P                  V P                  V P                  3p \        V \
        \        \        34      '       g   V ^ 8  R8X  d	   W,          p W ^,           ^3p \        V 4      p \        V 4      ^8X  d   V P                  ^4       V w  r#pT;'       g    ^ pVf   TpV^ 8  R8X  d	   W!,          pV^ 8  R8X  d	   W1,          pT;'       g    ^pW2,
          V,          ^8  R8X  d   \        4       hW#V3# r   T)
isinstanceslicestartstopsteptuplelistr   lenappend
IndexError)i
parentsizer   r   r   s   &&   ڀ/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/matrices/expressions/slice.py	normalizer      s    !UWWaffaff%a%u-..Ed?OA!QKQA
1v{	EJJQE|	dqT991D	!d*l    c                      a  ] tR t^t o Rt]! R 4      t]! R 4      t]! R 4      tR t	]R 4       t
R t]R 4       tR	tV tR
# )MatrixSliceaF  A MatrixSlice of a Matrix Expression

Examples
========

>>> from sympy import MatrixSlice, ImmutableMatrix
>>> M = ImmutableMatrix(4, 4, range(16))
>>> M
Matrix([
[ 0,  1,  2,  3],
[ 4,  5,  6,  7],
[ 8,  9, 10, 11],
[12, 13, 14, 15]])

>>> B = MatrixSlice(M, (0, 2), (2, 4))
>>> ImmutableMatrix(B)
Matrix([
[2, 3],
[6, 7]])
c                (    V P                   ^ ,          # )r   argsselfs   &r   <lambda>MatrixSlice.<lambda>4   s    499Q<r   c                (    V P                   ^,          #    r   r   s   &r   r   r    5       TYYq\r   c                (    V P                   ^,          #    r   r   s   &r   r   r    6   r$   r   c           	     P   \        W!P                  ^ ,          4      p\        W1P                  ^,          4      p\        V4      \        V4      u;8X  d   ^8X  g    \        4       h \        4       h^ V^ ,          8  R8X  gV   VP                  ^ ,          V^,          8  R8X  g4   ^ V^ ,          8  R8X  g#   VP                  ^,          V^,          8  R8X  d   \        4       h\	        V\
        4      '       d   \        WV4      # \        P                  ! W\        V!  \        V!  4      # r   )
r   shaper   r   r	   r   mat_slice_of_slicer   __new__r   )clsparentrowslicecolslices   &&&&r   r+   MatrixSlice.__new__8   s    X||A7X||A7HX3!3, 4,!_%\\!_x{*t3!_%\\!_x{*t3,fk**%fAA}}S%*:E8<LMMr   c                   V P                   ^,          V P                   ^ ,          ,
          pV P                   ^,          ^8X  d   TM!\        WP                   ^,          ,          4      pV P                  ^,          V P                  ^ ,          ,
          pV P                  ^,          ^8X  d   TM!\        W P                  ^,          ,          4      pW3# r"   )r.   r   r/   )r   rowscolss   &  r   r)   MatrixSlice.shapeF   s    }}Q$--"22}}Q'1,t%]]1=M8M2N}}Q$--"22}}Q'1,t%]]1=M8M2Nzr   c                    V P                   P                  ! WP                  ^,          ,          V P                  ^ ,          ,           W P                  ^,          ,          V P                  ^ ,          ,           3/ VB # r&   )r-   _entryr.   r/   )r   r   jkwargss   &&&,r   r6   MatrixSlice._entryN   sZ    {{!!!MM!$4"4t}}Q7G"G"#MM!$4"4t}}Q7G"G,$*, 	,r   c                4    V P                   V P                  8H  # N)r.   r/   r   s   &r   on_diagMatrixSlice.on_diagS   s    }}--r    N)__name__
__module____qualname____firstlineno____doc__propertyr-   r.   r/   r+   r)   r6   r<   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s`     ( /0F12H12HN  ,
 . .r   r   c                     V w  r#pVw  rVpW%V,          ,           pWG,          p	W$V,          ,           p
W8  d   \        4       hWV	3# r;   )r   )ststart1stop1step1start2stop2step2r   r   r   s   &&         r   slice_of_slicerQ   X   sM    F5F5E\!E=D%KD|lr   c                    \        V P                  V4      p\        V P                  V4      p\        V P                  W44      # )zCollapse nested matrix slices

>>> from sympy import MatrixSymbol
>>> X = MatrixSymbol('X', 10, 10)
>>> X[:, 1:5][5:8, :]
X[5:8, 1:5]
>>> X[1:9:2, 2:6][1:3, 2]
X[3:7:2, 4:5]
)rQ   r.   r/   r   r-   )r-   r.   r/   rowcols   &&&  r   r*   r*   f   s5     (
3C
(
3Cv}}c//r   N)"sympy.matrices.expressions.matexprr   sympy.core.basicr   sympy.core.containersr   #sympy.functions.elementary.integersr   r   r   rQ   r*   r>   r   r   <module>rY      s-    9 " ' 526.* 6.r0r   