1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

made random generators of MLL classes depended on default rng (theRNG) (#205).

This commit is contained in:
Maria Dimashova
2010-11-29 14:04:08 +00:00
parent 7860d52e14
commit c104cdce96
10 changed files with 53 additions and 55 deletions
+3 -3
View File
@@ -268,7 +268,7 @@ CvGBTrees::train( const CvMat* _train_data, int _tflag,
}
// subsample params and data
rng = CvRNG(time(0));
rng = &cv::theRNG();
int samples_count = get_len(sample_idx);
@@ -698,8 +698,8 @@ void CvGBTrees::do_subsample()
if (subsample_test)
for (int i = 0; i < n; i++)
{
int a = cvRandInt( &rng ) % n;
int b = cvRandInt( &rng ) % n;
int a = (*rng)(n);
int b = (*rng)(n);
int t;
CV_SWAP( idx[a], idx[b], t );
}