32template <
typename Generator_ = std::mt19937>
50 explicit Random(uint32_t seed = std::random_device{}());
87 [[nodiscard]] T
uniform(
const T& min,
const T& max);
105 template <
typename FixedSizeT>
106 [[nodiscard]] FixedSizeT
uniform(
107 typename FixedSizeT::Scalar min,
108 typename FixedSizeT::Scalar max);
127 template <
typename DynamicVector>
128 [[nodiscard]] DynamicVector
uniform(
130 typename DynamicVector::Scalar min,
131 typename DynamicVector::Scalar max);
151 template <
typename DynamicMatrix>
152 [[nodiscard]] DynamicMatrix
uniform(
155 typename DynamicMatrix::Scalar min,
156 typename DynamicMatrix::Scalar max);
159 template <
typename T>
163 template <
typename T>
173 template <
typename T>
190 template <
typename T>
193 T scaleMax = T(10.0),
207 template <
typename T>
208 [[nodiscard]] T
normal(
const T& mean,
const T& sigma);
218 template <
typename FixedSizeT>
219 [[nodiscard]] FixedSizeT
normal(
220 typename FixedSizeT::Scalar mean,
221 typename FixedSizeT::Scalar sigma);
231 template <
typename DynamicVector>
232 [[nodiscard]] DynamicVector
normal(
234 typename DynamicVector::Scalar mean,
235 typename DynamicVector::Scalar sigma);
246 template <
typename DynamicMatrix>
247 [[nodiscard]] DynamicMatrix
normal(
250 typename DynamicMatrix::Scalar mean,
251 typename DynamicMatrix::Scalar sigma);
258 [[nodiscard]] uint32_t
getSeed()
const;
278[[nodiscard]] T
uniform(
const T& min,
const T& max);
282template <
typename FixedSizeT>
283[[nodiscard]] FixedSizeT
uniform(
typename FixedSizeT::Scalar min,
typename FixedSizeT::Scalar max);
287template <
typename DynamicVector>
288[[nodiscard]] DynamicVector
289uniform(Eigen::Index size,
typename DynamicVector::Scalar min,
typename DynamicVector::Scalar max);
293template <
typename DynamicMatrix>
294[[nodiscard]] DynamicMatrix
uniform(
297 typename DynamicMatrix::Scalar min,
298 typename DynamicMatrix::Scalar max);
321 T scaleMax = T(10.0),
328[[nodiscard]] T
normal(
const T& mean,
const T& sigma);
332template <
typename FixedSizeT>
333[[nodiscard]] FixedSizeT
normal(
334 typename FixedSizeT::Scalar mean,
335 typename FixedSizeT::Scalar sigma);
339template <
typename DynamicVector>
340[[nodiscard]] DynamicVector
normal(
342 typename DynamicVector::Scalar mean,
343 typename DynamicVector::Scalar sigma);
347template <
typename DynamicMatrix>
348[[nodiscard]] DynamicMatrix
normal(
351 typename DynamicMatrix::Scalar mean,
352 typename DynamicMatrix::Scalar sigma);
static Random & GetSingleton()
Returns the process-wide singleton instance.
Affine3< T > uniformAffine3(T scaleMin=T(0.1), T scaleMax=T(10.0), const Vector3< T > &min=Vector3< T >::Zero(), const Vector3< T > &max=Vector3< T >::Ones())
Generates a random affine transformation with rotation drawn uniformly from SO(3),...
Quaternion< T > uniformQuaternion()
Generates a random unit quaternion uniformly distributed on SO(3) (Haar measure).
Matrix3< T > uniformRotationMatrix()
Generates a random rotation matrix uniformly distributed on SO(3) (Haar measure).
T normal(const T &mean, const T &sigma)
Generates a value from a normal (Gaussian) distribution N(mean, sigma^2).
Random(uint32_t seed=std::random_device{}())
Constructs a generator seeded with the given value.
void setSeed(uint32_t seed)
Re-seeds the internal engine, resetting its state to the deterministic sequence implied by seed.
uint32_t getSeed() const
Returns the seed last used to initialize the engine.
Isometry3< T > uniformIsometry3(const Vector3< T > &min=Vector3< T >::Zero(), const Vector3< T > &max=Vector3< T >::Ones())
Generates a random isometry (rigid transformation) on SE(3) with rotation drawn uniformly from SO(3) ...
T uniform(const T &min, const T &max)
Generates a random scalar/vector/matrix from the uniform distribution.
T normal(const T &mean, const T &sigma)
Normally distributed value via the global Random singleton.
Matrix3< T > uniformRotationMatrix()
Uniformly distributed rotation matrix on SO(3) via the global Random singleton.
T uniform(const T &min, const T &max)
Convenience wrappers that forward to Random<>::GetSingleton().
Eigen::Matrix< T, 3, 3 > Matrix3
Isometry3< T > uniformIsometry3(const Vector3< T > &min, const Vector3< T > &max)
Random isometry on SE(3) via the global Random singleton (uniform rotation, uniform translation in [m...
Eigen::Quaternion< T > Quaternion
Unit quaternion representing a 3D rotation.
Eigen::Transform< T, 3, Eigen::Isometry > Isometry3
3D rigid transform (rotation + translation, no scale or shear).
Quaternion< T > uniformQuaternion()
Uniformly distributed unit quaternion on SO(3) via the global Random singleton.
Affine3< T > uniformAffine3(T scaleMin, T scaleMax, const Vector3< T > &min, const Vector3< T > &max)
Random affine transformation via the global Random singleton (uniform rotation, uniform scale in [sca...
Eigen::Transform< T, 3, Eigen::Affine > Affine3
3D affine transform (linear part + translation).