fixed CvDTree and CvForestTree find_best_split() methods

pull/13383/head
Maria Dimashova 15 years ago
parent 8e38063965
commit 7d94f256e6
  1. 8
      modules/ml/src/rtrees.cpp
  2. 8
      modules/ml/src/tree.cpp

@ -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;
}

@ -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;
}

Loading…
Cancel
Save