ENH: Random numbers - updated dependent code from change cachedRandom->Random class

This commit is contained in:
Andrew Heather
2017-04-28 09:15:52 +01:00
parent b07bc1f0b8
commit 7f0cc0045d
96 changed files with 235 additions and 300 deletions

View File

@ -335,7 +335,7 @@ public:
label distanceCmp(const point& pt, const treeBoundBox& other) const;
//- Return slightly wider bounding box
// Extends all dimensions with s*span*Random::scalar01()
// Extends all dimensions with s*span*Random::sample01<scalar>()
// and guarantees in any direction s*mag(span) minimum width
inline treeBoundBox extend(Random& rndGen, const scalar s) const;

View File

@ -336,8 +336,8 @@ inline Foam::treeBoundBox Foam::treeBoundBox::extend
newSpan[dir] = Foam::max(newSpan[dir], minSpan);
}
bb.min() -= cmptMultiply(s * rndGen.vector01(), newSpan);
bb.max() += cmptMultiply(s * rndGen.vector01(), newSpan);
bb.min() -= cmptMultiply(s*rndGen.sample01<vector>(), newSpan);
bb.max() += cmptMultiply(s*rndGen.sample01<vector>(), newSpan);
return bb;
}