| 187 | |
| 188 | |
| 189 | void SNF_Step(matrix& S,matrix& V) |
| 190 | { |
| 191 | //cout << "Entering SNF_Step " << endl; |
| 192 | //print(S); cout << endl; print(V); |
| 193 | int m=S.size(); |
| 194 | matrix U2,V2; |
| 195 | while (!IsDiag(S)) |
| 196 | { //cout << "\n\nColumn Reducing...\n"; |
| 197 | HNF(S,V2,S); |
| 198 | S=transpose(S); |
| 199 | V=Mul(V,V2); |
| 200 | //cout << "\n\nRow Reducing...\n"; |
| 201 | ident(U2,m); |
| 202 | HNF(S,U2,S); |
| 203 | S=transpose(S); |
| 204 | //cout << "Step " << endl; |
| 205 | //print(S); cout << endl; print(V); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | |
| 210 |