Ignore:
Timestamp:
02/14/11 13:04:18 (3 years ago)
Author:
markotoplak
Branch:
default
Convert:
0926d5f056a1a20cc4b72cf0b1138f753c23967f
Message:

Replaced Variable->name with setter and getter. Interface to Python remained the same.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/discretize.cpp

    r6782 r7665  
    112112    raiseError("invalid attribute type (continuous attribute expected)"); 
    113113 
    114   TEnumVariable *evar=mlnew TEnumVariable("D_"+var->name); 
     114  TEnumVariable *evar=mlnew TEnumVariable("D_"+var->get_name()); 
    115115  PVariable revar(evar); 
    116116 
     
    184184{  
    185185  mindiff = 1.0; // Ignores the given mindiff; see http://www.ailab.si/orange/trac/ticket/576 
    186   TEnumVariable *evar = mlnew TEnumVariable("D_"+var->name); 
     186  TEnumVariable *evar = mlnew TEnumVariable("D_"+var->get_name()); 
    187187  PVariable revar(evar); 
    188188 
     
    235235    raiseError("invalid attribute type (continuous attribute expected)"); 
    236236 
    237   TEnumVariable *evar = mlnew TEnumVariable("D_"+var->name); 
     237  TEnumVariable *evar = mlnew TEnumVariable("D_"+var->get_name()); 
    238238  PVariable revar(evar); 
    239239 
     
    314314    raiseError("invalid attribute type (continuous attribute expected)"); 
    315315 
    316   TEnumVariable *evar=mlnew TEnumVariable("D_"+var->name); 
     316  TEnumVariable *evar=mlnew TEnumVariable("D_"+var->get_name()); 
    317317  PVariable revar(evar); 
    318318 
    319   TEnumVariable *cl_evar=mlnew TEnumVariable("D_"+var->name); 
     319  TEnumVariable *cl_evar=mlnew TEnumVariable("D_"+var->get_name()); 
    320320  PVariable cl_revar(cl_evar); 
    321321 
     
    395395PVariable TEquiDistDiscretization::operator()(PExampleGenerator gen, PVariable var, const long &) 
    396396{ if (var->varType!=TValue::FLOATVAR) 
    397     raiseError("attribute '%s' is not continuous", var->name.c_str()); 
     397    raiseError("attribute '%s' is not continuous", var->get_name().c_str()); 
    398398 
    399399  if (numberOfIntervals<=0) 
     
    406406    ++first; 
    407407  if (!first) 
    408     raiseError("attribute '%s' has no known values", var->name.c_str()); 
     408    raiseError("attribute '%s' has no known values", var->get_name().c_str()); 
    409409 
    410410  float max, min; 
     
    604604PVariable TEquiNDiscretization::operator()(PExampleGenerator gen, PVariable var, const long &weightID) 
    605605{ if (var->varType!=TValue::FLOATVAR) 
    606     raiseError("attribute '%s' is not continuous", var->name.c_str()); 
     606    raiseError("attribute '%s' is not continuous", var->get_name().c_str()); 
    607607 
    608608  int varPos=gen->domain->getVarNum(var); 
     
    613613 
    614614  if (!first) 
    615     raiseError("attribute '%s' has no known values.", var->name.c_str()); 
     615    raiseError("attribute '%s' has no known values.", var->get_name().c_str()); 
    616616 
    617617  TContDistribution distr(var); 
     
    642642 
    643643  if (gen->domain->classVar!=TValue::INTVAR) 
    644     raiseError("class '%s' is not discrete", gen->domain->classVar->name.c_str()); 
     644    raiseError("class '%s' is not discrete", gen->domain->classVar->get_name().c_str()); 
    645645 
    646646  if (var->varType!=TValue::FLOATVAR) 
    647     raiseError("attribute '%s' is not continuous", var->name.c_str()); 
     647    raiseError("attribute '%s' is not continuous", var->get_name().c_str()); 
    648648 
    649649  int varPos=gen->domain->getVarNum(var); 
     
    679679 
    680680  if (!k) 
    681     raiseError("no examples or all values of attribute '%s' are unknown", var->name.c_str()); 
     681    raiseError("no examples or all values of attribute '%s' are unknown", var->get_name().c_str()); 
    682682 
    683683  float mindiff = 1.0; 
     
    789789PVariable TBiModalDiscretization::operator()(PExampleGenerator gen, PVariable var, const long &weightID) 
    790790{ if (var->varType!=TValue::FLOATVAR) 
    791     raiseError("attribute '%s' is not continuous", var->name.c_str()); 
     791    raiseError("attribute '%s' is not continuous", var->get_name().c_str()); 
    792792  if (gen->domain->classVar!=TValue::INTVAR) 
    793     raiseError("class '%s' is not discrete", gen->domain->classVar->name.c_str()); 
     793    raiseError("class '%s' is not discrete", gen->domain->classVar->get_name().c_str()); 
    794794   
    795795  TContingencyAttrClass ccont(gen, var, weightID); 
Note: See TracChangeset for help on using the changeset viewer.