My Project
Loading...
Searching...
No Matches
nforder.cpp
Go to the documentation of this file.
1#include "coeffs/bigintmat.h"
2#include "nforder.h"
3#include "reporter/reporter.h"
4#include "coeffs/numbers.h"
5#include "coeffs/coeffs.h"
6#include "Singular/ipid.h"
7
8
9
10
11////////////////////////////////////
12//// Konstruktoren/Destruktoren ////
13////////////////////////////////////
14
15/*________________0_______________*/
17 rc = 1;
18 // Gibt es eine Multtable, so gibt es keine Baseorder
20 basis = NULL;
21 // Discriminante wird erst berechnet, wenn sie benötigt wird
23 divisor = NULL;
24 flags = 0;
26 m_coeffs = NULL;
28}
29
31 init();
32 m_coeffs = q;
33 dimension = dim;
34 multtable = (bigintmat**)(omAlloc(dim*sizeof(bigintmat*)));
35 for (int i=0; i<dim; i++) {
36 multtable[i] = new bigintmat(m[i]);
37 }
38 basis = NULL;
40}
41
42nforder::nforder(nforder *o, bigintmat *base, number div, const coeffs q) {
43 init();
44 m_coeffs = q;
45 basis = new bigintmat(base);
46 //neue Ordnung erzeugen und übergebene Daten kopieren
47 baseorder = o;
49 //Gibt es eine Baseorder, brauchen wir keine Multtable. Könnte aber evtl. generiert werden
53 dimension = o->getDim();
55
56 inv_basis = new bigintmat(base->rows(), base->rows(), q);
60}
61
63 init();
64 m_coeffs = o->basecoeffs();
65 ::Print("copy called: %lx\n", (long unsigned int) m_coeffs);
66 // Kopiert die Daten der übergebenen Ordnung auf die erzeugte
67 if (o->discriminant)
69 // get-Funktionen liefern immer nur Kopien der Attribute zurück
70 dimension = o->getDim();
72 if (!o->getMult(multtable)) {
75 }
76 baseorder = o->getBase();
78 basis = o->getBasis();
79 if (o->divisor)
81 if (o->inv_basis) {
84 }
85}
86
88 StringAppend("Order:\nof dimension %d and rc: %d\n", dimension, ref_count());
90 StringAppend("and discriminant: ");
92 StringAppend("\n");
93 }
94// coeffs
95 if (multtable) {
96 StringAppend("Multiplication table:\n");
97 for(int i=0; i<dimension; i++) {
98 StringAppend("%d: ", i);
99 multtable[i]->Write();
100 StringAppendS("\n");
101 }
102 }
103
104 if (baseorder) {
105 StringAppendS("as extension of:");
106 baseorder->Write();
107 StringAppendS("with basis:\n");
108 basis->Write();
109 StringAppendS("and denominator: ");
111 StringAppendS("\nwith inv_basis:\n");
112 inv_basis->Write();
113 StringAppendS("and inv_denominator: ");
115 StringAppendS("\n");
116 }
117
118 StringAppend("Flags: %lx\n", flags);
119}
120
122 StringSetS("");
123 Write();
124 return StringEndS();
125}
127 char * s = String();
128 PrintS(s);
129 PrintS("\n");
130 omFree(s);
131}
133 if (o->ref_count_decref()>0) {
134 return;
135 }
136 delete o;
137}
138
140 if (multtable != NULL) {
141 for (int i=0; i<dimension; i++)
142 delete multtable[i];
144 }
145 else
146 {
147 // andernfalls werden baseorder und basis gelöscht
149 delete basis;
151 if (inv_basis) delete inv_basis;
153 }
155}
156
157/*
158////////////////////////////////////
159//////// Private Funktionen ////////
160///////////////////////////////////*/
161/*_______________-1_______________ */
163 // Determinante von Spurmatrix ist die Discriminante
164 if (discriminant) return;
165 if (baseorder == NULL) {
167 discriminant = m->det();
169 delete m;
170 }
171 else
172 {
173 number prod = n_Init(1, basecoeffs());
174 number tmp, tmp2; //assumes that the basis is triangular!
175 for (int i=1; i<=dimension; i++) {
176 tmp2 = basis->view(i, i);
177 tmp = n_Mult(prod, tmp2, basecoeffs());
179 prod = tmp;
180 }
182 number disc = baseorder->viewDisc();
183 assume(disc);
184 number detquad = n_Mult(prod, prod, basis->basecoeffs());
185 discriminant = n_Mult(disc, detquad, basecoeffs());
186
187 for (int i=1; i<=2*dimension; i++) {
190 discriminant = tmp;
191 }
192 n_Delete(&detquad, basis->basecoeffs());
193 }
194}
195
198 bigintmat *base1 = new bigintmat(dimension, 1, basecoeffs());
199 bigintmat *base2 = new bigintmat(dimension, 1, 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////////////////////////////////////
225
226/*_____________+1_______________ */
228 // Falls Discriminante bisher noch nicht berechnet wurde, berechne diese
230 calcdisc();
231 }
232 return n_Copy(discriminant, basecoeffs());
233}
234
236 return dimension;
237}
238
240 // Falls basis ein NULL-Pointer ist, liefere NULL zurück, andernfalls liefere eine Kopie von basis
241 if (basis == NULL)
242 return NULL;
243 bigintmat *m = new bigintmat(basis); //wenn Fehler dann hier
244 return m;
245}
247 if (basis == NULL)
248 return NULL;
249 return basis;
250}
252 // Falls multtable ein NULL-Pointer ist, liefere NULL zurück, andernfalls erzeuge neues Array of Matrix, kopiere die Matrizen aus multtable dort hinein, und gib es zurück
253 if (multtable == NULL) {
254 return false;
255 }
256 for (int i=0; i<dimension; i++)
257 {
258 m[i] = new bigintmat(multtable[i]);
259 }
260 return true;
261}
262
263
265 return n_Copy(divisor, basecoeffs());
266}
267
269 // returns the baseorder, if present. Does not incref the ref count.
270 if (baseorder == NULL)
271 return NULL;
272 return baseorder;
273}
274
276 coeffs c = basecoeffs();
277 if (!baseorder || !baseorder->baseorder) {
279 return this;
280 }
281 nforder * O = baseorder;
282 number den = n_Copy(divisor, c);
283 bigintmat *bas = getBasis();
284 while (O->baseorder) {
285 bigintmat * b = bimMult(bas, O->viewBasis());
286 n_InpMult(den, O->divisor, c);
287 O = O->baseorder;
288 delete bas;
289 bas = b;
290 }
291 nforder * res = new nforder(O, bas, den, c);
292 if (discriminant)
293 res->discriminant = n_Copy(discriminant, c);
294
295 //TODO: copy multtable if we have it
296 delete bas;
297 n_Delete(&den, c);
298 return res;
299}
300
302 if ((a->cols() != 1) || (a->rows() != dimension) || (b->cols() != 1) || (b->rows() != dimension)) {
303 Werror("Error in elSub");
304 }
305 else {
306 a->add(b);
307 }
308}
309
310
312 if ((a->cols() != 1) || (a->rows() != dimension) || (b->cols() != 1) || (b->rows() != dimension)) {
313 // Kein Zeilenvektor der korrekten Größe
314 Werror("Error in elSub");
315 }
316 else {
317 a->sub(b);
318 }
319}
320
322 if ((a->cols() != 1) || (a->rows() != dimension) || (b->cols() != 1) || (b->rows() != dimension)) {
323 // Kein Zeilenvektor der korrekten Größe
324 Werror("Error in elMult");
325 }
326
327 coeffs C = a->basecoeffs();
328 assume(C == b->basecoeffs());
329 assume(C == this->basecoeffs());
330
331 if (multtable != NULL) {
332 // Multiplikation mit Hilfe von Multiplikationstabelle
333 // Zu Grunde liegende Formel: Basis w_i; Für alpha = sum a_i*w_i und beta = sum b_i*w_i gilt:
334 // alpha*beta = sum sum a_i*b_j*w_i*w_j
335 bigintmat *sum = new bigintmat(dimension, 1, C);
336 bigintmat *tmp = new bigintmat(dimension, 1, C);
337 number ntmp;
338
339 for (int i=1; i<=dimension; i++) {
340 // Laufe mit i durch Basiselemente
341 for (int j=1; j<=dimension; j++) {
342 // Laufe mit j durch Basiselemente
343 // Speichere Produkt von Basiselem. i mit Basiselem. j als Koeff.vektor in tmp
344
345 multtable[i-1]->getcol(j, tmp);
346 // Multipliziere ihn mit a[i] und b[j]
347 ntmp = n_Mult(a->view(i, 1), b->view(j, 1), C);
348 tmp->skalmult(ntmp, C);
349
350 n_Delete(&ntmp, C);
351 // und addiere alles auf
352 sum->add(tmp);
353 }
354 }
355 delete tmp;
356 // Am Ende überschreibe a mit dem Ergebnis
357 for (int i=0; i<dimension; i++)
358 a->set(i+1, 1, sum->get(i+1, 1));
359 delete sum;
360 } else {
361 // Multiplikation mit hilfe von baseorder:
362 bigintmat *sumb = new bigintmat(dimension, 1, C);
363 // Produkt von a (b) mit basis liefert Koeff-Vektor von a*divisor (b*divisor) in baseorder
364 bimMult(basis, a, a);
365 bimMult(basis, b, sumb);
366 // Multipliziere Elemente in baseorder (und speichere in suma)
367 baseorder->elMult(a, sumb);
368 delete sumb;
369 a->skaldiv(divisor);
370 bimMult(inv_basis, a, a);
372 a->skaldiv(divisor);
373 }
374}
375
376
377//TODO: compute the trace from the mult-table without
378// the explicit rep_mat
380{
381 bigintmat * rep_mat = elRepMat(a);
382 number t = rep_mat->trace();
383 delete rep_mat;
384 return t;
385}
386
388{
389 bigintmat * rep_mat = elRepMat(a);
390 number n = rep_mat->det();
391 delete rep_mat;
392 return n;
393}
394
396{
398 multmap(a, b);
399 return b;
400}
401
402//CF: TODO if multtable, then use lin. comb. of multtable
403//rather than poducts. reduces complexity by a magnitude.
405 if ((m->cols() != dimension) || (m->rows() != dimension)) {
406 Werror("Error in multmap");
407 return;
408 }
409 bigintmat *bas = new bigintmat(dimension, 1, basecoeffs());
410 for (int i=1; i<=dimension; i++) {
411 // Durchläuft alle Basiselemente
412 // Multipliziert i-tes Basiselement mit a
413 basis_elt(bas, i);
414 elMult(bas, a);
415 // Schreibt Ergebnis in i-te Zeile der Matrix m. Am Ende ist m dann die Abbildungsmatrix der Multiplikation mit a
416 m->setcol(i, bas);
417 }
418 delete bas;
419}
420
421/*________________1_______________ */
422void basis_elt(bigintmat *m, int i) {
423 if (((m->rows() == 1) && (i <= m->cols())) || ((m->cols() == 1) && (i <= m->rows()))) {
424 // Falls m Zeilen- oder Spaltenvektor ist, setze alle Einträge auf 0 und Eintrag i auf 1 (Koeff-Vektor des i-ten Basiselements)
425 number t1 = n_Init(0,m->basecoeffs());
426 for (int j=0; ((j<m->rows()) || (j<m->cols())); j++) {
427 m->set(j, t1);
428
429 }
430 n_Delete(&t1,m->basecoeffs());
431 number t2 = n_Init(1,m->basecoeffs());
432 m->set(i-1, t2);
433 n_Delete(&t2,m->basecoeffs());
434 }
435 else
436 Werror("Error in basis_elt. Not a vector.");
437}
438
439////////////////////////////////////
440//////////// 2 Round 2 /////////////
441////////////////////////////////////
442//TODO: make the radical a proper ideal rather than a matrix
443// or at least, provide an ideal based interface
444// similar, expand the multring to deal with ideals
445
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
504 // Speichere Basiselemente von Kern der Matrix m (Spurmatrix oder Abbildungsmatrix, je nach if-else-Fall) (von Z/pZ -> Z/pZ) in kbase (ersten kdim Spalten bilden Basis)
505 int kdim = kernbase(m, kbase, p, c);
506 // Schreibe für jedes i=1,, .., dimension p*(i-tes Basiselement) als Spalten in Matrix gen, dahinter die oben errechnete Basis vom Kern
507 // Wir erhalten (als Spalten) ein Erzeugendensystem vom Kern von Z->Z/pZ: x->x^(p^j)
508 bigintmat *gen = new bigintmat(n, n+kdim, o->basecoeffs());
509
510 for (int i=1; i<=n; i++) {
511 basis_elt(bas, i);
512 bas->skalmult(p, c);
513 gen->setcol(i, bas);
514 }
515 for (int i=1; i<=kdim; i++) {
516 kbase->getcol(i, bas);
517 gen->setcol(i+n, bas);
518 }
519
520 // HNF auf EZS anwenden liefert (als letzten dimension Spalten) eine Basis des Kerns
521 gen->hnf();
522 bigintmat *tmp = new bigintmat(n, 1, o->basecoeffs());
523 bigintmat *nbase = new bigintmat(n, n, o->basecoeffs());
524 // Schreibe diese als Spalten in nbase und gib nbase zurück
525 for (int i=1; i<=n; i++) {
526 gen->getcol(gen->cols()-n+i, tmp);
527 nbase->setcol(i, tmp);
528 }
529
530 n_Delete(&dimen, o->basecoeffs());
531 delete m;
532 delete bas;
533 delete kbase;
534 delete gen;
535 delete tmp;
536 return nbase;
537
538}
539
541 bigintmat * n = b->transpose(), *m;
542// for(int i=1; i<= n->rows() /2; i++)
543// n->swaprow(i, n->rows()-i+1);
544// TODO: needs probable more row&column swapping.
545 n->hnf();
546 m = n->transpose();
547 b->copy(m);
548 delete n;
549 delete m;
550}
551
552#ifdef HAVE_RINGS
553number multring(bigintmat *nbase, nforder *o, number p) {
554 coeffs R = o->basecoeffs();
555 number divi;
556 int n = o->getDim();
557
558 bigintmat *inv = new bigintmat(n, n, R);
559 divi = nbase->pseudoinv(inv);
560
561 // Zusammenbau der "langen" Matrix
562 bigintmat *lon = new bigintmat(n, 0, R);
563 bigintmat *oldlon;
564 bigintmat *mm = new bigintmat(n, n, R);
565 bigintmat *temp = new bigintmat(n, 1, R);
566 bigintmat *nochnetemp = new bigintmat(n, n, R);
567
568 for (int i=1; i<=n; i++) {
569 nbase->getcol(i, temp);
570 o->multmap(temp, mm);
571 bimMult(inv, mm, nochnetemp);
572 mm->copy(nochnetemp);
573 mm->inpTranspose();
574 oldlon = lon;
575 lon = new bigintmat(n, (i)*n, o->basecoeffs());
576 lon->concatcol(oldlon, mm);
577 delete oldlon;
578 }
579
580 lon->skaldiv(divi);
581
582 bigintmat * red;
583 if (1) {
584 bigintmat * cmp = lon->modhnf(p, o->basecoeffs());
585 red = cmp;
586 } else {
587 lon->hnf();
588 red = new bigintmat(n, n, o->basecoeffs());
589 lon->getColRange((n-1)*n+1, n, red);
590 }
591 delete lon;
592 red->inpTranspose();
593
594 number divisor = red->pseudoinv(nbase);
595 nbase->hnf();
596
597 delete inv;
598 delete mm;
599 delete temp;
600 delete red;
601 delete nochnetemp;
602 n_Delete(&divi, o->basecoeffs());
603 return divisor;
604}
605#endif
606
607#ifdef HAVE_RINGS
608nforder *onestep(nforder *o, number p, coeffs c) {
609 // Berechne F_p-Basis von I_p/pI_p
610 bigintmat *basis;
611 basis = radicalmodpbase(o, p, c);
612
613
614 // Bestimme Basis vom Ring der Multiplikatoren (speicher diese in basis), und Nenner davon (in divisor)
615 number divisor = multring(basis, o, p);
616 // Erzeuge neue Ordnung, der o zu Grunde liegt, mit Basis basis und Nenner divisor
617 if (basis->isOne() && n_IsOne(divisor, c)) {
618 delete basis;
619 n_Delete(&divisor, c);
620 return o;
621 }
622
623 nforder *no = new nforder(o, basis, divisor, c);
624
625 delete basis;
626 n_Delete(&divisor, c);
627 return no;
628}
629#endif
630
631#ifdef HAVE_RINGS
632nforder *pmaximal(nforder *o, number p) {
633 coeffs c = o->basecoeffs();
634 nforder *no = o;
635 nforder *otemp;
636 // TODO: check if p^2 still divides disc (maybe in onestep)
637 // simplify the tower
638 do {
639 otemp = no;
640 no = onestep(otemp, p, c);
641 if (no==otemp)
642 break;
643 nforder_delete (otemp);
644 otemp = no->simplify();
645 nforder_delete (no);
646 no = otemp;
647 } while (1);
648 return no;
649}
650#endif
651
652/*
653// Zum Round2 fehlt noch die Faktorisierung der Diskriminante. Daher auch noch nicht getestet
654nforder *round2(nforder *o) {
655 nforder *otemp = new nforder(o,basecoeffs());
656 number p = otemp->getsmallestsqprime(); // Benötigt kleinste Primzahl, die die Disc. quadratisch teilt
657 nforder *no;
658 number eins = n_Init(1, basecoeffs());
659 number tmp;
660 while (n_GreaterZero(p,basecoeffs())) {
661 // Laufe durch Primzahlen p, die die Ordnung quadratisch teilen, und erzeuge p-maximale Ordnung
662 no = pmaximal(otemp, p);
663 delete otemp;
664 otemp = no;
665 // Nimm nächstgrößere Primzahl, welche die Ordnung quadratisch teilt
666 tmp = n_Add(p,eins, basecoeffs());
667 p = otemp->getsmallestsqprime(tmp); // Benötigt kleinste Primzahl größer tmp, die die Disc. quad. teilt
668 n_Delete(&tmp, basecoeffs());
669 }
670 n_Delete(&p, basecoeffs());
671 n_Delete(&eins, basecoeffs());
672 return otemp;
673}
674*/
675
676
678 // Falls es eine Multtable gibt, liefere eine Kopie davon zurück
679 if (multtable != NULL) {
680 for (int i=0; i<dimension; i++) {
681 a[i] = new bigintmat(multtable[i]);
682 }
683 }
684 else {
685 // Sonst berechne sie auf kanonische Art und Weise
686 bigintmat *bas = new bigintmat(1, dimension, basecoeffs());
687 for (int i=0; i<dimension; i++) {
688 basis_elt(bas, i+1);
690 multmap(bas, a[i]);
691 }
692 }
693}
int kernbase(bigintmat *a, bigintmat *c, number p, coeffs q)
a basis for the nullspace of a mod p: only used internally in Round2. Don't use it.
Definition: bigintmat.cc:2600
bigintmat * bimMult(bigintmat *a, bigintmat *b)
Definition: bigintmat.cc:255
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm div(const CanonicalForm &, const CanonicalForm &)
CanonicalForm den(const CanonicalForm &f)
int m
Definition: cfEzgcd.cc:128
int i
Definition: cfEzgcd.cc:132
int p
Definition: cfModGcd.cc:4078
CanonicalForm b
Definition: cfModGcd.cc:4103
Matrices of numbers.
Definition: bigintmat.h:51
number det()
det (via LaPlace in general, hnf for euc. rings)
Definition: bigintmat.cc:1512
int isOne()
is matrix is identity
Definition: bigintmat.cc:1300
number trace()
the trace ....
Definition: bigintmat.cc:1498
void hnf()
transforms INPLACE to HNF
Definition: bigintmat.cc:1660
int cols() const
Definition: bigintmat.h:144
bigintmat * modhnf(number p, coeffs c)
computes HNF(this | p*I)
Definition: bigintmat.cc:1832
void setcol(int j, bigintmat *m)
Setzt j-te Spalte gleich übergebenem Vektor (Matrix) m.
Definition: bigintmat.cc:826
bool add(bigintmat *b)
Addiert zur Matrix die Matrix b dazu. Return false => an error occurred.
Definition: bigintmat.cc:894
bigintmat * transpose()
Definition: bigintmat.cc:37
void Write()
IO: writes the matrix into the current internal string buffer which must be started/ allocated before...
Definition: bigintmat.cc:413
bool skalmult(number b, coeffs c)
Multipliziert zur Matrix den Skalar b hinzu.
Definition: bigintmat.cc:938
void simplifyContentDen(number *den)
ensures that Gcd(den, content)=1 enden hier wieder
Definition: bigintmat.cc:2688
void skaldiv(number b)
Macht Ganzzahldivision aller Matrixeinträge mit b.
Definition: bigintmat.cc:1861
bool copy(bigintmat *b)
Kopiert Einträge von b auf Bigintmat.
Definition: bigintmat.cc:1259
void getcol(int j, bigintmat *a)
copies the j-th column into the matrix a - which needs to be pre-allocated with the correct size.
Definition: bigintmat.cc:747
number pseudoinv(bigintmat *a)
Speichert in Matrix a die Pseudoinverse, liefert den Nenner zurück.
Definition: bigintmat.cc:1415
int rows() const
Definition: bigintmat.h:145
number get(int i, int j) const
get a copy of an entry. NOTE: starts at [1,1]
Definition: bigintmat.cc:119
void getColRange(int j, int no, bigintmat *a)
copies the no-columns staring by j (so j...j+no-1) into the pre-allocated a
Definition: bigintmat.cc:778
void concatcol(bigintmat *a, bigintmat *b)
Definition: bigintmat.cc:1098
number view(int i, int j) const
view an entry an entry. NOTE: starts at [1,1]
Definition: bigintmat.cc:127
void inpTranspose()
transpose in place
Definition: bigintmat.cc:50
coeffs basecoeffs() const
Definition: bigintmat.h:146
void set(int i, int j, number n, const coeffs C=NULL)
replace an entry with a copy (delete old + copy new!). NOTE: starts at [1,1]
Definition: bigintmat.cc:95
bool sub(bigintmat *b)
Subtrahiert ...
Definition: bigintmat.cc:916
number getDiv()
Definition: nforder.cpp:264
int flags
Definition: nforder.h:40
coeffs m_coeffs
Definition: nforder.h:32
void Write()
Definition: nforder.cpp:87
~nforder()
Definition: nforder.cpp:139
void Print()
Definition: nforder.cpp:126
number viewDisc()
Definition: nforder.h:74
number getDisc()
Definition: nforder.cpp:227
number discriminant
Definition: nforder.h:30
int rc
Definition: nforder.h:29
void createmulttable(bigintmat **a)
Definition: nforder.cpp:677
number elTrace(bigintmat *a)
Definition: nforder.cpp:379
int ref_count_decref()
Definition: nforder.h:51
void multmap(bigintmat *a, bigintmat *m)
Definition: nforder.cpp:404
nforder * getBase()
Definition: nforder.cpp:268
void elSub(bigintmat *a, bigintmat *b)
Definition: nforder.cpp:311
int dimension
Definition: nforder.h:31
bigintmat * getBasis()
Definition: nforder.cpp:239
nforder * baseorder
Definition: nforder.h:34
bigintmat * basis
Definition: nforder.h:35
bigintmat * inv_basis
Definition: nforder.h:38
void elMult(bigintmat *a, bigintmat *b)
Definition: nforder.cpp:321
bigintmat * viewBasis()
Definition: nforder.cpp:246
coeffs basecoeffs() const
Definition: nforder.h:76
bool getMult(bigintmat **m)
Definition: nforder.cpp:251
number inv_divisor
Definition: nforder.h:39
char * String()
Definition: nforder.cpp:121
int ref_count_incref()
Definition: nforder.h:50
bigintmat ** multtable
Definition: nforder.h:33
nforder * simplify()
Definition: nforder.cpp:275
void setOneIsOne()
Definition: nforder.h:85
nforder(int dim, bigintmat **m, const coeffs q)
0 Konstruktoren/Destruktoren ///
Definition: nforder.cpp:30
void calcdisc()
Definition: nforder.cpp:162
bigintmat * elRepMat(bigintmat *a)
Definition: nforder.cpp:395
number divisor
Definition: nforder.h:36
void init()
Definition: nforder.cpp:16
number elNorm(bigintmat *a)
Definition: nforder.cpp:387
int ref_count()
Definition: nforder.h:52
bigintmat * traceMatrix()
Definition: nforder.cpp:196
int getDim()
Definition: nforder.cpp:235
void elAdd(bigintmat *a, bigintmat *b)
Definition: nforder.cpp:301
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
Definition: coeffs.h:633
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:448
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
Definition: coeffs.h:647
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
Definition: coeffs.h:612
static FORCE_INLINE BOOLEAN n_Greater(number a, number b, const coeffs r)
ordered fields: TRUE iff 'a' is larger than 'b'; in Z/pZ: TRUE iff la > lb, where la and lb are the l...
Definition: coeffs.h:508
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition: coeffs.h:461
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:452
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition: coeffs.h:588
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:535
static FORCE_INLINE void n_InpMult(number &a, number b, const coeffs r)
multiplication of 'a' and 'b'; replacement of 'a' by the product a*b
Definition: coeffs.h:638
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:465
#define StringAppend
Definition: emacs.cc:79
const CanonicalForm int s
Definition: facAbsFact.cc:51
CanonicalForm res
Definition: facAbsFact.cc:60
CFList tmp2
Definition: facFqBivar.cc:72
int j
Definition: facHensel.cc:110
fq_nmod_poly_t prod
Definition: facHensel.cc:100
#define assume(x)
Definition: mod2.h:389
The main handler for Singular numbers which are suitable for Singular polynomials.
void nforder_delete(nforder *o)
Definition: nforder.cpp:132
nforder * onestep(nforder *o, number p, coeffs c)
Definition: nforder.cpp:608
void basis_elt(bigintmat *m, int i)
Definition: nforder.cpp:422
nforder * pmaximal(nforder *o, number p)
Definition: nforder.cpp:632
bigintmat * radicalmodpbase(nforder *o, number p, coeffs c)
Definition: nforder.cpp:446
number multring(bigintmat *nbase, nforder *o, number p)
Definition: nforder.cpp:553
void rowhnf(bigintmat *b)
Definition: nforder.cpp:540
void nforder_delete(nforder *o)
Definition: nforder.cpp:132
void basis_elt(bigintmat *m, int i)
Definition: nforder.cpp:422
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define omFree(addr)
Definition: omAllocDecl.h:261
#define NULL
Definition: omList.c:12
void StringSetS(const char *st)
Definition: reporter.cc:128
void StringAppendS(const char *st)
Definition: reporter.cc:107
void PrintS(const char *s)
Definition: reporter.cc:284
char * StringEndS()
Definition: reporter.cc:151
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define R
Definition: sirandom.c:27
int dim(ideal I, ring r)