Matrix Science header

ms_treecluster.hpp

00001 /*
00002 ##############################################################################
00003 # File: ms_treecluster.hpp                                                      #
00004 # Mascot Parser toolkit                                                      #
00005 # Utility functions for hierarchical clustering                              #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2012 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #    $Source: parser/inc/ms_treecluster.hpp $
00012 #    $Author: villek@matrixscience.com $ 
00013 #      $Date: 2019-05-10 10:45:13 +0100 $ 
00014 #  $Revision: 3770d1f7ee65bb20469e6c0ca909b2045b16fd74 | MSPARSER_REL_2_8_1-0-gea32989045 $
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     }; // ms_treecluster // end of tools_group
00112 } // matrix_science
00113 
00114 #endif // MS_TREECLUSTER_HPP
00115 
00116 /*------------------------------- End of File -------------------------------*/

Copyright © 2022 Matrix Science Ltd.  All Rights Reserved. Generated on Thu Mar 31 2022 01:12:30