00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2011 Sergey Lisitsyn 00008 * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society 00009 */ 00010 00011 #ifndef LAPLACIANEIGENMAPS_H_ 00012 #define LAPLACIANEIGENMAPS_H_ 00013 #include <shogun/lib/config.h> 00014 #ifdef HAVE_LAPACK 00015 #include <shogun/preprocessor/DimensionReductionPreprocessor.h> 00016 #include <shogun/features/Features.h> 00017 #include <shogun/distance/Distance.h> 00018 00019 namespace shogun 00020 { 00021 00022 class CFeatures; 00023 00024 class CDistance; 00025 00048 class CLaplacianEigenmaps: public CDimensionReductionPreprocessor 00049 { 00050 public: 00051 00053 CLaplacianEigenmaps(); 00054 00056 virtual ~CLaplacianEigenmaps(); 00057 00061 virtual bool init(CFeatures* features); 00062 00066 virtual void cleanup(); 00067 00071 virtual SGMatrix<float64_t> apply_to_feature_matrix(CFeatures* features); 00072 00076 virtual SGVector<float64_t> apply_to_feature_vector(SGVector<float64_t> vector); 00077 00081 void inline set_k(int32_t k) 00082 { 00083 m_k = k; 00084 } 00085 00089 int32_t inline get_k() 00090 { 00091 return m_k; 00092 } 00093 00097 void inline set_tau(float64_t tau) 00098 { 00099 m_tau = tau; 00100 } 00101 00105 float64_t inline get_tau() 00106 { 00107 return m_tau; 00108 } 00109 00111 virtual inline const char* get_name() const { return "LaplacianEigenmaps"; }; 00112 00114 virtual inline EPreprocessorType get_type() const { return P_LAPLACIANEIGENMAPS; }; 00115 00116 protected: 00117 00119 void init(); 00120 00121 protected: 00122 00124 int32_t m_k; 00125 00127 float64_t m_tau; 00128 00129 }; 00130 } 00131 00132 #endif /* HAVE_LAPACK */ 00133 #endif /* LAPLACIANEIGENMAPS_H_ */