fixed CvDTree and CvForestTree find_best_split() methods

This commit is contained in:
Maria Dimashova 2010-09-10 15:44:46 +00:00
parent 8e38063965
commit 7d94f256e6
2 changed files with 12 additions and 4 deletions

View File

@ -158,8 +158,12 @@ CvDTreeSplit* CvForestTree::find_best_split( CvDTreeNode* node )
cv::parallel_reduce(cv::BlockedRange(0, data->var_count), finder);
CvDTreeSplit *bestSplit = data->new_split_cat( 0, -1.0f );
memcpy( bestSplit, finder.bestSplit, finder.splitSize );
CvDTreeSplit *bestSplit = 0;
if( finder.bestSplit->quality > 0 )
{
bestSplit = data->new_split_cat( 0, -1.0f );
memcpy( bestSplit, finder.bestSplit, finder.splitSize );
}
return bestSplit;
}

View File

@ -1877,8 +1877,12 @@ CvDTreeSplit* CvDTree::find_best_split( CvDTreeNode* node )
cv::parallel_reduce(cv::BlockedRange(0, data->var_count), finder);
CvDTreeSplit *bestSplit = data->new_split_cat( 0, -1.0f );
memcpy( bestSplit, finder.bestSplit, finder.splitSize );
CvDTreeSplit *bestSplit = 0;
if( finder.bestSplit->quality > 0 )
{
bestSplit = data->new_split_cat( 0, -1.0f );
memcpy( bestSplit, finder.bestSplit, finder.splitSize );
}
return bestSplit;
}