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 | ideal originalIdeal; |
---|
18 | int dimensionOfIdeal; |
---|
19 | ring startingRing; |
---|
20 | ideal startingIdeal; |
---|
21 | number uniformizingParameter; |
---|
22 | gfan::ZCone linealitySpace; |
---|
23 | bool onlyLowerHalfSpace; |
---|
24 | |
---|
25 | gfan::ZVector (*weightAdjustingAlgorithm1) (gfan::ZVector w); |
---|
26 | gfan::ZVector (*weightAdjustingAlgorithm2) (gfan::ZVector v, gfan::ZVector w); |
---|
27 | bool (*extraReductionAlgorithm) (ideal I, ring r, number p); |
---|
28 | |
---|
29 | public: |
---|
30 | |
---|
31 | tropicalStrategy(const ideal I, const ring r); |
---|
32 | tropicalStrategy(const ideal J, const number p, const ring s); |
---|
33 | tropicalStrategy(const tropicalStrategy& currentStrategy); |
---|
34 | ~tropicalStrategy(); |
---|
35 | tropicalStrategy& operator=(const tropicalStrategy& currentStrategy); |
---|
36 | |
---|
37 | |
---|
38 | ring getOriginalRing() const |
---|
39 | { |
---|
40 | rTest(originalRing); |
---|
41 | return originalRing; |
---|
42 | } |
---|
43 | |
---|
44 | ring getStartingRing() const |
---|
45 | { |
---|
46 | rTest(startingRing); |
---|
47 | return startingRing; |
---|
48 | } |
---|
49 | |
---|
50 | number getUniformizingParameter() const |
---|
51 | { |
---|
52 | return uniformizingParameter; |
---|
53 | } |
---|
54 | |
---|
55 | ideal getStartingIdeal() const |
---|
56 | { |
---|
57 | id_Test(startingIdeal,startingRing); |
---|
58 | return startingIdeal; |
---|
59 | } |
---|
60 | |
---|
61 | int getDimensionOfIdeal() const |
---|
62 | { |
---|
63 | return dimensionOfIdeal; |
---|
64 | } |
---|
65 | |
---|
66 | gfan::ZCone getHomogeneitySpace() const |
---|
67 | { |
---|
68 | return linealitySpace; |
---|
69 | } |
---|
70 | |
---|
71 | int getDimensionOfHomogeneitySpace() const |
---|
72 | { |
---|
73 | return linealitySpace.dimension(); |
---|
74 | } |
---|
75 | |
---|
76 | bool restrictToLowerHalfSpace() const |
---|
77 | { |
---|
78 | return onlyLowerHalfSpace; |
---|
79 | } |
---|
80 | |
---|
81 | wAdjAlg1 getWeightAdjustingAlgorithm1() const |
---|
82 | { |
---|
83 | return weightAdjustingAlgorithm1; |
---|
84 | } |
---|
85 | |
---|
86 | wAdjAlg2 getWeightAdjustingAlgorithm2() const |
---|
87 | { |
---|
88 | return weightAdjustingAlgorithm2; |
---|
89 | } |
---|
90 | |
---|
91 | redAlg getExtraReductionAlgorithm() const |
---|
92 | { |
---|
93 | return extraReductionAlgorithm; |
---|
94 | } |
---|
95 | |
---|
96 | gfan::ZVector adjustWeightForHomogeneity(gfan::ZVector w) const |
---|
97 | { |
---|
98 | return this->weightAdjustingAlgorithm1(w); |
---|
99 | } |
---|
100 | |
---|
101 | gfan::ZVector adjustWeightUnderHomogeneity(gfan::ZVector v, gfan::ZVector w) const |
---|
102 | { |
---|
103 | return this->weightAdjustingAlgorithm2(v,w); |
---|
104 | } |
---|
105 | |
---|
106 | bool reduce(ideal I, ring r) const |
---|
107 | { |
---|
108 | rTest(r); id_Test(I,r); |
---|
109 | return this->extraReductionAlgorithm(I,r,uniformizingParameter); |
---|
110 | } |
---|
111 | }; |
---|
112 | |
---|
113 | int dim(ideal I, ring r); |
---|
114 | |
---|
115 | #endif |
---|