Changeset 331


Ignore:
Timestamp:
Jun 2, 2005, 12:06:51 AM (18 years ago)
Author:
Peter
Message:

add KernelView? in makefile and small fixes

Location:
trunk/lib/svm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/svm/KernelView.cc

    r330 r331  
    1 // $Id:$
     1// $Id$
    22
    33#include <c++_tools/svm/KernelView.h>
     
    1313
    1414KernelView::KernelView(const Kernel& kernel, const std::vector<size_t>& index)
    15   : Kernel(data,kf), kernel_(&kernel), index_(index)
     15  : kernel_(&kernel), index_(index)
    1616{
     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  //}
    1723}
    1824
  • trunk/lib/svm/KernelView.h

    r330 r331  
    2323    ///
    2424    /// 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
    2729    /// therefore be slow. Use instead the original Kernel and view
    2830    /// directly into that.
    2931    ///
    30     KernelView(const Kernel&, const std::vector<size_t>&);
     32    KernelView(const Kernel& kernel, const std::vector<size_t>& index);
    3133   
    3234    ///
     
    4648    ///
    4749    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(); }
    4956   
     57
    5058  private:
    5159    const Kernel* kernel_;
  • trunk/lib/svm/Makefile.am

    r330 r331  
    1010libsvm_la_SOURCES = \
    1111  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\
    1313  PolynomialKernelFunction.cc  SVM.cc
    1414
     
    1818  ConsensusInputRanker.h CrossValidation.h GaussianKernelFunction.h \
    1919  InputRanker.h Kernel.h KernelFunction.h Kernel_MEV.h Kernel_SEV.h \
    20   PolynomialKernelFunction.h SVM.h
     20  KernelView.h PolynomialKernelFunction.h SVM.h
Note: See TracChangeset for help on using the changeset viewer.