Ignore:
Timestamp:
Sep 5, 2006, 4:29:39 AM (15 years ago)
Author:
Peter
Message:

fixes #109 and #110

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/c++_tools/classifier/FeatureSelector.cc

    r608 r624  
    33#include "FeatureSelector.h"
    44
    5 #include "DataLookup2D.h"
     5#include "MatrixLookup.h"
     6#include "MatrixLookupWeighted.h"
    67
    78#include <list>
     
    1920  FeatureSelector::~FeatureSelector()
    2021  {
    21     for (std::list<const DataLookup2D*>::iterator i=garbage_.begin();
     22    for (std::list<const MatrixLookup*>::iterator i=garbage_.begin();
    2223         i!=garbage_.end(); ++i)
     24      delete *i;
     25    for (std::list<const MatrixLookupWeighted*>::iterator i=
     26           garbage_weighted_.begin(); i!=garbage_weighted_.end(); ++i)
    2327      delete *i;
    2428  }
    2529
    2630
    27   const DataLookup2D& FeatureSelector::get(const DataLookup2D& data)
     31  const MatrixLookup& FeatureSelector::get(const MatrixLookup& matrix)
    2832  {
    29     garbage_.push_back(data.selected(features_));
     33    garbage_.push_back(new MatrixLookup(matrix,features_,true));
    3034    return *garbage_.back();
     35  }
     36
     37
     38  const MatrixLookupWeighted&
     39  FeatureSelector::get(const MatrixLookupWeighted& matrix)
     40  {
     41    garbage_weighted_.push_back(new MatrixLookupWeighted(matrix,features_,
     42                                                         true));
     43    return *garbage_weighted_.back();
    3144  }
    3245
Note: See TracChangeset for help on using the changeset viewer.