In Wikipedia's example of SNF$(xI-A)$, the purpose is to determine whether two matrices over a field are similar by computing the Smith normal forms of their characteristic matrices. The field might, for example, be the rational numbers. In that case, the elements of the characteristic matrix live in the ring of polynomials with rational coefficients. The units in this ring, i.e. the elements that have inverses, are the nonzero rational numbers. So in this case you are allowed to multiply rows or columns by nonzero rational numbers. You just can't multiply rows or columns by polynomials of nonzero degree, since they don't have inverses in the ring. But you would be allowed, for example, to multiply row 1 of the matrix by $1/2$. Then, by adding a suitable multiple of column 2 to column 1, and a suitable multiple of row 1 to row 2, you can obtain the result Wikipedia gives, up to permutation.
In general, the operations you are allowed to do are
- Permute rows.
- Multiply a row by a unit (invertible element) of the ring. (In the ring of integers this means only $\pm1$, but in a ring of polynomials over a field, it could be any nonzero field element.)
- Add a multiple of an row to another row.
- Do any of the corresponding column operations.
Note that you cannot always clear the first row and column in a single pass. In a Euclidean domain, you can, by suitable row operations, bring the GCD of the first column into the (1,1) position and clear the remainder of the column. Then by suitable column operations, you can bring the GCD of the first row into the (1,1) position and clear the remainder of the row. But at that point the first column may no longer be cleared, so you may have to repeat the process. It is guaranteed that, in finitely many steps, you will end up with both the first row and column cleared. (Think about why.) By an iterative process, you eventually reach diagonal form. The diagonal elements may not satisfy the divisibility requirements of the SNF, however. That can always be fixed by suitable operations involving pairs of diagonal elements. For example,
$$
\begin{aligned}
\begin{bmatrix}
18 & 0\\0 & 30
\end{bmatrix}&\sim
\begin{bmatrix}
18 & 18\\0 & 30
\end{bmatrix}\sim
\begin{bmatrix}
18 & 18\\-18 & 12
\end{bmatrix}\sim
\begin{bmatrix}
36 & 18\\-6 & 12
\end{bmatrix}\sim
\begin{bmatrix}
0 & 90\\-6 & 12
\end{bmatrix}\sim
\begin{bmatrix}
0 & 90\\-6 & 0
\end{bmatrix}\\
&\sim\begin{bmatrix}
-6 & 0\\0 & 90
\end{bmatrix}
\sim\begin{bmatrix}
6 & 0\\0 & 90
\end{bmatrix}
\end{aligned}
$$
You want to find row/column operation for which your initial matrix looks like this
\begin{equation*} \begin{pmatrix}a_1 & 0 \\0&a_2 \\0&0 \end{pmatrix}\end{equation*}
and $a_1\mid a_2$. According to Wikipedia this numbers are unique up to multiplication by a unit, and they can be found by using the formula $a_i =\frac{d_i(A)}{d_{i-1}(A)}$, where $d_i(A)$ is the greatest common divisor of all $i\times i$ minor of you matrix.
Moreover according to
this thread you are only allowed to
- interchange two rows or two columns,
- multiply a row or column by $\pm1$ (which are the invertible elements in $\mathbf{Z}$),
- add an integer multiple of row to another row (or an integer multiple of a column to another column).
Let us compute $a_1$. As you can see the greatest common divisor of all $1\times 1$ minor of your matrix is $2$, so we will have $a_1 =2$ once the algorithm is over.
To find $a_2$ you need to compute all the $2\times 2$ minor of your matrix, and you should get $d_2(A)= GCD(-24,108,96)=12$, so $a_2 = \frac{12}{2}=6$.
Now we should find operations that respects 1.,2.,3. such that the final matrix is
$$\begin{pmatrix}2&0\\0&6\\0&0\end{pmatrix}$$
This is done in the following way (I can try it by yourself, and you should get the same solution also with other operations, because $a_1,a_2$ are unique up to multiplication by unit):
\begin{align*}
\begin{pmatrix} 6&-6 \\-6&-12\\4&-8\end{pmatrix} &\overset{Ir-IIIr; \, IIr + IIIr}{\leadsto} \begin{pmatrix} 2&2\\-2&-20\\4&-8\end{pmatrix} \\
\overset{IIc-Ic}{\leadsto}\begin{pmatrix}2&0\\-2&-18\\4&-12\end{pmatrix} &\overset{IIr+Ir;\, IIIr-2Ir}{\leadsto} \begin{pmatrix}2&0\\0&-18\\0&-12\end{pmatrix} \\
\overset{IIr-IIIr}{\leadsto}\begin{pmatrix} 2&0\\0&-6\\0&-12\end{pmatrix}&\overset{IIIr-2IIr}{\leadsto}\begin{pmatrix}2&0\\0&-6\\0&0\end{pmatrix}
\end{align*}
Now you can mulitply by $-1$ the second row.
Best Answer
$$\begin{pmatrix}-9 & 6 \\ 5 & -2 \\ 6 & 3\end{pmatrix}\to\begin{pmatrix}2 & -5 \\ 6 & -9 \\ 3 & 6\end{pmatrix}\to \begin{pmatrix}2 & -5 \\ 0 & 6 \\ 1 & 11\end{pmatrix}\to\begin{pmatrix}1 & 11 \\ 0 & 6 \\ 0 & -27\end{pmatrix}\to\begin{pmatrix}1 & 0 \\ 0 & 6 \\ 0 & 3\end{pmatrix}\to\begin{pmatrix}1 & 0 \\ 0 & 3 \\ 0 & 0\end{pmatrix}$$ Rearrange rows and columns, reduce, rearrange again, reduce (twice), rearrange and reduce.