1 | #ifndef AE_H |
---|
2 | #define AE_H |
---|
3 | |
---|
4 | |
---|
5 | #include <gmp.h> |
---|
6 | #include <omalloc/omalloc.h> |
---|
7 | |
---|
8 | |
---|
9 | class int_poly // Klasse von int_polynomen mit Typ (Grad, Koeffizienten ganzzahlig) |
---|
10 | { |
---|
11 | |
---|
12 | public: |
---|
13 | // Charakteristika der int_polynome (TO DO??: Dynamisches Array) |
---|
14 | |
---|
15 | int deg; // Grad des int_polynoms |
---|
16 | mpz_t coef[100]; // Feld der Koeffizienten |
---|
17 | //mpz_t coef = reinterpret_cast<mpz_t*> (omAlloc(100*sizeof(mpz_t))); |
---|
18 | |
---|
19 | |
---|
20 | // Konstruktoren und Destruktoren |
---|
21 | int_poly(); |
---|
22 | int_poly( int , mpz_t*); |
---|
23 | //~int_poly(); |
---|
24 | |
---|
25 | |
---|
26 | |
---|
27 | // Arithmetische Operationen |
---|
28 | |
---|
29 | |
---|
30 | // Additionen |
---|
31 | |
---|
32 | int_poly poly_add(const int_poly , const int_poly ); |
---|
33 | int_poly poly_add_to(const int_poly); |
---|
34 | int_poly poly_add_mon(const int_poly,mpz_t, int); //addiert Monome zu int_polynom |
---|
35 | int_poly poly_add_mon_to(mpz_t,int); |
---|
36 | int_poly poly_add_const( int_poly, const mpz_t); |
---|
37 | int_poly poly_add_const_to(const mpz_t); |
---|
38 | |
---|
39 | // Subtraktion |
---|
40 | |
---|
41 | int_poly poly_sub(const int_poly , const int_poly ); |
---|
42 | int_poly poly_sub_to(const int_poly); |
---|
43 | int_poly poly_sub_mon(const int_poly,mpz_t,int); |
---|
44 | int_poly poly_sub_mon_to(mpz_t,int); |
---|
45 | int_poly poly_sub_const( int_poly, const mpz_t); |
---|
46 | int_poly poly_sub_const_to(const mpz_t); |
---|
47 | |
---|
48 | //Multiplikationen |
---|
49 | |
---|
50 | int_poly poly_mult_n(int_poly,int_poly); |
---|
51 | int_poly poly_mult_n_to(const int_poly); |
---|
52 | int_poly poly_mult_ka( int_poly, int_poly); |
---|
53 | int_poly poly_scalar_mult(const mpz_t ,const int_poly); |
---|
54 | int_poly poly_scalar_mult(const int_poly, const mpz_t); |
---|
55 | int_poly poly_scalar_mult_to(const mpz_t); |
---|
56 | int_poly poly_neg(); |
---|
57 | int_poly poly_mon_mult(const int_poly, const int); |
---|
58 | int_poly poly_mon_mult_to(const int); |
---|
59 | |
---|
60 | //Divisionen |
---|
61 | int_poly poly_div(int_poly &,int_poly &, int_poly, int_poly); // exakte Division |
---|
62 | int_poly poly_div_to(int_poly &,int_poly &,const int_poly); // To Variante exakte Division |
---|
63 | int_poly poly_pseudodiv(int_poly &, int_poly &, int_poly , int_poly ); |
---|
64 | int_poly poly_pseudodiv_to(int_poly &, int_poly &, int_poly ); |
---|
65 | int_poly poly_pseudodiv_rem( int_poly , int_poly); |
---|
66 | int_poly poly_pseudodiv_rem_to(const int_poly); |
---|
67 | int_poly poly_scalar_div(const int_poly, const mpz_t); |
---|
68 | int_poly poly_scalar_div_to(const mpz_t); |
---|
69 | int_poly poly_mon_div(const int_poly, const int); |
---|
70 | int_poly poly_mon_div_rem(const int_poly, const int); |
---|
71 | |
---|
72 | //Kombinationen |
---|
73 | |
---|
74 | int_poly poly_multadd_to(const int_poly, const int_poly); //a=a*b+c |
---|
75 | int_poly poly_multsub_to(const int_poly,const int_poly); //a=a*b-c |
---|
76 | //int_poly poly_addmult_to(const int_poly, const int_poly); |
---|
77 | |
---|
78 | // Eigenschaften von int_polynomen |
---|
79 | |
---|
80 | // Content & Primitive Part |
---|
81 | void poly_cont(mpz_t&); |
---|
82 | int_poly poly_pp(int_poly); |
---|
83 | |
---|
84 | |
---|
85 | // Sonstige Operationen |
---|
86 | int_poly poly_set(const int_poly); |
---|
87 | int_poly poly_set(const mpz_t); // Setzt int_polynom auf Konstante |
---|
88 | int_poly poly_set_zero(); // Setzt int_polynom auf 0 |
---|
89 | void poly_horner(mpz_t, const mpz_t); // Wertet int_polynom mittels Horner-Schema an einer Stelle aus |
---|
90 | void poly_horner_int_poly(int_poly, const int_poly); //Setzt int_polynom in int_polynom mittels Horner Schema ein |
---|
91 | int_poly poly_gcd(int_poly,int_poly); //Standard GGT |
---|
92 | int_poly poly_extgcd(int_poly,int_poly,int_poly,int_poly); //Erweiterter Standard GGT |
---|
93 | int_poly poly_ppgcd( int_poly, int_poly); // Primitive int_polynomial GCD |
---|
94 | int_poly poly_ppgcd_to(int_poly); |
---|
95 | int_poly poly_subgcd( int_poly, int_poly); // Subresulatant GCD |
---|
96 | int_poly poly_subgcd_to(int_poly); |
---|
97 | int_poly poly_extsubgcd(int_poly&, int_poly&,int_poly &,int_poly,int_poly); |
---|
98 | int is_equal(const int_poly); // Test auf Gleichheit |
---|
99 | int is_zero(); // Test auf Gleichheit mit 0 |
---|
100 | int is_one(); // Test auf Gleichheit mit 1 |
---|
101 | int is_monic(); // testet, ob das int_polynom normiert ist |
---|
102 | |
---|
103 | |
---|
104 | // Ein und Ausgabe |
---|
105 | void poly_insert(); // Eingabe von int_polynom |
---|
106 | void poly_print(); //Ausgabe von int_polynom |
---|
107 | }; |
---|
108 | |
---|
109 | #endif |
---|
110 | |
---|
111 | |
---|