Show
Ignore:
Timestamp:
03/02/07 16:16:43 (2 years ago)
Author:
ug
Message:

Basic functions for hashing of center patterns (no search capability yet).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 06/libkombilo-branches/hash_center/search.h

    r230 r233  
    396396  public: 
    397397    HashInstance(char X, char Y, char SIZEX, char SIZEY, int BOARDSIZE); 
    398     ~HashInstance(); 
     398    virtual ~HashInstance(); 
    399399    bool inRelevantRegion(char X, char Y); 
    400400 
     
    407407    bool changed; 
    408408 
    409     void initialize(); 
    410     void finalize(); 
     409    virtual void initialize(); 
     410    virtual void finalize(); 
     411    virtual void addB(char x, char y); 
     412    virtual void removeB(char x, char y); 
     413    virtual void addW(char x, char y); 
     414    virtual void removeW(char x, char y); 
     415    virtual void bppush(); 
     416    virtual void bppop(); 
     417    virtual std::pair<hashtype,int> cHC();  // returns current hash code and corresp. index 
     418    hashtype* currentHashCode; // array of 8 hashtype values (to automatically symmetrize hash codes) 
     419    std::stack<std::pair<hashtype*,int> >* branchpoints; 
     420    int numStones; 
     421}; 
     422 
     423class HashInstanceCO : public HashInstance { 
     424  public: 
     425    HashInstanceCO(char X, char Y, char SIZEX, char SIZEY, int BOARDSIZE); 
     426    virtual ~HashInstanceCO(); 
     427 
    411428    void addB(char x, char y); 
    412429    void removeB(char x, char y); 
    413430    void addW(char x, char y); 
    414431    void removeW(char x, char y); 
    415     void bppush(); 
    416     void bppop(); 
    417     std::pair<hashtype,int> cHC();  // returns min(currentHashCode) and corresp. index 
    418     hashtype* currentHashCode; // array of 8 hashtype values (to automatically symmetrize hash codes) 
    419     std::stack<std::pair<hashtype*,int> >* branchpoints; 
    420     int numStones; 
     432}; 
     433 
     434class HashInstanceCTR : public HashInstance { 
     435  public: 
     436    HashInstanceCTR(char X, char Y, char SIZEX, char SIZEY, int BOARDSIZE); 
     437    virtual ~HashInstanceCTR(); 
     438 
     439    void addB(char x, char y); 
     440    void removeB(char x, char y); 
     441    void addW(char x, char y); 
     442    void removeW(char x, char y); 
    421443}; 
    422444 
     
    445467    virtual int insert_hash(hashtype hashCod, int pos); 
    446468    virtual std::pair<hashtype,int> compute_hashkey(PatternList& pl, int CS); 
    447     std::vector<HashInstance>* hi; 
     469    std::vector<HashInstance* >* hi; 
    448470    std::string dbnameext; 
    449471    int maxNumStones; 
     
    465487//     int sizeY; 
    466488// }; 
     489 
     490class Algo_hash_center : public Algo_hash { 
     491  public: 
     492    Algo_hash_center(int bsize); 
     493    void initialize_process(sqlite3* DB) throw(DBError); 
     494    void endOfNode_process(); 
     495    void finalize_process(); 
     496    std::pair<hashtype,int> compute_hashkey(PatternList& pl, int CS); 
     497 
     498    std::map<hashtype, int> data; 
     499}; 
    467500 
    468501// class UIntervals {