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

Function radicalmodpbase

Singular/dyn_modules/Order/nforder.cpp:446–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444// similar, expand the multring to deal with ideals
445
446bigintmat *radicalmodpbase(nforder *o, number p, coeffs c) {
447
448 number dimen = n_Init(o->getDim(), o->basecoeffs());
449 int n = o->getDim();
450
451 bigintmat *m, *bas;
452 // Berechnet F_p-Basis von I_p/pI_p (Radical mod p)
453 // Dazu:
454 if (n_Greater(p, dimen, c)) {
455 // Falls Primzahl größer gleich Dimension der Ordnung, so berechne Kern der Spurmatrix modulo p.
456 // also works it p is no prime.
457 m = o->traceMatrix();
458 bas = new bigintmat(n, 1, o->basecoeffs());
459 } else {
460 // Sonst: Berechne Kern der Abbildung x -> x^(p^j) mod p, wobei j>0 mit p^j >= dimension
461 int j = 1;
462 // ex als number, oder reicht long long int?
463 // Finde j von oben und berechne p^j
464 number ex = n_Init(1, o->basecoeffs());
465 number temp;
466 while (n_Greater(dimen, ex, o->basecoeffs())) {
467 temp = n_Mult(ex, p, o->basecoeffs());
468 n_Delete(&ex, o->basecoeffs());
469 ex = temp;
470 j++;
471 }
472
473 // Berechne Abbildungsmatrix der oben genannten Abbildung und speichere diese in m (genauere Erklärung dazu: Siehe multmap())
474 m = new bigintmat(n, n, o->basecoeffs());
475 bas = new bigintmat(n, 1, o->basecoeffs());
476 bigintmat *prod = new bigintmat(n, 1, o->basecoeffs());
477
478 number klauf;
479 number eins = n_Init(1, o->basecoeffs());
480
481 for (int i=1; i<=n; i++) {
482 basis_elt(bas, i);
483 prod->copy(bas);
484 klauf = n_Init(1, o->basecoeffs());
485 for (; n_Greater(ex, klauf, o->basecoeffs());) {
486 o->elMult(prod, bas);
487 prod->mod(p);
488 temp = n_Add(klauf, eins, o->basecoeffs());
489 n_Delete(&klauf, o->basecoeffs());
490 klauf = temp;
491 }
492 n_Delete(&klauf, o->basecoeffs());
493 m->setcol(i, prod);
494 }
495
496 delete prod;
497 n_Delete(&ex, o->basecoeffs());
498 n_Delete(&eins, o->basecoeffs());
499
500 }
501
502 bigintmat *kbase = new bigintmat(n, n, o->basecoeffs());
503

Callers 1

onestepFunction · 0.85

Calls 15

n_InitFunction · 0.85
n_GreaterFunction · 0.85
n_MultFunction · 0.85
n_DeleteFunction · 0.85
basis_eltFunction · 0.85
n_AddFunction · 0.85
kernbaseFunction · 0.85
getDimMethod · 0.80
traceMatrixMethod · 0.80
elMultMethod · 0.80
modMethod · 0.80
setcolMethod · 0.80

Tested by

no test coverage detected