My Project
Loading...
Searching...
No Matches
nforder.h
Go to the documentation of this file.
1//////////////////////////////////////////
2//////////////////////////////////////////
3//// Einfache Ordnungs-Klasse ////
4//////////////////////////////////////////
5// Kira Kraft, Jan Albert, Marco Sieben //
6/////// Praktikum bei Herrn Fieker ///////
7//////////////////////////////////////////
8//////////////////////////////////////////
9/*
10 * - Einer Ordnung liegt entweder eine Multiplikationstabelle zu Grunde, oder sie wird durch eine O-Basis erzeugt, wobei O eine andere Ordnung ist
11 * - Ordnungselemente werden als Koeffizientenvektoren (Klasse matrix, Zeilenvektoren!) dargestellt und können addiert/subtrahiert/multipliziert werden
12 * - Die Diskriminante kann von selbst berechnet werden
13*/
14#ifndef NFORDER_HPP
15#define NFORDER_HPP
16
18 one_is_one, //if 1 is the first basis element
21};
22
24{
25private:
26 ////////////////////////////////////
27 ////////// Membervariablen /////////
28 ////////////////////////////////////
29 int rc;
33 bigintmat **multtable; // Multiplikationstabelle als Array von Matrizen ...
34 nforder *baseorder; // ... oder zu Grunde liegende Ordnung
35 bigintmat *basis; // Lin.Komb. der Basiselemente von baseorder zu Basiselementen der Ordnung (Eine Zeile ^= ein Basiselement)
36 number divisor; // Hauptnenner der Linearkombination der Basiselemente
37 // Entweder multtable oder baseorder zeigt auf NULL - je nachdem, wie die Ordnung konstruiert wurde
38 bigintmat *inv_basis; // (inv_basis/inv_divisor) = (basis/divisor)^-1
39 number inv_divisor; //
40 int flags;
41
42 ////////////////////////////////////
43 /////// -1 Memberfunktionen ////////
44 ////////////////////////////////////
45 // Genauere Beschreibung aller Funktionen in der Funktionen.odt
46
47 void init(); //basic initialisation
48public:
49 void calcdisc(); // Berechnet Diskriminante
50 inline int ref_count_incref(){return rc++;};
51 inline int ref_count_decref(){return rc--;};
52 inline int ref_count(){return rc;};
53
54
55 ////////////////////////////////////
56 /// 0 Konstruktoren/Destruktoren ///
57 ////////////////////////////////////
58 //Lädt entweder Multiplikationstabelle von location, oder legt Ordnung o zu Grunde (mit Basis base und Hauptnenner div)
59 nforder(int dim, bigintmat **m, const coeffs q); // (keine Übergabe von const char *, sondern von bigintmat *, diese wird kopiert und als multtable verwendet)
60 nforder(nforder *o, bigintmat *base, number div, const coeffs q);
61 nforder(nforder *o, int);
62
63 ~nforder();
64 void Write();
65 char* String();
66 void Print();
67 nforder *simplify(); //collapses a tower: multipy all bases together
68
69 ////////////////////////////////////
70 // +1 Zugriff auf Membervariablen //
71 ////////////////////////////////////
72
73 number getDisc();
74 inline number viewDisc(){return discriminant;};
75 int getDim();
76 inline coeffs basecoeffs() const { return m_coeffs; }
77 number getDiv();
78 // Liefert Zeiger auf Kopier der Objekte zurück
79 bool getMult(bigintmat **m);
83
84 inline bool oneIsOne() {return (flags & (1<<one_is_one)) != 0;}
85 inline void setOneIsOne() {flags |= (1<<one_is_one);}
86
87 inline bool isMaximalKnown() {return (flags & (1<<is_maximal_known)) != 0;};
88 inline bool isMaximal() {return isMaximalKnown() && (flags & (1<<is_maximal_known));};
89 inline void setIsMaximal(bool is) {flags = (flags & (~((1<<is_maximal_known) + (1<<is_maximal)))) | (1<<is_maximal_known) | (is*(1<<is_maximal));};
90
91
92
93 ////////////////////////////////////
94 ////// +2 Elementoperationen ///////
95 ////////////////////////////////////
96 // Addiert/Subtrahiert/Multipliziert zu a das Element b hinzu
97 void elAdd(bigintmat *a, bigintmat *b);
98 void elSub(bigintmat *a, bigintmat *b);
99 void elMult(bigintmat *a, bigintmat *b);
100 number elTrace(bigintmat *a);
101 number elNorm(bigintmat *a);
103
104 ////////////////////////////////////
105 //// +3 Funktionen für Round 2 /////
106 ////////////////////////////////////
107 // long long int getsmallestsqprime();
108 /* Liefert kleinste Primzahl >= p, die die Diskriminante quadratisch teilt */
109 void multmap(bigintmat *a, bigintmat *m);
111
112 void createmulttable(bigintmat **a);
113
114};
115
116////////////////////////////////////
117////// 1 Komfortfunktionen /////////
118////////////////////////////////////
119/* Setzt Vektor m auf (0,...,0,1,0,...,0) (i-ten Basisvektor) */
120void basis_elt(bigintmat *m, int i);
121
122////////////////////////////////////
123//////////// 2 Round 2 /////////////
124////////////////////////////////////
125/* Liefert bzgl. Primzahl p um eines größere Ordnung von o zurück */
126nforder *onestep(nforder *o, number p, coeffs c);
127/* Macht liefert p-maximale Ordnung von o zurück */
128nforder *pmaximal(nforder *o, number p);
129/* Liefert Maximalordnung, ausgehend von o, zurück */
130nforder *round2(nforder *o); // Benötigt Faktorisierung der Diskriminanten
131/* Liefert Basis von I_p(O)/pI_p(O) */
133/* Berechnet die Basis mit Hilfe der langen Matrix */
134number multring(bigintmat* nbase, nforder *o, number p);
135void nforder_delete(nforder *o);
136
137#endif
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm div(const CanonicalForm &, const CanonicalForm &)
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 getDiv()
Definition: nforder.cpp:264
int flags
Definition: nforder.h:40
coeffs m_coeffs
Definition: nforder.h:32
void setIsMaximal(bool is)
Definition: nforder.h:89
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
bool isMaximal()
Definition: nforder.h:88
bool oneIsOne()
Definition: nforder.h:84
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 isMaximalKnown()
Definition: nforder.h:87
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
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
The main handler for Singular numbers which are suitable for Singular polynomials.
void nforder_delete(nforder *o)
Definition: nforder.cpp:132
order_flags_log
Definition: nforder.h:17
@ is_maximal
Definition: nforder.h:20
@ one_is_one
Definition: nforder.h:18
@ is_maximal_known
Definition: nforder.h:19
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
nforder * round2(nforder *o)
number multring(bigintmat *nbase, nforder *o, number p)
Definition: nforder.cpp:553
int dim(ideal I, ring r)