Generated on Tue Dec 16 12:49:16 2008 for BIU-2.2.0 by doxygen 1.5.1

src/biu/LatticeDescriptor.hh

Go to the documentation of this file.
00001 #ifndef LATTICEDESCRIPTOR_H_
00002 #define LATTICEDESCRIPTOR_H_
00003 
00004 
00005 #include <string>
00006 #include <vector>
00007 #include "LatticeNeighborhood.hh"
00008 
00009 namespace biu
00010 {
00011     // this definition can potentially improve performance
00012     // but can be saved by allowing Matrix<T> * vector<T> multiplication
00013     // and implicit castings IntPoint <-> vector<int>.
00014     // anyway this should be moved to IntPoint definition
00015     // or inside of class LatticeModel as private Method
00016     // /*! matrix point multiplication without typecast */
00017     // IntPoint operator*(const biu::Automorphism& am, const biu::IntPoint& p);
00018     
00028     class LatticeDescriptor {
00029 
00030     private:        
00031 
00032         std::string name;           
00034     protected:
00035         
00036         AutomorphismVec automorphisms;  
00039         IPointVec       latBase;        
00041         MoveAlphabet*   moveAlphabet;   
00049         LatticeNeighborhood*    latNeighborhood;
00050         
00055         std::vector<MoveSequence>   symMoveReplacement;
00056         
00057 
00061         struct NeighborData { 
00062             const char *name;       
00063             int vec[3];       
00064             int mat[3][3];    
00065             int invmat[3][3]; 
00066         };
00067         
00068         struct AutomorphismData {
00069             int _0[3];
00070             int _1[3];
00071             int _2[3];
00072         };
00073 
00078         virtual const NeighborData* getNeighborData() const = 0;
00079         
00081         virtual unsigned int getNeighborDataSize() const = 0; 
00082 
00084         virtual const AutomorphismData* getAutomorphismData() const = 0;
00085         
00087         virtual unsigned int getAutomorphismDataSize() const = 0; 
00088 
00089         
00095         void initNeighborhood(); 
00096         
00098         void initAutomorphisms();
00099         
00100     public:
00101     
00102         LatticeDescriptor(const std::string& name_);
00103         LatticeDescriptor(const LatticeDescriptor& toCopy);
00104         virtual ~LatticeDescriptor();
00105         
00107         const Alphabet* const getAlphabet() const { 
00108             return moveAlphabet; 
00109         }
00110 
00111         virtual std::string  getName() const;
00112         
00113         virtual const LatticeNeighborhood&  getNeighborhood() const;
00114 
00120         virtual bool areNeighbored( const IntPoint &first, 
00121                                     const IntPoint &second ) const;
00122         
00124         virtual const IPointVec&    getBase() const;
00125 
00127         virtual const AutomorphismVec&  getAutomorphisms() const;
00128 
00134         virtual std::string getString(const MoveSequence& moveSeq) const;
00135 
00141         virtual MoveSequence getSequence(const std::string& moveString) const;
00142         
00150         virtual MoveSequence normalizeSequence(const MoveSequence& moveSeq) const;
00151         
00152         virtual LatticeDescriptor& operator= (const LatticeDescriptor &ld2);
00153 
00154         bool    operator== (const LatticeDescriptor &ld2) const;
00155         bool    operator!= (const LatticeDescriptor &ld2) const;
00156         
00157     };
00158     
00159 }
00160 
00161 #include "LatticeDescriptor.icc"
00162 
00163 #endif /*LATTICEDESCRIPTOR_H_*/