1 | #ifndef GFANLIB_TROPICALSTRATEGY_H |
---|
2 | #define GFANLIB_TROPICALSTRATEGY_H |
---|
3 | |
---|
4 | #include <gfanlib/gfanlib_vector.h> |
---|
5 | #include <gfanlib/gfanlib_zcone.h> |
---|
6 | #include <libpolys/polys/simpleideals.h> |
---|
7 | #include <set> |
---|
8 | |
---|
9 | typedef gfan::ZVector (*wAdjAlg1)(gfan::ZVector); |
---|
10 | typedef gfan::ZVector (*wAdjAlg2)(gfan::ZVector,gfan::ZVector); |
---|
11 | typedef bool (*redAlg)(ideal,ring,number); |
---|
12 | |
---|
13 | class tropicalStrategy |
---|
14 | { |
---|
15 | private: |
---|
16 | ring originalRing; |
---|
17 | ring startingRing; |
---|
18 | number uniformizingParameter; |
---|
19 | ideal startingIdeal; |
---|
20 | int dimensionOfIdeal; |
---|
21 | bool onlyLowerHalfSpace; |
---|
22 | |
---|
23 | gfan::ZVector (*weightAdjustingAlgorithm1) (gfan::ZVector w); |
---|
24 | gfan::ZVector (*weightAdjustingAlgorithm2) (gfan::ZVector v, gfan::ZVector w); |
---|
25 | bool (*reductionAlgorithm) (ideal I, ring r, number p); |
---|
26 | |
---|
27 | public: |
---|
28 | |
---|
29 | tropicalStrategy(const ideal I, const ring r); |
---|
30 | tropicalStrategy(const ideal J, const number p, const ring s); |
---|
31 | tropicalStrategy(const tropicalStrategy& currentStrategy); |
---|
32 | ~tropicalStrategy(); |
---|
33 | tropicalStrategy& operator=(const tropicalStrategy& currentStrategy); |
---|
34 | |
---|
35 | |
---|
36 | ring getOriginalRing() const |
---|
37 | { |
---|
38 | rTest(originalRing); |
---|
39 | return originalRing; |
---|
40 | } |
---|
41 | |
---|
42 | ring getStartingRing() const |
---|
43 | { |
---|
44 | rTest(startingRing); |
---|
45 | return startingRing; |
---|
46 | } |
---|
47 | |
---|
48 | number getUniformizingParameter() const |
---|
49 | { |
---|
50 | return uniformizingParameter; |
---|
51 | } |
---|
52 | |
---|
53 | ideal getStartingIdeal() const |
---|
54 | { |
---|
55 | id_Test(startingIdeal,startingRing); |
---|
56 | return startingIdeal; |
---|
57 | } |
---|
58 | |
---|
59 | int getDimensionOfIdeal() const |
---|
60 | { |
---|
61 | return dimensionOfIdeal; |
---|
62 | } |
---|
63 | |
---|
64 | bool restrictToLowerHalfSpace() const |
---|
65 | { |
---|
66 | return onlyLowerHalfSpace; |
---|
67 | } |
---|
68 | |
---|
69 | wAdjAlg1 getWeightAdjustingAlgorithm1() const |
---|
70 | { |
---|
71 | return weightAdjustingAlgorithm1; |
---|
72 | } |
---|
73 | |
---|
74 | wAdjAlg2 getWeightAdjustingAlgorithm2() const |
---|
75 | { |
---|
76 | return weightAdjustingAlgorithm2; |
---|
77 | } |
---|
78 | |
---|
79 | redAlg getReductionAlgorithm() const |
---|
80 | { |
---|
81 | return reductionAlgorithm; |
---|
82 | } |
---|
83 | |
---|
84 | gfan::ZVector adjustWeightForHomogeneity(gfan::ZVector w) const |
---|
85 | { |
---|
86 | return this->weightAdjustingAlgorithm1(w); |
---|
87 | } |
---|
88 | |
---|
89 | gfan::ZVector adjustWeightUnderHomogeneity(gfan::ZVector v, gfan::ZVector w) const |
---|
90 | { |
---|
91 | return this->weightAdjustingAlgorithm2(v,w); |
---|
92 | } |
---|
93 | |
---|
94 | bool reduce(ideal I, ring r) const |
---|
95 | { |
---|
96 | rTest(r); id_Test(I,r); |
---|
97 | return this->reductionAlgorithm(I,r,uniformizingParameter); |
---|
98 | } |
---|
99 | }; |
---|
100 | |
---|
101 | #endif |
---|