Ignore:
Timestamp:
Mar 19, 2009, 1:35:47 PM (13 years ago)
Author:
Peter
Message:

fixes #504. Also added pp macro YAT_ASSERT that calls yat_assert with an appropriate msg

File:
1 edited

Legend:

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

    r1487 r1875  
    77  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
    88  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     9  Copyright (C) 2009 Peter Johansson
    910
    1011  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    217218    : f_selector_(NULL), sampler_(sampler)
    218219  {
    219     utility::yat_assert<std::runtime_error>(target().size()==data.columns());
     220    YAT_ASSERT(target().size()==data.columns());
    220221
    221222    training_data_.reserve(sampler_.size());
    222223    validation_data_.reserve(sampler_.size());
    223224    build(data);
    224     utility::yat_assert<std::runtime_error>(training_data_.size()==size());
    225     utility::yat_assert<std::runtime_error>(training_target_.size()==size());
    226     utility::yat_assert<std::runtime_error>(validation_data_.size()==size());
    227     utility::yat_assert<std::runtime_error>(validation_target_.size()==size());
     225    YAT_ASSERT(training_data_.size()==size());
     226    YAT_ASSERT(training_target_.size()==size());
     227    YAT_ASSERT(validation_data_.size()==size());
     228    YAT_ASSERT(validation_target_.size()==size());
    228229  }
    229230
     
    235236    : f_selector_(&fs), sampler_(sampler)
    236237  {
    237     utility::yat_assert<std::runtime_error>(target().size()==data.columns());
     238    YAT_ASSERT(target().size()==data.columns());
    238239    features_.reserve(size());
    239240    training_data_.reserve(size());
    240241    validation_data_.reserve(size());
    241242    build(data);
    242     utility::yat_assert<std::runtime_error>(training_data_.size()==size());
    243     utility::yat_assert<std::runtime_error>(training_target_.size()==size());
    244     utility::yat_assert<std::runtime_error>(validation_data_.size()==size());
    245     utility::yat_assert<std::runtime_error>(validation_target_.size()==size());
     243    YAT_ASSERT(training_data_.size()==size());
     244    YAT_ASSERT(training_target_.size()==size());
     245    YAT_ASSERT(validation_data_.size()==size());
     246    YAT_ASSERT(validation_target_.size()==size());
    246247  }
    247248
     
    250251  SubsetGenerator<Data>::~SubsetGenerator()
    251252  {
    252     utility::yat_assert<std::runtime_error>(training_data_.size()==validation_data_.size());
     253    YAT_ASSERT(training_data_.size()==validation_data_.size());
    253254    for (size_t i=0; i<training_data_.size(); i++)
    254255      delete training_data_[i];
     
    272273          new MatrixLookup(ml, training_index(k), false);
    273274        // use these data to create feature selection
    274         utility::yat_assert<std::runtime_error>(train_data_all_feat);
     275        YAT_ASSERT(train_data_all_feat);
    275276        f_selector_->update(*train_data_all_feat, training_target(k));
    276277        // get features
    277278        features_.push_back(f_selector_->features());
    278         utility::yat_assert<std::runtime_error>(train_data_all_feat);
     279        YAT_ASSERT(train_data_all_feat);
    279280        delete train_data_all_feat;
    280281      }
Note: See TracChangeset for help on using the changeset viewer.