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 KERNELLOCALLYLINEAREMBEDDING_H_ 00012 #define KERNELLOCALLYLINEAREMBEDDING_H_ 00013 #include <shogun/lib/config.h> 00014 #ifdef HAVE_LAPACK 00015 #include <shogun/converter/LocallyLinearEmbedding.h> 00016 #include <shogun/features/Features.h> 00017 #include <shogun/distance/Distance.h> 00018 #include <shogun/kernel/Kernel.h> 00019 #include <shogun/lib/CoverTree.h> 00020 00021 namespace shogun 00022 { 00023 00024 class CFeatures; 00025 class CKernel; 00026 00044 class CKernelLocallyLinearEmbedding: public CLocallyLinearEmbedding 00045 { 00046 public: 00047 00049 CKernelLocallyLinearEmbedding(); 00050 00054 CKernelLocallyLinearEmbedding(CKernel* kernel); 00055 00057 virtual ~CKernelLocallyLinearEmbedding(); 00058 00060 virtual CFeatures* apply(CFeatures* features); 00061 00065 CDenseFeatures<float64_t>* embed_kernel(CKernel* kernel); 00066 00068 virtual const char* get_name() const; 00069 00071 protected: 00072 00074 virtual SGMatrix<float64_t> construct_weight_matrix(SGMatrix<float64_t> kernel_matrix, 00075 SGMatrix<int32_t> neighborhood_matrix); 00076 00083 virtual SGMatrix<int32_t> get_neighborhood_matrix(SGMatrix<float64_t> kernel_matrix, int32_t k); 00084 00085 00087 protected: 00088 00092 static void* run_linearreconstruction_thread(void* p); 00093 00094 }; 00095 } 00096 00097 #endif /* HAVE_LAPACK */ 00098 #endif /* KERNELLOCALLYLINEAREMBEDDING_H_ */