- Timestamp:
- Mar 5, 2008, 3:26:08 PM (16 years ago)
- Location:
- trunk/yat/classifier
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/classifier/FeatureSelector.cc
r1134 r1204 41 41 FeatureSelector::~FeatureSelector() 42 42 { 43 for (std::list<const MatrixLookup*>::iterator i=garbage_.begin();44 i!=garbage_.end(); ++i)45 delete *i;46 for (std::list<const MatrixLookupWeighted*>::iterator i=47 garbage_weighted_.begin(); i!=garbage_weighted_.end(); ++i)48 delete *i;49 43 } 50 44 … … 56 50 57 51 58 const MatrixLookup &FeatureSelector::get(const MatrixLookup& matrix)52 const MatrixLookup FeatureSelector::get(const MatrixLookup& matrix) 59 53 { 60 garbage_.push_back(new MatrixLookup(matrix,utility::Index(features_),true)); 61 return *garbage_.back(); 54 return MatrixLookup(matrix, features_,true); 62 55 } 63 56 64 57 65 const MatrixLookupWeighted &58 const MatrixLookupWeighted 66 59 FeatureSelector::get(const MatrixLookupWeighted& matrix) 67 60 { 68 garbage_weighted_.push_back(new MatrixLookupWeighted(matrix, 69 utility::Index(features_), 70 true)); 71 return *garbage_weighted_.back(); 61 return MatrixLookupWeighted(matrix, features_, true); 72 62 } 73 63 -
trunk/yat/classifier/FeatureSelector.h
r1134 r1204 57 57 /// @return MatrixLookup containing only selected features. 58 58 /// 59 const MatrixLookup &get(const MatrixLookup& data);59 const MatrixLookup get(const MatrixLookup& data); 60 60 61 61 /// 62 62 /// @return MatrixLookupWeighted containing only selected features. 63 63 /// 64 const MatrixLookupWeighted &get(const MatrixLookupWeighted& data);64 const MatrixLookupWeighted get(const MatrixLookupWeighted& data); 65 65 66 66 /// … … 97 97 98 98 private: 99 std::list<const MatrixLookup*> garbage_;100 std::list<const MatrixLookupWeighted*> garbage_weighted_;101 99 102 100 };
Note: See TracChangeset
for help on using the changeset viewer.