Ignore:
Timestamp:
Feb 23, 2008, 11:52:43 PM (14 years ago)
Author:
Peter
Message:

using Index class instead of std::vector<size_t>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/classifier/KernelLookup.h

    r1133 r1134  
    2929#include "Kernel.h"
    3030#include "yat/utility/Container2DIterator.h"
     31#include "yat/utility/Index.h"
    3132#include "yat/utility/iterator_traits.h"
    3233#include "yat/utility/SmartPtr.h"
    3334#include "yat/utility/StrideIterator.h"
    34 
    35 #include <vector>
    3635
    3736namespace theplu {
     
    120119    /// column index.
    121120    ///
    122     KernelLookup(const Kernel& kernel, const std::vector<size_t>& row,
    123                  const std::vector<size_t>& column, const bool owner=false);
     121    KernelLookup(const Kernel& kernel, const utility::Index& row,
     122                 const utility::Index& column, const bool owner=false);
    124123
    125124    ///
     
    152151    /// column index.
    153152    ///
    154     KernelLookup(const KernelLookup& kl, const std::vector<size_t>& row,
    155                  const std::vector<size_t>& column);
     153    KernelLookup(const KernelLookup& kl, const utility::Index& row,
     154                 const utility::Index& column);
    156155
    157156    ///
     
    167166    /// undefined.
    168167    ///
    169     KernelLookup(const KernelLookup& kernel, const std::vector<size_t>&,
     168    KernelLookup(const KernelLookup& kernel, const utility::Index&,
    170169                 const bool row=false);
    171170
     
    264263       to be deleted by the caller to avoid memory leaks.
    265264    */
    266     const KernelLookup* selected(const std::vector<size_t>& index) const;
     265    const KernelLookup* selected(const utility::Index& index) const;
    267266   
    268267    /**
     
    306305       to be deleted by the caller to avoid memory leaks.
    307306    */
    308     const KernelLookup* training_data(const std::vector<size_t>& train) const;
     307    const KernelLookup* training_data(const utility::Index& train) const;
    309308
    310309    /**
     
    320319    */
    321320    const KernelLookup*
    322     validation_data(const std::vector<size_t>& train,
    323                     const std::vector<size_t>& validation) const;
     321    validation_data(const utility::Index& train,
     322                    const utility::Index& validation) const;
    324323
    325324    /**
     
    336335  private:
    337336    const KernelLookup& operator=(const KernelLookup&);
    338 
    339     std::vector<size_t> column_index_;
     337    bool validate(const utility::Index&) const;
     338
     339    utility::Index column_index_;
    340340    utility::SmartPtr<const Kernel> kernel_;
    341     std::vector<size_t> row_index_;
     341    utility::Index row_index_;
    342342   
    343343  }; // class KernelLookup
Note: See TracChangeset for help on using the changeset viewer.