Loading...
Searching...
No Matches
nforder.h
Go to the documentation of this file.
//////////////////////////////////////////
//////////////////////////////////////////
//// Einfache Ordnungs-Klasse ////
//////////////////////////////////////////
// Kira Kraft, Jan Albert, Marco Sieben //
/////// Praktikum bei Herrn Fieker ///////
//////////////////////////////////////////
//////////////////////////////////////////
/*
* - Einer Ordnung liegt entweder eine Multiplikationstabelle zu Grunde, oder sie wird durch eine O-Basis erzeugt, wobei O eine andere Ordnung ist
* - Ordnungselemente werden als Koeffizientenvektoren (Klasse matrix, Zeilenvektoren!) dargestellt und können addiert/subtrahiert/multipliziert werden
* - Die Diskriminante kann von selbst berechnet werden
*/
#ifndef NFORDER_HPP
#define NFORDER_HPP
enum order_flags_log {
one_is_one, //if 1 is the first basis element
is_maximal_known,
is_maximal
};
class nforder
{
private:
////////////////////////////////////
////////// Membervariablen /////////
////////////////////////////////////
int rc;
number discriminant;
int dimension;
coeffs m_coeffs;
bigintmat **multtable; // Multiplikationstabelle als Array von Matrizen ...
nforder *baseorder; // ... oder zu Grunde liegende Ordnung
bigintmat *basis; // Lin.Komb. der Basiselemente von baseorder zu Basiselementen der Ordnung (Eine Zeile ^= ein Basiselement)
number divisor; // Hauptnenner der Linearkombination der Basiselemente
// Entweder multtable oder baseorder zeigt auf NULL - je nachdem, wie die Ordnung konstruiert wurde
bigintmat *inv_basis; // (inv_basis/inv_divisor) = (basis/divisor)^-1
number inv_divisor; //
int flags;
////////////////////////////////////
/////// -1 Memberfunktionen ////////
////////////////////////////////////
// Genauere Beschreibung aller Funktionen in der Funktionen.odt
void init(); //basic initialisation
public:
void calcdisc(); // Berechnet Diskriminante
inline int ref_count_incref(){return rc++;};
inline int ref_count_decref(){return rc--;};
inline int ref_count(){return rc;};
////////////////////////////////////
/// 0 Konstruktoren/Destruktoren ///
////////////////////////////////////
//Lädt entweder Multiplikationstabelle von location, oder legt Ordnung o zu Grunde (mit Basis base und Hauptnenner div)
nforder(int dim, bigintmat **m, const coeffs q); // (keine Übergabe von const char *, sondern von bigintmat *, diese wird kopiert und als multtable verwendet)
nforder(nforder *o, bigintmat *base, number div, const coeffs q);
nforder(nforder *o, int);
~nforder();
void Write();
char* String();
void Print();
nforder *simplify(); //collapses a tower: multipy all bases together
////////////////////////////////////
// +1 Zugriff auf Membervariablen //
////////////////////////////////////
number getDisc();
inline number viewDisc(){return discriminant;};
int getDim();
inline coeffs basecoeffs() const { return m_coeffs; }
number getDiv();
// Liefert Zeiger auf Kopier der Objekte zurück
bool getMult(bigintmat **m);
nforder *getBase();
bigintmat *getBasis();
bigintmat *viewBasis();
inline bool oneIsOne() {return (flags & (1<<one_is_one)) != 0;}
inline void setOneIsOne() {flags |= (1<<one_is_one);}
inline bool isMaximalKnown() {return (flags & (1<<is_maximal_known)) != 0;};
inline bool isMaximal() {return isMaximalKnown() && (flags & (1<<is_maximal_known));};
inline void setIsMaximal(bool is) {flags = (flags & (~((1<<is_maximal_known) + (1<<is_maximal)))) | (1<<is_maximal_known) | (is*(1<<is_maximal));};
////////////////////////////////////
////// +2 Elementoperationen ///////
////////////////////////////////////
// Addiert/Subtrahiert/Multipliziert zu a das Element b hinzu
void elAdd(bigintmat *a, bigintmat *b);
void elSub(bigintmat *a, bigintmat *b);
void elMult(bigintmat *a, bigintmat *b);
number elTrace(bigintmat *a);
number elNorm(bigintmat *a);
bigintmat * elRepMat(bigintmat *a);
////////////////////////////////////
//// +3 Funktionen für Round 2 /////
////////////////////////////////////
// long long int getsmallestsqprime();
/* Liefert kleinste Primzahl >= p, die die Diskriminante quadratisch teilt */
void multmap(bigintmat *a, bigintmat *m);
bigintmat *traceMatrix();
void createmulttable(bigintmat **a);
};
////////////////////////////////////
////// 1 Komfortfunktionen /////////
////////////////////////////////////
/* Setzt Vektor m auf (0,...,0,1,0,...,0) (i-ten Basisvektor) */
void basis_elt(bigintmat *m, int i);
////////////////////////////////////
//////////// 2 Round 2 /////////////
////////////////////////////////////
/* Liefert bzgl. Primzahl p um eines größere Ordnung von o zurück */
nforder *onestep(nforder *o, number p, coeffs c);
/* Macht liefert p-maximale Ordnung von o zurück */
nforder *pmaximal(nforder *o, number p);
/* Liefert Maximalordnung, ausgehend von o, zurück */
nforder *round2(nforder *o); // Benötigt Faktorisierung der Diskriminanten
/* Liefert Basis von I_p(O)/pI_p(O) */
bigintmat *radicalmodpbase(nforder *o, number p, coeffs c);
/* Berechnet die Basis mit Hilfe der langen Matrix */
number multring(bigintmat* nbase, nforder *o, number p);
void nforder_delete(nforder *o);
#endif
div
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm div(const CanonicalForm &, const CanonicalForm &)
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
p
int p
Definition cfModGcd.cc:4086
b
CanonicalForm b
Definition cfModGcd.cc:4111
bigintmat
Matrices of numbers.
Definition bigintmat.h:51
nforder
Definition nforder.h:24
nforder::getDiv
number getDiv()
Definition nforder.cpp:264
nforder::flags
int flags
Definition nforder.h:40
nforder::m_coeffs
coeffs m_coeffs
Definition nforder.h:32
nforder::setIsMaximal
void setIsMaximal(bool is)
Definition nforder.h:89
nforder::Write
void Write()
Definition nforder.cpp:87
nforder::~nforder
~nforder()
Definition nforder.cpp:139
nforder::Print
void Print()
Definition nforder.cpp:126
nforder::viewDisc
number viewDisc()
Definition nforder.h:74
nforder::getDisc
number getDisc()
Definition nforder.cpp:227
nforder::discriminant
number discriminant
Definition nforder.h:30
nforder::rc
int rc
Definition nforder.h:29
nforder::createmulttable
void createmulttable(bigintmat **a)
Definition nforder.cpp:677
nforder::elTrace
number elTrace(bigintmat *a)
Definition nforder.cpp:379
nforder::ref_count_decref
int ref_count_decref()
Definition nforder.h:51
nforder::isMaximal
bool isMaximal()
Definition nforder.h:88
nforder::oneIsOne
bool oneIsOne()
Definition nforder.h:84
nforder::multmap
void multmap(bigintmat *a, bigintmat *m)
Definition nforder.cpp:404
nforder::getBase
nforder * getBase()
Definition nforder.cpp:268
nforder::elSub
void elSub(bigintmat *a, bigintmat *b)
Definition nforder.cpp:311
nforder::dimension
int dimension
Definition nforder.h:31
nforder::getBasis
bigintmat * getBasis()
Definition nforder.cpp:239
nforder::baseorder
nforder * baseorder
Definition nforder.h:34
nforder::basis
bigintmat * basis
Definition nforder.h:35
nforder::inv_basis
bigintmat * inv_basis
Definition nforder.h:38
nforder::elMult
void elMult(bigintmat *a, bigintmat *b)
Definition nforder.cpp:321
nforder::viewBasis
bigintmat * viewBasis()
Definition nforder.cpp:246
nforder::basecoeffs
coeffs basecoeffs() const
Definition nforder.h:76
nforder::isMaximalKnown
bool isMaximalKnown()
Definition nforder.h:87
nforder::getMult
bool getMult(bigintmat **m)
Definition nforder.cpp:251
nforder::inv_divisor
number inv_divisor
Definition nforder.h:39
nforder::String
char * String()
Definition nforder.cpp:121
nforder::ref_count_incref
int ref_count_incref()
Definition nforder.h:50
nforder::multtable
bigintmat ** multtable
Definition nforder.h:33
nforder::simplify
nforder * simplify()
Definition nforder.cpp:275
nforder::setOneIsOne
void setOneIsOne()
Definition nforder.h:85
nforder::nforder
nforder(int dim, bigintmat **m, const coeffs q)
0 Konstruktoren/Destruktoren ///
Definition nforder.cpp:30
nforder::calcdisc
void calcdisc()
Definition nforder.cpp:162
nforder::elRepMat
bigintmat * elRepMat(bigintmat *a)
Definition nforder.cpp:395
nforder::divisor
number divisor
Definition nforder.h:36
nforder::init
void init()
Definition nforder.cpp:16
nforder::elNorm
number elNorm(bigintmat *a)
Definition nforder.cpp:387
nforder::ref_count
int ref_count()
Definition nforder.h:52
nforder::traceMatrix
bigintmat * traceMatrix()
Definition nforder.cpp:196
nforder::getDim
int getDim()
Definition nforder.cpp:235
nforder::elAdd
void elAdd(bigintmat *a, bigintmat *b)
Definition nforder.cpp:301
coeffs
The main handler for Singular numbers which are suitable for Singular polynomials.
nforder_delete
void nforder_delete(nforder *o)
Definition nforder.cpp:132
order_flags_log
order_flags_log
Definition nforder.h:17
is_maximal
@ is_maximal
Definition nforder.h:20
one_is_one
@ one_is_one
Definition nforder.h:18
is_maximal_known
@ is_maximal_known
Definition nforder.h:19
onestep
nforder * onestep(nforder *o, number p, coeffs c)
Definition nforder.cpp:608
basis_elt
void basis_elt(bigintmat *m, int i)
Definition nforder.cpp:422
pmaximal
nforder * pmaximal(nforder *o, number p)
Definition nforder.cpp:632
radicalmodpbase
bigintmat * radicalmodpbase(nforder *o, number p, coeffs c)
Definition nforder.cpp:446
round2
nforder * round2(nforder *o)
multring
number multring(bigintmat *nbase, nforder *o, number p)
Definition nforder.cpp:553
dim
int dim(ideal I, ring r)
Definition tropicalStrategy.cc:23