Changeset 931 for trunk/yat/classifier/KNN.h
- Timestamp:
- Oct 5, 2007, 5:42:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/classifier/KNN.h
r916 r931 168 168 { 169 169 KNN* knn=0; 170 if(data.weighted()) { 171 knn=new KNN<Distance>(dynamic_cast<const MatrixLookupWeighted&>(data), 172 target); 173 } 174 knn->k(this->k()); 170 try { 171 if(data.weighted()) { 172 knn=new KNN<Distance>(dynamic_cast<const MatrixLookupWeighted&>(data), 173 target); 174 } 175 knn->k(this->k()); 176 } 177 catch (std::bad_cast) { 178 std::string str = "Error in KNN<Distance>::make_classifier: DataLookup2D of unexpected class."; 179 throw std::runtime_error(str); 180 } 175 181 return knn; 176 182 }
Note: See TracChangeset
for help on using the changeset viewer.