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 00032 #ifndef PDISTFILTER_H 00033 #define PDISTFILTER_H 00034 00035 // ---------------------------- Internal Headers ---------------------------- // 00036 00037 #include "Filter.h" 00038 00039 // ---------------------------- External Headers ---------------------------- // 00040 00047 class PDistFilter: public Filter 00048 { 00049 protected: 00050 // Whether or not to print the results 00051 bool print; 00052 00053 // The minimum similarity 00054 double maxpdist; 00055 00056 // The truth matrix 00057 TruthMatrix* tm; 00058 00059 // The sets 00060 vector<ItemSet> sets; 00061 00062 // If it has not filtered before 00063 /*bool firsttime; 00064 00065 // The compatibles 00066 vector<vector<unsigned int> > compatibles;*/ 00067 00068 /*virtual void findCompatibles(TruthMatrix& tm); 00069 virtual bool inprogress(const vector<unsigned int>& rotor) const; 00070 virtual void turn(vector<unsigned int>& rotor, const ItemSet& is) const; 00071 virtual bool ismatch(const vector<vector<unsigned int> >& indecies1, 00072 const vector<vector<unsigned int> >& indecies2, 00073 unsigned int& distance) const;*/ 00074 virtual void evaluateall(); 00075 virtual bool ismatch(const vector<vector<unsigned int> >& indecies1, 00076 const vector<vector<unsigned int> >& indecies2, double& distance) 00077 const; 00078 00079 public: 00080 PDistFilter(double maxpdist = 0.0, bool print = true); 00081 PDistFilter(const PDistFilter& src); 00082 virtual ~PDistFilter(); 00083 virtual PDistFilter& operator =(const PDistFilter& rhs); 00084 virtual bool filter(const ItemSet& is, TruthMatrix& tm, string& msg); 00085 }; 00086 00087 #endif