Changeset 331
- Timestamp:
- Jun 2, 2005, 12:06:51 AM (18 years ago)
- Location:
- trunk/lib/svm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/svm/KernelView.cc
r330 r331 1 // $Id :$1 // $Id$ 2 2 3 3 #include <c++_tools/svm/KernelView.h> … … 13 13 14 14 KernelView::KernelView(const Kernel& kernel, const std::vector<size_t>& index) 15 : Kernel(data,kf),kernel_(&kernel), index_(index)15 : kernel_(&kernel), index_(index) 16 16 { 17 // to view into the original kernel rather than a view 18 //if (kernel.is_view()){ 19 // kernel_=kernel.kernel_; 20 // for (size_t i=0; i<index.size(); i++) 21 // index_[i]=kernel.index_[index[i]]; 22 //} 17 23 } 18 24 -
trunk/lib/svm/KernelView.h
r330 r331 23 23 /// 24 24 /// Contructor taking the Kernel to view into and a vector of the 25 /// indeces we view into. If Kernel is a KernelView it implemented 26 /// to view into something that is viewing into... and may 25 /// indeces we view into. The constructed Kernel matrix will have 26 /// dimensions \f$NxN\f$ where \f$N\f$ is the size of \a index. If 27 /// Kernel is a KernelView, as now it implemented to view into the 28 /// view rather directly into the original Kernel, and may 27 29 /// therefore be slow. Use instead the original Kernel and view 28 30 /// directly into that. 29 31 /// 30 KernelView(const Kernel& , const std::vector<size_t>&);32 KernelView(const Kernel& kernel, const std::vector<size_t>& index); 31 33 32 34 /// … … 46 48 /// 47 49 inline double operator()(const size_t row,const size_t column) const 48 { return (*kernel_)(index[row],index[column]); } 50 { return (*kernel_)(index_[row],index_[column]); } 51 52 /// 53 /// @brief number of samples 54 /// 55 size_t size(void) const { return index_.size(); } 49 56 57 50 58 private: 51 59 const Kernel* kernel_; -
trunk/lib/svm/Makefile.am
r330 r331 10 10 libsvm_la_SOURCES = \ 11 11 ConsensusInputRanker.cc CrossValidation.cc GaussianKernelFunction.cc \ 12 InputRanker.cc Kernel.cc Kernel_MEV.cc Kernel_SEV.cc \12 InputRanker.cc Kernel.cc Kernel_MEV.cc Kernel_SEV.cc KernelView.cc\ 13 13 PolynomialKernelFunction.cc SVM.cc 14 14 … … 18 18 ConsensusInputRanker.h CrossValidation.h GaussianKernelFunction.h \ 19 19 InputRanker.h Kernel.h KernelFunction.h Kernel_MEV.h Kernel_SEV.h \ 20 PolynomialKernelFunction.h SVM.h20 KernelView.h PolynomialKernelFunction.h SVM.h
Note: See TracChangeset
for help on using the changeset viewer.