mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Improved the tensor random number generators:
* Use a mersenne twister whenebver possible instead of the default entropy source since the default one isn't very good at all. * Added the ability to seed the generators with a time based seed to make them non-deterministic.
This commit is contained in:
@@ -53,8 +53,8 @@ class TensorBase<Derived, ReadOnlyAccessors>
|
||||
}
|
||||
template <typename RandomGenerator> EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const TensorCwiseNullaryOp<RandomGenerator, const Derived>
|
||||
random() const {
|
||||
return nullaryExpr(RandomGenerator());
|
||||
random(const RandomGenerator& gen = RandomGenerator()) const {
|
||||
return nullaryExpr(gen);
|
||||
}
|
||||
|
||||
// Generic unary operation support.
|
||||
|
||||
Reference in New Issue
Block a user