00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00031 #ifndef PATTERNBOUNDER_H
00032 #define PATTERNBOUNDER_H
00033
00034
00035
00036 #include "Lattice.h"
00037
00043 class PatternBounder
00044 {
00045 public:
00047
00049 virtual ~PatternBounder()
00050 {
00051
00052 }
00053
00054 virtual double getUpperBound(const Lattice* lattice,
00055 unsigned int curlevel, unsigned int nextlevel) const = 0;
00056 virtual double getLowerBound(const Lattice* lattice,
00057 unsigned int curlevel, unsigned int nextlevel) const = 0;
00058 };
00059
00065 class KKBounder: public PatternBounder
00066 {
00067 protected:
00068 virtual double kcanonical(unsigned int n, unsigned int k,
00069 vector<unsigned int>& ms, unsigned int& start) const;
00070 virtual double kkUpperBound(unsigned int number,
00071 unsigned int curlevel, unsigned int nextlevel) const;
00072 virtual double kkLowerBound(unsigned int number,
00073 unsigned int curlevel, unsigned int nextlevel) const;
00074 public:
00075 KKBounder();
00076 KKBounder(const KKBounder& src);
00077 virtual ~KKBounder();
00078 virtual KKBounder& operator =(const KKBounder& rhs);
00079 virtual double getUpperBound(const Lattice* lattice,
00080 unsigned int curlevel, unsigned int nextlevel) const;
00081 virtual double getLowerBound(const Lattice* lattice,
00082 unsigned int curlevel, unsigned int nextlevel) const;
00083 };
00084
00090 class ImprovedBounder: public KKBounder
00091 {
00092 public:
00093 ImprovedBounder();
00094 ImprovedBounder(const ImprovedBounder& src);
00095 virtual ~ImprovedBounder();
00096 virtual ImprovedBounder& operator =(const ImprovedBounder& rhs);
00097 virtual double getUpperBound(const Lattice* lattice,
00098 unsigned int curlevel, unsigned int nextlevel) const;
00099 virtual double getLowerBound(const Lattice* lattice,
00100 unsigned int curlevel, unsigned int nextlevel) const;
00101 };
00102
00103 #endif