← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1797: Fix [Bug 485209]

 

------------------------------------------------------------
revno: 1797
committer: Sergei D. <sega@think>
branch nick: trunk
timestamp: Thu 2009-11-19 15:20:33 +0300
message:
  Fix [Bug 485209]
modified:
  pkg/common/Engine/StandAloneEngine/ResetRandomPosition.cpp
  pkg/common/Engine/StandAloneEngine/ResetRandomPosition.hpp
  pkg/common/Engine/StandAloneEngine/SpheresFactory.cpp
  pkg/common/Engine/StandAloneEngine/SpheresFactory.hpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'pkg/common/Engine/StandAloneEngine/ResetRandomPosition.cpp'
--- pkg/common/Engine/StandAloneEngine/ResetRandomPosition.cpp	2009-11-19 06:44:50 +0000
+++ pkg/common/Engine/StandAloneEngine/ResetRandomPosition.cpp	2009-11-19 12:20:33 +0000
@@ -20,12 +20,10 @@
 YADE_REQUIRE_FEATURE(PYTHON)
 CREATE_LOGGER(ResetRandomPosition);
 
-namespace {
 boost::variate_generator<boost::mt19937,boost::uniform_real<> > 
-	randomUnit(boost::mt19937(),boost::uniform_real<>(0,1));
+	ResetRandomPosition::randomUnit(boost::mt19937(),boost::uniform_real<>(0,1));
 boost::variate_generator<boost::mt19937,boost::uniform_real<> >
-	randomSymmetricUnit(boost::mt19937(),boost::uniform_real<>(-1,1));
-}
+	ResetRandomPosition::randomSymmetricUnit(boost::mt19937(),boost::uniform_real<>(-1,1));
 
 ResetRandomPosition::ResetRandomPosition() 
 {

=== modified file 'pkg/common/Engine/StandAloneEngine/ResetRandomPosition.hpp'
--- pkg/common/Engine/StandAloneEngine/ResetRandomPosition.hpp	2009-11-19 06:44:50 +0000
+++ pkg/common/Engine/StandAloneEngine/ResetRandomPosition.hpp	2009-11-19 12:20:33 +0000
@@ -76,6 +76,11 @@
 	typedef	boost::variate_generator<boost::minstd_rand,boost::uniform_int<> > RandomInt;
 	shared_ptr<RandomInt> randomFacet;
 
+	static boost::variate_generator<boost::mt19937,boost::uniform_real<> > 
+		randomUnit;
+	static boost::variate_generator<boost::mt19937,boost::uniform_real<> >
+		randomSymmetricUnit;
+
 	DECLARE_LOGGER;
 
 	REGISTER_ATTRIBUTES(PeriodicEngine,

=== modified file 'pkg/common/Engine/StandAloneEngine/SpheresFactory.cpp'
--- pkg/common/Engine/StandAloneEngine/SpheresFactory.cpp	2009-11-17 12:26:35 +0000
+++ pkg/common/Engine/StandAloneEngine/SpheresFactory.cpp	2009-11-19 12:20:33 +0000
@@ -23,12 +23,10 @@
 YADE_REQUIRE_FEATURE(PYTHON)
 CREATE_LOGGER(SpheresFactory);
 
-namespace {
 boost::variate_generator<boost::mt19937,boost::uniform_real<> > 
-	randomUnit(boost::mt19937(),boost::uniform_real<>(0,1));
+	SpheresFactory::randomUnit(boost::mt19937(),boost::uniform_real<>(0,1));
 boost::variate_generator<boost::mt19937,boost::uniform_real<> >
-	randomSymmetricUnit(boost::mt19937(),boost::uniform_real<>(-1,1));
-}
+	SpheresFactory::randomSymmetricUnit(boost::mt19937(),boost::uniform_real<>(-1,1));
 
 SpheresFactory::SpheresFactory() 
 {

=== modified file 'pkg/common/Engine/StandAloneEngine/SpheresFactory.hpp'
--- pkg/common/Engine/StandAloneEngine/SpheresFactory.hpp	2009-09-01 12:34:25 +0000
+++ pkg/common/Engine/StandAloneEngine/SpheresFactory.hpp	2009-11-19 12:20:33 +0000
@@ -91,6 +91,11 @@
 	typedef	boost::variate_generator<boost::minstd_rand,boost::uniform_int<> > RandomInt;
 	shared_ptr<RandomInt> randomFacet;
 
+	static boost::variate_generator<boost::mt19937,boost::uniform_real<> > 
+		randomUnit;
+	static boost::variate_generator<boost::mt19937,boost::uniform_real<> >
+		randomSymmetricUnit;
+
 	DECLARE_LOGGER;
 
 	REGISTER_ATTRIBUTES(PeriodicEngine,