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

View File

@@ -1612,7 +1612,7 @@ bool CvSVM::train_auto( const CvMat* _train_data, const CvMat* _responses,
int block_size = 1 << 16;
double* alpha;
int i, k;
CvRNG rng = cvRNG(-1);
RNG* rng = &theRNG();
// all steps are logarithmic and must be > 1
double degree_step = 10, g_step = 10, coef_step = 10, C_step = 10, nu_step = 10, p_step = 10;
@@ -1745,8 +1745,8 @@ bool CvSVM::train_auto( const CvMat* _train_data, const CvMat* _responses,
// randomly permute samples and responses
for( i = 0; i < sample_count; i++ )
{
int i1 = cvRandInt( &rng ) % sample_count;
int i2 = cvRandInt( &rng ) % sample_count;
int i1 = (*rng)(sample_count);
int i2 = (*rng)(sample_count);
const float* temp;
float t;
int y;