Ignore:
Timestamp:
Mar 1, 2006, 12:23:53 PM (16 years ago)
Author:
Peter
Message:

Modified Kernel to be built from MatrixLookup? rather than
gslapi::matrix. Also changed interface to create DataLookup1D from
DataLookup2D - is now coherent with gslapi.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/classifier/Kernel_SEV.cc

    r523 r527  
    33#include <c++_tools/classifier/Kernel_SEV.h>
    44
     5#include <c++_tools/classifier/DataLookup1D.h>
    56#include <c++_tools/classifier/Kernel.h>
    67#include <c++_tools/classifier/KernelFunction.h>
     8#include <c++_tools/classifier/MatrixLookup.h>
    79#include <c++_tools/gslapi/matrix.h>
    810#include <c++_tools/gslapi/vector.h>
     
    1214
    1315
    14   Kernel_SEV::Kernel_SEV(const gslapi::matrix& data, const KernelFunction& kf)
     16  Kernel_SEV::Kernel_SEV(const MatrixLookup& data, const KernelFunction& kf)
    1517    : Kernel(data,kf)
    1618  {
    1719    kernel_matrix_ = gslapi::matrix(data.columns(),data.columns());
    1820    for (size_t i=0; i<kernel_matrix_.rows(); i++)
    19       for (size_t j=i; j<kernel_matrix_.columns(); j++) 
     21      for (size_t j=i; j<kernel_matrix_.columns(); j++)
    2022        kernel_matrix_(i,j) = kernel_matrix_(j,i) =
    21           (*kf_)(gslapi::vector(data_,i,false),gslapi::vector(data_,j,false));
     23          (*kf_)(DataLookup1D(data_,i,false),DataLookup1D(data_,j,false));
    2224  }
    23 
    24   double Kernel_SEV::element(const gslapi::vector& vec, const size_t i) const
     25  double Kernel_SEV::element(const DataLookup1D& vec, const size_t i) const
    2526  {
    26     return kf_->operator()(vec, gslapi::vector(data_,i));
     27    return kf_->operator()(vec, DataLookup1D(data_,i));
    2728  }
    2829
Note: See TracChangeset for help on using the changeset viewer.