diff options
Diffstat (limited to 'Eigen/src/Core/Random.h')
-rw-r--r-- | Eigen/src/Core/Random.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Eigen/src/Core/Random.h b/Eigen/src/Core/Random.h index 486e9ed52..dab2ac8e9 100644 --- a/Eigen/src/Core/Random.h +++ b/Eigen/src/Core/Random.h @@ -177,6 +177,42 @@ PlainObjectBase<Derived>::setRandom(Index rows, Index cols) return setRandom(); } +/** Resizes to the given size, changing only the number of columns, and sets all + * coefficients in this expression to random values. For the parameter of type + * NoChange_t, just pass the special value \c NoChange. + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * \not_reentrant + * + * \sa DenseBase::setRandom(), setRandom(Index), setRandom(Index, NoChange_t), class CwiseNullaryOp, DenseBase::Random() + */ +template<typename Derived> +EIGEN_STRONG_INLINE Derived& +PlainObjectBase<Derived>::setRandom(NoChange_t, Index cols) +{ + return setRandom(rows(), cols); +} + +/** Resizes to the given size, changing only the number of rows, and sets all + * coefficients in this expression to random values. For the parameter of type + * NoChange_t, just pass the special value \c NoChange. + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * \not_reentrant + * + * \sa DenseBase::setRandom(), setRandom(Index), setRandom(NoChange_t, Index), class CwiseNullaryOp, DenseBase::Random() + */ +template<typename Derived> +EIGEN_STRONG_INLINE Derived& +PlainObjectBase<Derived>::setRandom(Index rows, NoChange_t) +{ + return setRandom(rows, cols()); +} + } // end namespace Eigen #endif // EIGEN_RANDOM_H |