Classes math_IntegerRandom and math_RealRandom, and method Random2 in math_Recipes, removed. Class math_BullardGenerator is used instead.
#include <ElCLib.hxx>
#include <Geom_Surface.hxx>
#include <BRep_Tool.hxx>
-#include <math_RealRandom.hxx>
+#include <math_BullardGenerator.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
static
gp_Pnt aPoint;
gp_Dir aDN;
- math_RealRandom RandomGenerator(0.1, 0.9);
+ math_BullardGenerator aRandomGenerator;
myFace.Nullify();
myState=2;
TopoDS_Face MinFace = aF;
for (;;)
{
- aParam = RandomGenerator.Next();
- bFound = aSE.FindAPointInTheFace(aF, aPoint, aU, aV, aParam);
- if (!bFound)
- return;
+ aParam = 0.1 + 0.8 * aRandomGenerator.NextReal(); // random number in range [0.1, 0.9]
+ bFound = aSE.FindAPointInTheFace(aF, aPoint, aU, aV, aParam);
+ if (!bFound)
+ return;
if (!FaceNormal(aF, aU, aV, aDN))
continue;
imported PSO;
imported PSOParticlesPool;
imported BullardGenerator;
- class IntegerRandom;
class Gauss;
class GaussLeastSquare;
class SVD;
class GaussSingleIntegration;
class GaussMultipleIntegration;
class GaussSetIntegration;
- class RealRandom;
class FunctionSample;
class FunctionAllRoots;
class Householder;
+++ /dev/null
--- Created on: 1991-05-27
--- Created by: Laurent PAINNOT
--- Copyright (c) 1991-1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class IntegerRandom from math
- ---Purpose:
- -- This class implements an integer random number generator.
-
-is
-
- Create(Lower, Upper: Integer)
- ---Purpose:
- -- creates a Integer random generator between the values Lower and Upper.
-
- returns IntegerRandom;
-
-
- Reset(me:in out)
- ---Purpose: reinitializes the random generator
-
- is static;
-
- Next(me: in out)
- ---Purpose: returns the next random number.
-
- returns Integer
- is static;
-
-fields
-
-Low: Integer;
-Up: Integer;
-Dummy: Integer;
-
-end IntegerRandom;
+++ /dev/null
-// Copyright (c) 1997-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <math_IntegerRandom.ixx>
-
-#include <math_Recipes.hxx>
-
-math_IntegerRandom::math_IntegerRandom(const Standard_Integer Lower,
- const Standard_Integer Upper) {
-
- Low = Lower;
- Up = Upper;
- Dummy=-1;
- Random2(Dummy);
- }
-
-void math_IntegerRandom::Reset() {
-
- Dummy=-1;
- Random2(Dummy);
-}
-
-Standard_Integer math_IntegerRandom::Next() {
-
- Standard_Real value=Random2(Dummy);
- Standard_Integer Result=(Standard_Integer)(Standard_Real((Up-Low))*value + Low);
- return (Result) ;
-}
-
+++ /dev/null
--- Created on: 1991-05-14
--- Created by: Laurent PAINNOT
--- Copyright (c) 1991-1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class RealRandom from math
- ---Purpose:
- -- This class implements a real random generator.
-
-
-is
-
- Create(Lower, Upper: Real)
- ---Purpose:
- -- creates a real random generator between the values Lower and Upper.
-
- returns RealRandom;
-
-
- Reset(me: in out)
- ---Purpose: reinitializes the random generator
-
- is static;
-
- Next(me: in out)
- ---Purpose: returns the next random number.
-
- returns Real
- is static;
-
-
-fields
-
-Dummy: Integer;
-Low: Real;
-Up: Real;
-
-end RealRandom;
+++ /dev/null
-// Copyright (c) 1997-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <math_RealRandom.ixx>
-#include <math_Recipes.hxx>
-
-math_RealRandom::math_RealRandom(const Standard_Real Lower,
- const Standard_Real Upper) {
-
- Low = Lower;
- Up = Upper;
- Dummy = -1;
- Random2(Dummy);
-}
-
-void math_RealRandom::Reset() {
-
- Dummy = -1;
- Random2(Dummy);
-}
-
-Standard_Real math_RealRandom::Next() {
-
- Standard_Real value = Random2(Dummy);
- Standard_Real Result = (Up - Low)*value + Low;
- return Result;
-
-}
}
}
-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) {
// Eigenvalues are sorted into descending order, and eigenvectors are
// arranges correspondingly.
-__math_API Standard_Real Random2(Standard_Integer& idum);
-
-// returns a uniform random deviate betwween 0.0 and 1.0. Set idum to any
-// negative value to initialize or reinitialize the sequence.
-
-
-
#endif