Skip to content
Snippets Groups Projects
Commit b4722fba authored by OTB Bot's avatar OTB Bot
Browse files

STYLE

parent 4885a539
Branches
Tags
No related merge requests found
...@@ -108,28 +108,28 @@ DecisionTree<AttributeValueType, LabelType> ...@@ -108,28 +108,28 @@ DecisionTree<AttributeValueType, LabelType>
DecisionTreeTestType theTest = theKey.second; DecisionTreeTestType theTest = theKey.second;
AttributeValueType theValue = theKey.first; AttributeValueType theValue = theKey.first;
switch( theTest ) switch( theTest )
{ {
case LT: case LT:
if( attrValue < theValue ) if( attrValue < theValue )
return lmIt->second; return lmIt->second;
break; break;
case LE: case LE:
if( attrValue <= theValue ) if( attrValue <= theValue )
return lmIt->second; return lmIt->second;
break; break;
case EQ: case EQ:
if( attrValue == theValue ) if( attrValue == theValue )
return lmIt->second; return lmIt->second;
break; break;
case GE: case GE:
if( attrValue >= theValue ) if( attrValue >= theValue )
return lmIt->second; return lmIt->second;
break; break;
case GT: case GT:
if( attrValue > theValue ) if( attrValue > theValue )
return lmIt->second; return lmIt->second;
break; break;
} }
++lmIt; ++lmIt;
} }
...@@ -150,43 +150,43 @@ DecisionTree<AttributeValueType, LabelType> ...@@ -150,43 +150,43 @@ DecisionTree<AttributeValueType, LabelType>
DecisionTreeTestType theTest = theKey.second; DecisionTreeTestType theTest = theKey.second;
AttributeValueType theValue = theKey.first; AttributeValueType theValue = theKey.first;
switch( theTest ) switch( theTest )
{ {
case LT: case LT:
if( attrValue < theValue ) if( attrValue < theValue )
{ {
candidateKeys.push_back( theKey ); candidateKeys.push_back( theKey );
found = true; found = true;
} }
break; break;
case LE: case LE:
if( attrValue <= theValue ) if( attrValue <= theValue )
{ {
candidateKeys.push_back( theKey ); candidateKeys.push_back( theKey );
found = true; found = true;
} }
break; break;
case EQ: case EQ:
if( attrValue == theValue ) if( attrValue == theValue )
{ {
candidateKeys.push_back( theKey ); candidateKeys.push_back( theKey );
found = true; found = true;
} }
break; break;
case GE: case GE:
if( attrValue >= theValue ) if( attrValue >= theValue )
{ {
candidateKeys.push_back( theKey ); candidateKeys.push_back( theKey );
found = true; found = true;
} }
break; break;
case GT: case GT:
if( attrValue > theValue ) if( attrValue > theValue )
{ {
candidateKeys.push_back( theKey ); candidateKeys.push_back( theKey );
found = true; found = true;
} }
break; break;
} }
++tmIt; ++tmIt;
} }
...@@ -201,11 +201,11 @@ DecisionTree<AttributeValueType, LabelType> ...@@ -201,11 +201,11 @@ DecisionTree<AttributeValueType, LabelType>
// If we found one or several matching tests // If we found one or several matching tests
typename std::vector< KeyType >::const_iterator ckIt = candidateKeys.begin(); typename std::vector< KeyType >::const_iterator ckIt = candidateKeys.begin();
while ( ckIt != candidateKeys.end() ) while ( ckIt != candidateKeys.end() )
{ {
std::cout << (*ckIt).first << " " << (*ckIt).second << std::endl; std::cout << (*ckIt).first << " " << (*ckIt).second << std::endl;
Pointer child = (*m_TreeMap)[(*ckIt)]; Pointer child = (*m_TreeMap)[(*ckIt)];
return child->Decide(example); return child->Decide(example);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment