Biorithm  1.1
 All Classes Functions Variables Typedefs Friends
PatternBounder.h
00001 /**************************************************************************
00002  * Copyright (c) 2007 Clifford Conley Owens III                           *
00003  *                                                                        *
00004  * This file is part of Biorithm.                                         *
00005  *                                                                        *
00006  * Biorithm is free software: you can redistribute it and/or modify       *
00007  * it under the terms of the GNU General Public License as published by   *
00008  * the Free Software Foundation, either version 3 of the License, or      *
00009  * (at your option) any later version.                                    *
00010  *                                                                        *
00011  * Biorithm is distributed in the hope that it will be useful,            *
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00014  * GNU General Public License for more details.                           *
00015  *                                                                        *
00016  * You should have received a copy of the GNU General Public License      *
00017  * along with Biorithm.  If not, see <http://www.gnu.org/licenses/>.      *
00018  *                                                                        *
00019  **************************************************************************/
00020 
00031 #ifndef PATTERNBOUNDER_H
00032 #define PATTERNBOUNDER_H
00033 
00034 // ---------------------------- Internal Headers ---------------------------- //
00035 
00036 #include "Lattice.h"
00037 
00043 class PatternBounder
00044 {
00045     public:
00047         // The destructor                                                     //
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
 All Classes Functions Variables Typedefs Friends