MCPcopy Create free account
hub / github.com/Singular/Singular / traceMatrix

Method traceMatrix

Singular/dyn_modules/Order/nforder.cpp:196–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196bigintmat *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////////////////////////////////////

Callers 1

radicalmodpbaseFunction · 0.80

Calls 3

basis_eltFunction · 0.85
n_DeleteFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected