00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef MS_TREECLUSTER_HPP
00019 #define MS_TREECLUSTER_HPP
00020
00021
00022 #include <string>
00023 #include <vector>
00024
00025
00026 namespace matrix_science {
00033
00034
00048 class MS_MASCOTRESFILE_API ms_treecluster: public ms_errors
00049 {
00050 public:
00051
00053
00060 enum TREE_CLUSTER_DISTANCE {
00061 TCD_CORRELATION,
00062 TCD_ABS_CORRELATION,
00063 TCD_UNCENTERED_CORRELATION,
00064 TCD_ABS_UNCENTERED_CORRELATION,
00065 TCD_SPEARMANS_RANK_CORRELATION,
00066 TCD_KENDALLS_TAU_CORRELATION,
00067 TCD_EUCLIDEAN,
00068 TCD_CITY_BLOCK
00069 };
00070
00072 ms_treecluster(int rows, int columns);
00073
00075 ms_treecluster(const ms_treecluster& right);
00076
00078 ~ms_treecluster();
00079
00080 #ifndef SWIG
00081
00082 ms_treecluster& operator=(const ms_treecluster& right);
00083 #endif
00084
00085 void copyFrom(const ms_treecluster* right);
00086
00088 void defaultValues();
00089
00091 bool setRow(int row, std::vector< double > datarow, std::vector< int > maskrow);
00092
00094 bool cluster(TREE_CLUSTER_DISTANCE tcd,
00095 ms_mascotresults::TREE_CLUSTER_METHOD tcm,
00096 const std::vector< double > & weight,
00097 std::vector< int > &left,
00098 std::vector< int > &right,
00099 std::vector< double > &distance,
00100 bool transpose = false );
00101
00102 private:
00103 int numRows_;
00104 int numCols_;
00105 double ** data_;
00106 int ** mask_;
00107
00108 void freeMemory();
00109
00110 };
00112 }
00113
00114 #endif // MS_TREECLUSTER_HPP
00115
00116