Commit 7d94f256 authored by Maria Dimashova's avatar Maria Dimashova

fixed CvDTree and CvForestTree find_best_split() methods

parent 8e380639
...@@ -158,8 +158,12 @@ CvDTreeSplit* CvForestTree::find_best_split( CvDTreeNode* node ) ...@@ -158,8 +158,12 @@ CvDTreeSplit* CvForestTree::find_best_split( CvDTreeNode* node )
cv::parallel_reduce(cv::BlockedRange(0, data->var_count), finder); cv::parallel_reduce(cv::BlockedRange(0, data->var_count), finder);
CvDTreeSplit *bestSplit = data->new_split_cat( 0, -1.0f ); CvDTreeSplit *bestSplit = 0;
memcpy( bestSplit, finder.bestSplit, finder.splitSize ); if( finder.bestSplit->quality > 0 )
{
bestSplit = data->new_split_cat( 0, -1.0f );
memcpy( bestSplit, finder.bestSplit, finder.splitSize );
}
return bestSplit; return bestSplit;
} }
......
...@@ -1877,8 +1877,12 @@ CvDTreeSplit* CvDTree::find_best_split( CvDTreeNode* node ) ...@@ -1877,8 +1877,12 @@ CvDTreeSplit* CvDTree::find_best_split( CvDTreeNode* node )
cv::parallel_reduce(cv::BlockedRange(0, data->var_count), finder); cv::parallel_reduce(cv::BlockedRange(0, data->var_count), finder);
CvDTreeSplit *bestSplit = data->new_split_cat( 0, -1.0f ); CvDTreeSplit *bestSplit = 0;
memcpy( bestSplit, finder.bestSplit, finder.splitSize ); if( finder.bestSplit->quality > 0 )
{
bestSplit = data->new_split_cat( 0, -1.0f );
memcpy( bestSplit, finder.bestSplit, finder.splitSize );
}
return bestSplit; return bestSplit;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment