!if $character>0
 !set modulo=<br></b>(modulo $character)
!endif

!if $error=$empty
 !if $step<1
  Here you have your starting matrices. Your goal is to modify the matrices
  by operations on the rows, to transform the matrix at the left into the 
  identity matrix; in this case the matrix at the right will become the 
  inverse matrix of the one presented here at the left.
 !else
  After <font color=green>$desc</font>, 
  the matrices (step $step) become:
 !endif
!else
 Step $step:
!endif

<p>
<center><table border=0>
!if $size<=3
 <tr><td><th colspan=$size>Principal<br>matrix$modulo</th>
 <td colspan=3><th colspan=$size>Reference<br>matrix$modulo</th>
!else
 <tr><td><th colspan=$size>Principal matrix$modulo</th>
 <td colspan=3><th colspan=$size>Reference matrix$modulo</th>
!endif
<tr><td colspan=$[$size+2]><hr></td><td><td colspan=$[$size+2]><hr></td>
!for i=1 to $size
 !set row=!line $i of $pmatrix
 !set rrow=!line $i of $preference
 <tr>
 !if $i=1
  <td rowspan=$size>$(m_leftpar$size)</td>
 !endif
 !for j=1 to $size
  !set c=!item $j of $row
  <td align=center nowrap>
  !if $i isitemof $(col$j) and $click=yes
   !href cmd=reply&modif=auto&origin=$i&dest=$j $c
</td>
  !else
   $c</td>
  !endif
 !next j
 !if $i=1
  <td rowspan=$size>$(m_rightpar$size)</td>
 !endif
 <td nowrap>&nbsp;&nbsp;&nbsp;
 !if $i<$size and $click=yes
  !href cmd=reply&modif=exchange&origin=$i&dest=$[$i+1] ($i)
 !else
  ($i)
 !endif
 &nbsp;&nbsp;&nbsp;</td>
 !if $i=1
  <td rowspan=$size>$(m_leftpar$size)</td>
 !endif
 !for j=1 to $size
  !set c=!item $j of $rrow
  <td align=center nowrap>&nbsp;$c&nbsp;</td>
 !next j
 !if $i=1
  <td rowspan=$size>$(m_rightpar$size)</td>
 !endif
!next i
</table></center>

