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

# SGDistMeasurer.h

Go to the documentation of this file.

    00001
    00037 #ifndef __SG_DIST_MEASURER_H__
    00038 #define __SG_DIST_MEASURER_H__
    00039
    00040 #include "ShockGraph.h"
    00041
    00042 typedef DistMeasurerT<ShockGraph, SGNode> SGDistMeasurer;
    00043
    00044 class SGDistMeasurer1: public SGDistMeasurer
    00045 {
    00046         // The following integers will be the relative weights
    00047         // that will be given to the 1st and 2nd level of matching.
    00048         double w1, w2;
    00049
    00050         virtual double CompDistance() const;
    00051
    00052 public:
    00053         SGDistMeasurer1() { w1 = .7; w2 = 1 - w1; }
    00054         void SetWeights(double level1Weight, double level2Weight);
    00055
    00056 private:
    00057         double NodeDistanceLevel2(leda_node a, leda_node b) const;
    00058
    00059         double rule1(leda_node a, leda_node b) const;
    00060         double rule2(leda_node a, leda_node b) const;
    00061         double rule3(leda_node a, leda_node b) const;
    00062         double rule4(leda_node a, leda_node b) const;
    00063         double rule5_6(leda_node a, leda_node b) const;
    00064
    00065         double NodeDistanceLevel1() const;
    00066
    00067         double ElongationDiff() const;
    00068         double SweepContrastDiff() const;
    00069         double TaperDiff() const;
    00070         double AccelerationDiff() const;
    00071         double BendDiff() const;
    00072
    00073         double AverageRadius(const SGNode *u) const;
    00074         double Length(const SGNode *u) const;
    00075         double Elongation(const SGNode *u) const;
    00076         double SweepContrast(const SGNode *u) const;
    00077         double Acceleration(const SGNode *u) const;
    00078         double Bend(const SGNode *u) const;
    00079         double Taper(const SGNode *u) const;
    00080 };
    00081
    00082 class SGDistMeasurer2: public SGDistMeasurer
    00083 {
    00084         virtual double CompDistance() const;
    00085
    00086         //int NeighborsCount(leda_node v, int nNodeType) const;
    00087         //NODE_ROLE NodeRole(leda_node v) const;
    00088         //double ComputeScale(leda_node u, const ShockGraph& from, leda_node v) const;
    00089 };
    00090
    00091 class SGDistMeasurer3: public SGDistMeasurer
    00092 {
    00093         virtual double CompDistance() const;
    00094         void LogResults(const ModelFit& m1, const ModelFit& m2,
    00095                 POINTS g1Pts, POINTS g2Pts, bool bReverseOrder) const;
    00096 };
    00097
    00098
    00099 #endif //__SG_DIST_MEASURER_H__