]> git.donarmstrong.com Git - mothur.git/blobdiff - kruskalwalliscommand.h
updated kruskalwallis struct
[mothur.git] / kruskalwalliscommand.h
index 7e526137bc42daa1928c7e0988e1b52d546dbf2a..3b5fdcea8975ecc774116fc4f8a824d0db8e64aa 100644 (file)
 
 #include "command.hpp"
 
-class KruskalWallisCommand : public Command {
 
+
+class KruskalWallisCommand : public Command {
+   
 public:
-       
+           
        KruskalWallisCommand(string);   
        KruskalWallisCommand();
        ~KruskalWallisCommand(){}
@@ -26,9 +28,15 @@ public:
        string getCitation() { return "http://www.mothur.org/wiki/kruskalwallis"; }
        string getDescription()         { return "Non-parametric method for testing whether samples originate from the same distribution."; }
     
+    struct groupRank {
+        sstring group;
+        double value;
+        double rank;        
+    };
+    
     int execute(); 
        void help() { m->mothurOut(getHelpString()); }
-    multimap<double,double> getRank(vector<KruskalWallisCommand::groupRank>);
+    void assignRank(vector<groupRank>);
     
 private:
     string outputDir;
@@ -36,6 +44,14 @@ private:
     vector<double> rankSums;
     vector<double> rankMeans;
     
+  
+        
+    bool comparevalue(const groupRank &a, const groupRank &b) { return a.value < b.value; }
+    bool equalvalue(const groupRank &a, const groupRank &b) { return a.value == b.value; }
+    bool comparerank(const groupRank &a, const groupRank &b) { return a.rank < b.rank; }
+    bool equalrank(const groupRank &a, const groupRank &b) { return a.rank == b.rank; }
+    bool equalgroup(const groupRank &a, const groupRank &b) { return a.group == b.group; }
+    
 };
 
 #endif /* KRUSKALWALLISCOMMAND_H */