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: /vol/cvsroot/parser/inc/ms_treecluster.hpp,v $
00012 #    $Author: davidc $ 
00013 #      $Date: 2012/08/09 11:02:14 $ 
00014 #  $Revision: 1.1 $
00015 ##############################################################################
00016 */
00017 
00018 #ifndef MS_TREECLUSTER_HPP
00019 #define MS_TREECLUSTER_HPP
00020 
00021 #ifdef _WIN32
00022 #pragma warning(disable:4251)   // Don't want all classes to be exported
00023 #pragma warning(disable:4786)   // Debug symbols too long
00024 #   ifndef _MATRIX_USE_STATIC_LIB
00025 #       ifdef MS_MASCOTRESFILE_EXPORTS
00026 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00027 #       else
00028 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00029 #       endif
00030 #   else
00031 #       define MS_MASCOTRESFILE_API
00032 #   endif
00033 #else
00034 #   define MS_MASCOTRESFILE_API
00035 #endif
00036 
00037 // for the sake of #include <string>
00038 #ifdef __ALPHA_UNIX__
00039 #include <ctype.h>
00040 #endif
00041 #include <string>
00042 #include <vector>
00043 
00044 
00045 namespace matrix_science {
00052 
00053 
00067     class MS_MASCOTRESFILE_API ms_treecluster: public ms_errors
00068     {
00069     public:
00070 
00072 
00079         enum TREE_CLUSTER_DISTANCE {
00080             TCD_CORRELATION,                
00081             TCD_ABS_CORRELATION,            
00082             TCD_UNCENTERED_CORRELATION,     
00083             TCD_ABS_UNCENTERED_CORRELATION, 
00084             TCD_SPEARMANS_RANK_CORRELATION, 
00085             TCD_KENDALLS_TAU_CORRELATION,   
00086             TCD_EUCLIDEAN,                  
00087             TCD_CITY_BLOCK                  
00088         };
00089 
00091         ms_treecluster(int rows, int columns);
00092 
00094         ms_treecluster(const ms_treecluster& right);
00095 
00097         ~ms_treecluster();
00098 
00099 #ifndef SWIG
00100 
00101         ms_treecluster& operator=(const ms_treecluster& right);
00102 #endif
00103 
00104         void copyFrom(const ms_treecluster* right);
00105 
00107         void defaultValues();
00108 
00110         bool setRow(int row, std::vector< double > datarow, std::vector< int > maskrow);
00111 
00113         bool cluster(TREE_CLUSTER_DISTANCE tcd, 
00114                      ms_mascotresults::TREE_CLUSTER_METHOD tcm,
00115                      const std::vector< double > & weight,
00116                      std::vector< int >    &left, 
00117                      std::vector< int >    &right, 
00118                      std::vector< double > &distance, 
00119                      bool transpose = false );
00120 
00121     private:
00122         int numRows_;
00123         int numCols_;
00124         double ** data_;
00125         int    ** mask_;
00126 
00127         void freeMemory();
00128 
00129     }; // ms_treecluster // end of tools_group
00131 } // matrix_science
00132 
00133 #endif // MS_TREECLUSTER_HPP
00134 
00135 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51