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 <map> 00008 #include "LatticeNeighborhood.hh" 00009 00010 namespace biu 00011 { 00012 // this definition can potentially improve performance 00013 // but can be saved by allowing Matrix<T> * vector<T> multiplication 00014 // and implicit castings IntPoint <-> vector<int>. 00015 // anyway this should be moved to IntPoint definition 00016 // or inside of class LatticeModel as private Method 00017 // /*! matrix point multiplication without typecast */ 00018 // IntPoint operator*(const biu::Automorphism& am, const biu::IntPoint& p); 00019 00029 class LatticeDescriptor { 00030 00031 private: 00032 00033 std::string name; 00035 protected: 00036 00037 AutomorphismVec automorphisms; 00040 IPointVec latBase; 00042 MoveAlphabet* moveAlphabet; 00050 LatticeNeighborhood* latNeighborhood; 00051 00056 std::vector<MoveSequence> symMoveReplacement; 00057 00058 00062 struct NeighborData { 00063 const char *name; 00064 int vec[3]; 00065 int mat[3][3]; 00066 int invmat[3][3]; 00067 }; 00068 00069 struct AutomorphismData { 00070 int _0[3]; 00071 int _1[3]; 00072 int _2[3]; 00073 }; 00074 00079 virtual const NeighborData* getNeighborData() const = 0; 00080 00082 virtual unsigned int getNeighborDataSize() const = 0; 00083 00085 virtual const AutomorphismData* getAutomorphismData() const = 0; 00086 00088 virtual unsigned int getAutomorphismDataSize() const = 0; 00089 00090 00096 void initNeighborhood(); 00097 00099 void initAutomorphisms(); 00100 00101 public: 00102 00103 LatticeDescriptor(const std::string& name_); 00104 LatticeDescriptor(const LatticeDescriptor& toCopy); 00105 virtual ~LatticeDescriptor(); 00106 00108 const Alphabet* const getAlphabet() const { 00109 return moveAlphabet; 00110 } 00111 00112 virtual std::string getName() const; 00113 00114 virtual const LatticeNeighborhood& getNeighborhood() const; 00115 00121 virtual bool areNeighbored( const IntPoint &first, 00122 const IntPoint &second ) const; 00123 00125 virtual const IPointVec& getBase() const; 00126 00128 virtual const AutomorphismVec& getAutomorphisms() const; 00129 00135 virtual std::string getString(const MoveSequence& moveSeq) const; 00136 00142 virtual MoveSequence getSequence(const std::string& moveString) const; 00143 00151 virtual MoveSequence normalizeSequence(const MoveSequence& moveSeq) const; 00152 00153 virtual LatticeDescriptor& operator= (const LatticeDescriptor &ld2); 00154 00155 bool operator== (const LatticeDescriptor &ld2) const; 00156 bool operator!= (const LatticeDescriptor &ld2) const; 00157 00158 }; 00159 00160 } 00161 00162 #include "LatticeDescriptor.icc" 00163 00164 #endif /*LATTICEDESCRIPTOR_H_*/