| 194 | } |
| 195 | |
| 196 | bigintmat *nforder::traceMatrix() { |
| 197 | bigintmat *m = new bigintmat(dimension, dimension, basecoeffs()); |
| 198 | bigintmat *base1 = new bigintmat(dimension, 1, basecoeffs()); |
| 199 | bigintmat *base2 = new bigintmat(dimension, 1, basecoeffs()); |
| 200 | bigintmat *mm = new bigintmat(dimension, dimension, basecoeffs()); |
| 201 | number sum; |
| 202 | |
| 203 | for (int i=1; i<=dimension; i++) { |
| 204 | for (int j=i; j<=dimension; j++) { |
| 205 | // Berechnet Produkt von Basiselementen i und j und speichert es in base1 |
| 206 | basis_elt(base1, i); |
| 207 | basis_elt(base2, j); |
| 208 | elMult(base1, base2); |
| 209 | // Schreibt Abbildungsmatrix der Multiplikation mit base1 in mm |
| 210 | sum = elTrace(base1); |
| 211 | m->set(i, j, sum, basecoeffs()); |
| 212 | if (i!=j) |
| 213 | m->set(j, i, sum, basecoeffs()); |
| 214 | n_Delete(&sum, basecoeffs()); |
| 215 | } |
| 216 | } |
| 217 | delete base1; |
| 218 | delete base2; |
| 219 | delete mm; |
| 220 | return m; |
| 221 | } |
| 222 | //////////////////////////////////// |
| 223 | ////// Öffentliche Funktionen ////// |
| 224 | //////////////////////////////////// |
no test coverage detected