Changeset 9389:f05efbabf25f in orange


Ignore:
Timestamp:
12/20/11 17:02:21 (2 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
fb4acf85727dac76f7af9dbcf52ec7b9489ec58b
Message:

When reading the rho's, read the number into a string and then use strtod for conversion to double. This should properly handles NaN's.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/libsvm_interface.cpp

    r9347 r9389  
    216216            int n = model->nr_class * (model->nr_class-1)/2; 
    217217            model->rho = Malloc(double,n); 
    218             for(int i=0;i<n;i++) 
    219                 stream >> model->rho[i]; 
     218            string rho_str; 
     219            for(int i=0;i<n;i++){ 
     220                // Read the number into a string and then use strtod 
     221                // for proper handling of NaN's 
     222                stream >> rho_str; 
     223                model->rho[i] = strtod(rho_str.c_str(), NULL); 
     224            } 
    220225        } 
    221226        else if(strcmp(cmd,"label")==0) 
Note: See TracChangeset for help on using the changeset viewer.