Ignore:
Timestamp:
Oct 5, 2007, 5:42:25 PM (14 years ago)
Author:
Markus Ringnér
Message:

Working on ticket:259. Removed old Distance see ticket:250

File:
1 edited

Legend:

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

    r916 r931  
    168168  {     
    169169    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    }
    175181    return knn;
    176182  }
Note: See TracChangeset for help on using the changeset viewer.