Changeset 566


Ignore:
Timestamp:
Mar 16, 2006, 5:21:05 PM (16 years ago)
Author:
Peter
Message:

fixed bug in selected function in Kernels

Location:
trunk/lib/classifier
Files:
6 edited

Legend:

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

    r556 r566  
    6262
    6363  DataLookup2D::DataLookup2D(const std::vector<size_t>& row,
    64                              const std::vector<size_t>& col)
    65     : row_index_(row),column_index_(col), owner_(false)
     64                             const std::vector<size_t>& col,
     65                             const bool owner)
     66    : row_index_(row),column_index_(col), owner_(owner)
    6667  {
    6768  }
  • trunk/lib/classifier/DataLookup2D.h

    r555 r566  
    2929    /// as input.
    3030    ///
    31     DataLookup2D(const std::vector<size_t>&, const std::vector<size_t>&);
     31    DataLookup2D(const std::vector<size_t>&, const std::vector<size_t>&,
     32                 const bool owner = false);
    3233
    3334    ///
  • trunk/lib/classifier/Kernel.h

    r555 r566  
    4040    Kernel(const MatrixLookup& data, const KernelFunction& kf);
    4141
     42    ///
     43    /// @todo doc
     44    ///
    4245    Kernel(const MatrixLookup& data, const KernelFunction& kf,
    4346           const MatrixLookup& weight);
  • trunk/lib/classifier/KernelLookup.cc

    r559 r566  
    2424  KernelLookup::KernelLookup(const Kernel& kernel,
    2525                             const std::vector<size_t>& row,
    26                              const std::vector<size_t>& column)
    27     : DataLookup2D(row,column), kernel_(&kernel)
     26                             const std::vector<size_t>& column,
     27                             const bool owner)
     28    : DataLookup2D(row,column,owner), kernel_(&kernel)
    2829  {
    2930    // Checking that each row index is less than kernel.rows()
     
    9596
    9697  const KernelLookup*
    97   KernelLookup::selected(const std::vector<size_t>& index) const
     98  KernelLookup::selected(const std::vector<size_t>& inputs) const
    9899  {
    99     const Kernel* kernel = kernel_->selected(index);
    100     return new KernelLookup(*kernel, true);
     100    const Kernel* kernel = kernel_->selected(inputs);
     101    std::cout << rows() << "x" << columns() << std::endl;
     102    std::cout << kernel->rows() << "x" << kernel->columns() << std::endl;
     103    return new KernelLookup(*kernel, row_index_, column_index_, true);
    101104  }
    102105
  • trunk/lib/classifier/KernelLookup.h

    r565 r566  
    3535
    3636    ///
    37     /// Constructor creating a subKernel. The
    38     /// \f$i\f$th row in constructed lookup is identical to row number
    39     /// row[i] in matrix. The \f$i\f$th column in constructed lookup
    40     /// is identical to column number column[i] in matrix.
     37    /// Constructor creating a subKernel. The \f$i\f$th row in
     38    /// constructed lookup is identical to row number row[i] in
     39    /// matrix. The \f$i\f$th column in constructed lookup is
     40    /// identical to column number column[i] in matrix. If @a owner is
     41    /// set to true @a kernel is destroyed in destructor.
    4142    ///
    4243    /// @note If @a kernel goes out of scope or is deleted, the
     
    4849    ///
    4950    KernelLookup(const Kernel& kernel, const std::vector<size_t>& row,
    50                  const std::vector<size_t>& column);
     51                 const std::vector<size_t>& column, const bool owner=false);
    5152   
    5253    ///
  • trunk/lib/classifier/KernelWeighted_SEV.cc

    r548 r566  
    99#include <c++_tools/gslapi/matrix.h>
    1010#include <c++_tools/gslapi/vector.h>
     11
     12#include <cassert>
    1113
    1214namespace theplu {
     
    2830  {
    2931    build_kernel();
     32    assert(rows() == other.rows());
     33    assert(columns() == other.columns());
    3034  }
    3135 
Note: See TracChangeset for help on using the changeset viewer.