1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0025717: Non reentrant (and hence non-thread-safe) math_RealRandom / _IntegerRandom

Classes math_IntegerRandom and math_RealRandom, and method Random2 in math_Recipes, removed. Class math_BullardGenerator is used instead.
This commit is contained in:
abv
2015-01-18 17:08:40 +03:00
committed by bugmaster
parent 0bb09048e2
commit fd3ba7a1d9
8 changed files with 6 additions and 217 deletions

View File

@@ -562,33 +562,6 @@ void SVD_Solve(const math_Matrix& u,
}
}
Standard_Real Random2(Standard_Integer& idum) {
static Standard_Integer iy, ir[98];
static Standard_Integer iff = 0;
Standard_Integer j;
if(idum < 0 || iff == 0) {
iff = 1;
if((idum = (IC - idum) % M) < 0) idum = -idum;
for(j = 1; j <= 97; j++) {
idum = (IA * idum + IC) % M;
ir[j] = idum;
}
idum = (IA * idum + IC) % M;
iy = idum;
}
j = (Standard_Integer)(1 + 97.0 * iy / M);
if(j > 97 || j < 1) Standard_Failure::Raise();
iy = ir[j];
idum = (IA * idum + IC) % M;
ir[j] = idum;
return Standard_Real(iy) / Standard_Real(M);
}
Standard_Integer DACTCL_Decompose(math_Vector& a,
const math_IntegerVector& indx,
const Standard_Real MinPivot) {