frommer.h
Go to the documentation of this file.00001
00002
00003 #ifndef FROMMER_H
00004 #define FROMMER_H
00005
00006 #if _MSC_VER > 1000
00007 #pragma once
00008 #endif // _MSC_VER > 1000
00009
00010
00011 #include "FrommerTimer.h"
00012 #include "timer.h"
00013
00022 namespace nCenterFocus
00023 {
00024
00025
00026
00027
00052 template < class TFrommerDefs, int variant>
00053 class Frommer
00054 {
00055
00056 private:
00057 std::string name_m;
00058
00059 #ifdef FROMMERSTAGE_TIMER
00060 Timer tim_m;
00061 Timer tim2_m;
00062 FrommerTimer frommerTimer_m;
00063 MtcpManager_g.connectTimer(tim_m);
00064 MtcpManager_g.connectTimer(tim2_m);
00065 #endif
00066
00067 public:
00068
00069 typedef typename TFrommerDefs::RingType TRing;
00070
00071 typedef typename TFrommerDefs::RingType RingType;
00072
00073 typedef typename TFrommerDefs::PolynomXYType TPolynomXY;
00074 typedef typename TFrommerDefs::TMatrixXYType TMatrixXYType;
00075
00076 private:
00077 #ifdef SAFE
00078 bool initialized;
00079 #endif
00080
00085 short int lastDegree;
00086
00088 const TRing * const ring;
00089
00090 const typename RingType::FieldType & field_ref_m;
00091
00092
00093 short maxFocalValuesToCompute;
00094
00095 short maxDegree;
00096
00098 TPolynomXY const * q;
00099
00101 TPolynomXY const *minusp;
00102
00103 TMatrixXYType * const A;
00104 TMatrixXYType * const B;
00105
00106 TMatrixXYType * const dxA;
00107 TMatrixXYType * const dyA;
00108
00111 const typename TRing::ScalarType* a_table;
00112
00113 short currentDegree;
00114
00115 short currFocalValuePos;
00116
00117
00118
00119 protected:
00120
00123 inline void init();
00124 typename TRing::ScalarType* createLowATable();
00125
00126 void printLowATable(typename TRing::ScalarType* aTable);
00127
00131 template <class TemplateMatrix>
00132 inline void outputMatrix(TemplateMatrix *mat) const ;
00133
00134 inline void outputMatrices() const;
00135
00139 inline void compute_dyA_and_dxA();
00140
00141 inline void perform_C_Step();
00142
00143
00144
00145
00146
00147 inline void perform_inner_C_Step(const short j,const short, register short n) ;
00148
00150 template <int depth, int stage>
00151 inline void perform_C_Step_differ_stages();
00152
00153 template <int depth>
00154 inline void perform_C_Step_wrapper(const int stage);
00155
00156 template <int depth, int stage>
00157 void perform_inner_C_Step_differ_stages(const short j,const short, register short n) ;
00158
00159 inline void perform_the_A_Step();
00160 inline void perform_the_even_A_Step();
00161 inline void perform_the_odd_A_Step();
00162
00165 public:
00166
00167
00168
00169 Frommer(short m, const TRing *rr);
00170 virtual ~Frommer();
00171
00175 inline void setPolynoms(const TPolynomXY * const minusP_polynom, const TPolynomXY *const Q_polynom);
00181
00182 inline void doit(int bComputeAllFocalValues, int jacobi=false);
00183
00187 template <int hm>
00188 void doitx(short howMany);
00189
00194 inline const TRing * getRing() const;
00195
00196 inline const TRing & getRingRef() const;
00197
00198 typename TRing::ElementType getFocalValue( int pos) const;
00199
00200 void getComputedFocalValues(vector<typename TRing::ElementType> &computedFV ) const;
00201
00202 short getSuccessiveVanishedFocalValuesCount() const;
00203 short getMaxFocalValuesToCompute() const {return maxFocalValuesToCompute ; }
00204 short getComputedFocalValuesNum() const {return currFocalValuePos-1 ; }
00209 void perform_generic_C_Step();
00210
00211 void printStageTimings(std::ostream & os) const;
00212
00213
00214 void setName(std::string name) {name_m=name; }
00215 private:
00216
00217
00218
00219
00220
00221
00222 typename TRing::ElementType* computedFocalValues;
00223 };
00224
00225
00226
00227 #include "frommer.cpp"
00228
00229
00230
00231
00232 }
00233
00234 #endif // !defined(FROMMER_H)