aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-04-20 09:24:09 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-04-20 09:24:09 -0700
commit43eb2ca6e1d80c2c3517f7af3c144b50b472cfae (patch)
tree0a38cfc6767eb0cb2696d64c2d7faf6c0c12de45 /unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
parent016c29f207c4fe5284b1c011c0aee3a293fa5a62 (diff)
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.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorBase.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorBase.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
index 22fbe9b2c..d44060258 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
@@ -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.