00001 00007 #ifndef SPECIAL_RELATIONS_HEADER_ 00008 #define SPECIAL_RELATIONS_HEADER_ 00009 00010 00011 struct myintcompare 00012 { 00013 inline bool operator() (const int i1, const int i2) const 00014 { 00015 return i1 < i2; 00016 } 00017 }; 00018 typedef set<int, myintcompare> intset; 00019 00020 00021 00028 struct TSpecialFactorRelation { 00029 CmpqsFactor factor; 00030 streampos fpos; 00031 00032 inline bool operator() (const TSpecialFactorRelation &t1, const TSpecialFactorRelation &t2) const 00033 { 00034 return t1.factor<t2.factor; 00035 } 00036 }; 00037 00038 00039 class SpecialRelations : private DynamicRelations 00040 { 00041 // this class is just here to encapsulate access to the functions 00042 // which are specific for handling special relations 00043 // (and special factors (=DLP, double large prime factors outside the static factorbase) 00044 00045 private: 00046 typedef set<TSpecialFactorRelation,TSpecialFactorRelation> TSpecialFactorRelations; 00047 static TSpecialFactorRelations SpecialFactorRelations; 00048 00049 // provide streams to access files of specialfactor-relations 00050 static filebuf FileBuffer; 00051 static ostream SpecialRelations_to_file; 00052 static istream SpecialRelations_from_file; 00053 00054 public: 00055 static int Count() { return SpecialFactorRelations.size()/2; } 00056 static void cleanup_files() 00057 { 00058 FileBuffer.close(); 00059 remove(SpecialRelationsFile.c_str()); 00060 } 00061 static void CycleSearch(); 00062 static bool insert(const CmpqsFactor &DLP, CRelation *GL, const short int HitCount=0); 00063 static bool insert(const CmpqsFactor &DLP, const string &GL_String); 00064 static bool SpecialFactor_splitable(const CmpqsFactor &DLP); 00065 static void split_by_primefactor(const int Primfaktor); 00066 static void Load(); 00067 friend int main(const int argc, const char* const argv[]); 00068 }; 00069 00070 #endif /* SPECIAL_RELATIONS_HEADER_ */