Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members Related Pages

# MatchInfoList.h

Go to the documentation of this file.

    00001
    00037 #ifndef __MATCH_INFO_LIST_H__
    00038 #define __MATCH_INFO_LIST_H__
    00039
    00040 class MatchInfo
    00041 {
    00042 public:
    00043         double distance;
    00044         int prototype;
    00045         DAGPtr pDag;
    00046         double similarity;
    00047
    00048         MatchInfo() { distance = 0; prototype = 0; similarity = 0; }
    00049
    00050         MatchInfo(int prot, double dist)
    00051         {
    00052                 distance = dist;
    00053                 prototype = prot;
    00054         }
    00055
    00056         friend bool operator< (const MatchInfo& a, const MatchInfo& b)
    00057         {
    00058                 double ap;
    00059                 double bp;
    00060
    00061                 ap = a.distance;
    00062                 bp = b.distance;
    00063
    00064                 if(ap < bp)
    00065                         return true;
    00066                 else
    00067                         return false;
    00068         }
    00069
    00070         // The stream operators are implemented only to satisfy LEDA requirements
    00071         friend ostream& operator<<(ostream &os, const MatchInfo& mi) { return os; }
    00072         friend istream& operator>>(istream &is, MatchInfo& mi) { return is; }
    00073 };
    00074
    00075 class MatchInfoList : public leda_list<MatchInfo>
    00076 {
    00077         int m_nMaxMatches;
    00078         double m_dSimilarityTau;
    00079
    00080         // Stats
    00081         double m_dMinSimilarity;
    00082         double m_dMaxSimilarity;
    00083         int m_nSamplesRead;
    00084
    00085 public:
    00086         MatchInfoList(int nMaxMatches);
    00087         MatchInfoList(double dSimilarityTau);
    00088
    00089         Clear();
    00090
    00091         Add();
    00092
    00093         GetFirstMatchPos();
    00094         GetNextMatch(pos);
    00095
    00096         PrintStats(ostream os = cout);
    00097 };
    00098
    00099 #endif // __MATCH_INFO_LIST_H__