StaticRelations.H

Go to the documentation of this file.
00001 
00007 #ifndef STATIC_RELATIONS_HEADER_
00008 #define STATIC_RELATIONS_HEADER_
00009 
00010 
00011 class StaticRelations : private StaticFactorbaseSettings
00012 {
00013  // this class is just here to encapsulate access to the functions
00014  // which are specific for handling static relations
00015 
00016  private:
00017   static CRelation* GLS[StaticFactorbase::MaxSize];
00018    // linear system of equations consisting of pointers to relations;
00019    // initialized with Null-pointers, (since there are no relations at the
00020    // beginning)
00021 
00022   static int Filling_GLS; // #relations in system of equations
00023 
00024   // To store the relations of the static factorbase to external memory,
00025   // we provide the following streams:
00026   static filebuf FileBuffer;
00027   static ostream StaticRelations_to_file;
00028   static istream StaticRelations_from_file;
00029 
00030  public:
00031   static void insert(CRelation *GL, const bool do_multi_combine_init=true);
00032   static void Load();
00033 
00034   static int Count() { return Filling_GLS; }
00035   static void cleanup_files()
00036    {
00037      FileBuffer.close();
00038      remove(StaticRelationsFile.c_str());
00039    }
00040   static void cleanup_memory()
00041    {
00042      int count = 0;
00043      for (int i=0; i<StaticFactorbaseSettings::MaxSize; ++i)
00044       if (GLS[i]) { delete GLS[i]; ++count; }
00045      Filling_GLS=0;
00046 #ifdef VERBOSE_INFO
00047      cout << count << " relations deallocated." << endl;
00048 #endif
00049    }
00050  friend int main(const int argc, const char* const argv[]);
00051 };
00052 
00053 #endif /* STATIC_RELATIONS_HEADER_ */

Generated on Wed Nov 7 23:29:26 2007 for Qsieve by  doxygen 1.5.4