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/FeatureSelectorRandom.cc

    r1004 r1134  
    6262  void FeatureSelectorRandom::update(size_t total_N)
    6363  {
    64     features_.resize(0);
    65     features_.reserve(total_N);
     64    std::vector<size_t>* features = new std::vector<size_t>;
     65    features->reserve(total_N);
    6666    for (size_t i=0; i<total_N; ++i)
    67       features_.push_back(i);
     67      features->push_back(i);
    6868    // Peter should use random_sample here, but not included in std
    69     random::random_shuffle(features_.begin(), features_.end());
    70     features_.resize(N_);
     69    random::random_shuffle(features->begin(), features->end());
     70    features->resize(N_);
     71    features_ =
     72      utility::Index(utility::SmartPtr<const std::vector<size_t> >(features));
    7173  }
    7274
Note: See TracChangeset for help on using the changeset viewer.