mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-01 08:14:10 +08:00
Avoid mutable class members when possible
This commit is contained in:
parent
7b98de1f15
commit
70eb70f5f8
@ -397,7 +397,7 @@ template <> class UniformRandomGenerator<float> {
|
||||
// Make sure m_deterministic comes first to match the layout of the cpu
|
||||
// version of the code.
|
||||
bool m_deterministic;
|
||||
mutable std::mt19937* m_generator;
|
||||
std::mt19937* m_generator;
|
||||
mutable std::uniform_real_distribution<float> m_distribution;
|
||||
};
|
||||
|
||||
@ -438,7 +438,7 @@ template <> class UniformRandomGenerator<double> {
|
||||
// Make sure m_deterministic comes first to match the layout of the cpu
|
||||
// version of the code.
|
||||
bool m_deterministic;
|
||||
mutable std::mt19937* m_generator;
|
||||
std::mt19937* m_generator;
|
||||
mutable std::uniform_real_distribution<double> m_distribution;
|
||||
};
|
||||
#endif
|
||||
@ -611,7 +611,7 @@ template <typename T> class NormalRandomGenerator {
|
||||
|
||||
bool m_deterministic;
|
||||
mutable std::normal_distribution<T> m_distribution;
|
||||
mutable std::mt19937* m_generator;
|
||||
std::mt19937* m_generator;
|
||||
};
|
||||
|
||||
#elif defined (EIGEN_USE_GPU) && defined(__CUDACC__) && defined(__CUDA_ARCH__)
|
||||
|
Loading…
x
Reference in New Issue
Block a user