Changeset 10866:f87a37b3fa5f in orange


Ignore:
Timestamp:
05/11/12 14:28:20 (2 years ago)
Author:
Janez Demšar <janez.demsar@…>
Branch:
default
Message:

Fixed TExampleTable::pickClass; incorrect construction of domain's classVars if the original domain had no class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/table.cpp

    r10596 r10866  
    722722        newDomain = mlnew TDomain(classVar, domain->attributes.getReference()); 
    723723        newDomain->classVars = mlnew TVarList(); 
    724         PITERATE(TVarList, ci, domain->classVars) { 
     724        TVarList::iterator ci(domain->classVars->begin()); 
     725        TVarList::const_iterator const ce(domain->classVars->end()); 
     726        if (!domain->classVar && (classPos != attrs)) { 
     727            ci++; 
     728        } 
     729        for(; ci != ce; ci++) { 
    725730            if (*ci == classVar) { 
    726731                if (domain->classVar) { 
    727732                    newDomain->classVars->push_back(domain->classVar); 
     733                } 
     734                else if (classPos != attrs) { 
     735                    newDomain->classVars->push_back(domain->classVars->front()); 
    728736                } 
    729737            } 
Note: See TracChangeset for help on using the changeset viewer.