Data Structures | Enumerations | Functions
nforder.h File Reference

Go to the source code of this file.

Data Structures

class  nforder
 

Enumerations

enum  order_flags_log { one_is_one, is_maximal_known, is_maximal }
 

Functions

void basis_elt (bigintmat *m, int i)
 
nforderonestep (nforder *o, number p, coeffs c)
 
nforderpmaximal (nforder *o, number p)
 
nforderround2 (nforder *o)
 
bigintmatradicalmodpbase (nforder *o, number p, coeffs c)
 
number multring (bigintmat *nbase, nforder *o, number p)
 
void nforder_delete (nforder *o)
 

Enumeration Type Documentation

Enumerator
one_is_one 
is_maximal_known 
is_maximal 

Definition at line 17 of file nforder.h.

17  {
18  one_is_one, //if 1 is the first basis element
21 };

Function Documentation

void basis_elt ( bigintmat m,
int  i 
)

Definition at line 422 of file nforder.cpp.

422  {
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 }
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:537
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:91
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
int cols() const
Definition: bigintmat.h:128
int rows() const
Definition: bigintmat.h:129
coeffs basecoeffs() const
Definition: bigintmat.h:130
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
void Werror(const char *fmt,...)
Definition: reporter.cc:199
number multring ( bigintmat nbase,
nforder o,
number  p 
)

Definition at line 552 of file nforder.cpp.

552  {
553  coeffs R = o->basecoeffs();
554  number divi;
555  int n = o->getDim();
556 
557  bigintmat *inv = new bigintmat(n, n, R);
558  divi = nbase->pseudoinv(inv);
559 
560  // Zusammenbau der "langen" Matrix
561  bigintmat *lon = new bigintmat(n, 0, R);
562  bigintmat *oldlon;
563  bigintmat *mm = new bigintmat(n, n, R);
564  bigintmat *temp = new bigintmat(n, 1, R);
565  bigintmat *nochnetemp = new bigintmat(n, n, R);
566 
567  for (int i=1; i<=n; i++) {
568  nbase->getcol(i, temp);
569  o->multmap(temp, mm);
570  bimMult(inv, mm, nochnetemp);
571  mm->copy(nochnetemp);
572  mm->inpTranspose();
573  oldlon = lon;
574  lon = new bigintmat(n, (i)*n, o->basecoeffs());
575  lon->concatcol(oldlon, mm);
576  delete oldlon;
577  }
578 
579  lon->skaldiv(divi);
580 
581  bigintmat * red;
582  if (1) {
583  bigintmat * cmp = lon->modhnf(p, o->basecoeffs());
584  red = cmp;
585  } else {
586  lon->hnf();
587  red = new bigintmat(n, n, o->basecoeffs());
588  lon->getColRange((n-1)*n+1, n, red);
589  }
590  delete lon;
591  red->inpTranspose();
592 
593  number divisor = red->pseudoinv(nbase);
594  nbase->hnf();
595 
596  delete inv;
597  delete mm;
598  delete temp;
599  delete red;
600  delete nochnetemp;
601  n_Delete(&divi, o->basecoeffs());
602  return divisor;
603 }
void concatcol(bigintmat *a, bigintmat *b)
Definition: bigintmat.cc:1047
void skaldiv(number b)
Macht Ganzzahldivision aller Matrixeinträge mit b.
Definition: bigintmat.cc:1739
return P p
Definition: myNF.cc:203
Matrices of numbers.
Definition: bigintmat.h:32
void inpTranspose()
transpose in place
Definition: bigintmat.cc:49
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
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:768
bigintmat * bimMult(bigintmat *a, bigintmat *b)
Definition: bigintmat.cc:251
The main handler for Singular numbers which are suitable for Singular polynomials.
void hnf()
transforms INPLACE to HNF
Definition: bigintmat.cc:1560
int i
Definition: cfEzgcd.cc:123
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:741
void multmap(bigintmat *a, bigintmat *m)
Definition: nforder.cpp:404
bigintmat * modhnf(number p, coeffs c)
computes HNF(this | p*I)
Definition: bigintmat.cc:1715
coeffs basecoeffs() const
Definition: nforder.h:76
#define R
Definition: sirandom.c:26
bool copy(bigintmat *b)
Kopiert Einträge von b auf Bigintmat.
Definition: bigintmat.cc:1176
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
number pseudoinv(bigintmat *a)
Speichert in Matrix a die Pseudoinverse, liefert den Nenner zurück.
Definition: bigintmat.cc:1315
int getDim()
Definition: nforder.cpp:235
void nforder_delete ( nforder o)

Definition at line 132 of file nforder.cpp.

132  {
133  if (o->ref_count_decref()>0) {
134  return;
135  }
136  delete o;
137 }
int ref_count_decref()
Definition: nforder.h:51
nforder* onestep ( nforder o,
number  p,
coeffs  c 
)

Definition at line 605 of file nforder.cpp.

605  {
606  // Berechne F_p-Basis von I_p/pI_p
607  bigintmat *basis;
608  basis = radicalmodpbase(o, p, c);
609 
610 
611  // Bestimme Basis vom Ring der Multiplikatoren (speicher diese in basis), und Nenner davon (in divisor)
612  number divisor = multring(basis, o, p);
613  // Erzeuge neue Ordnung, der o zu Grunde liegt, mit Basis basis und Nenner divisor
614  if (basis->isOne() && n_IsOne(divisor, c)) {
615  delete basis;
616  n_Delete(&divisor, c);
617  return o;
618  }
619 
620  nforder *no = new nforder(o, basis, divisor, c);
621 
622  delete basis;
623  n_Delete(&divisor, c);
624  return no;
625 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:468
Matrices of numbers.
Definition: bigintmat.h:32
int isOne()
is matrix is identity
Definition: bigintmat.cc:1216
number multring(bigintmat *nbase, nforder *o, number p)
Definition: nforder.cpp:552
bigintmat * radicalmodpbase(nforder *o, number p, coeffs c)
Definition: nforder.cpp:446
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
nforder* pmaximal ( nforder o,
number  p 
)

Definition at line 627 of file nforder.cpp.

627  {
628  coeffs c = o->basecoeffs();
629  nforder *no = o;
630  nforder *otemp;
631  // TODO: check if p^2 still divides disc (maybe in onestep)
632  // simplify the tower
633  do {
634  otemp = no;
635  no = onestep(otemp, p, c);
636  if (no==otemp)
637  break;
638  nforder_delete (otemp);
639  otemp = no->simplify();
640  nforder_delete (no);
641  no = otemp;
642  } while (1);
643  return no;
644 }
nforder * simplify()
Definition: nforder.cpp:275
return P p
Definition: myNF.cc:203
nforder * onestep(nforder *o, number p, coeffs c)
Definition: nforder.cpp:605
The main handler for Singular numbers which are suitable for Singular polynomials.
void nforder_delete(nforder *o)
Definition: nforder.cpp:132
coeffs basecoeffs() const
Definition: nforder.h:76
bigintmat* radicalmodpbase ( nforder o,
number  p,
coeffs  c 
)

Definition at line 446 of file nforder.cpp.

446  {
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, c);
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 }
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:511
bigintmat * traceMatrix()
Definition: nforder.cpp:196
return P p
Definition: myNF.cc:203
Matrices of numbers.
Definition: bigintmat.h:32
void setcol(int j, bigintmat *m)
Setzt j-te Spalte gleich übergebenem Vektor (Matrix) m.
Definition: bigintmat.cc:810
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:537
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
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:2405
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
int j
Definition: myNF.cc:70
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:653
bool skalmult(number b, coeffs c)
Multipliziert zur Matrix den Skalar b hinzu.
Definition: bigintmat.cc:904
int m
Definition: cfEzgcd.cc:119
void hnf()
transforms INPLACE to HNF
Definition: bigintmat.cc:1560
int i
Definition: cfEzgcd.cc:123
int cols() const
Definition: bigintmat.h:128
void elMult(bigintmat *a, bigintmat *b)
Definition: nforder.cpp:321
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:741
coeffs basecoeffs() const
Definition: nforder.h:76
fq_nmod_poly_t prod
Definition: facHensel.cc:95
void basis_elt(bigintmat *m, int i)
Definition: nforder.cpp:422
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
int getDim()
Definition: nforder.cpp:235
nforder* round2 ( nforder o)