10 #ifndef EIGEN_RANDOM_H 11 #define EIGEN_RANDOM_H 17 template<
typename Scalar>
struct scalar_random_op {
18 EIGEN_EMPTY_STRUCT_CTOR(scalar_random_op)
19 inline const Scalar operator() ()
const {
return random<Scalar>(); }
22 template<
typename Scalar>
23 struct functor_traits<scalar_random_op<Scalar> >
24 {
enum { Cost = 5 * NumTraits<Scalar>::MulCost, PacketAccess =
false, IsRepeatable =
false }; };
54 template<
typename Derived>
55 inline const typename DenseBase<Derived>::RandomReturnType
58 return NullaryExpr(rows, cols, internal::scalar_random_op<Scalar>());
85 template<
typename Derived>
89 return NullaryExpr(size, internal::scalar_random_op<Scalar>());
111 template<
typename Derived>
115 return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_random_op<Scalar>());
130 template<
typename Derived>
133 return *
this = Random(rows(), cols());
149 template<
typename Derived>
150 EIGEN_STRONG_INLINE Derived&
172 template<
typename Derived>
173 EIGEN_STRONG_INLINE Derived&
191 template<
typename Derived>
192 EIGEN_STRONG_INLINE Derived&
195 return setRandom(rows(), cols);
209 template<
typename Derived>
210 EIGEN_STRONG_INLINE Derived&
213 return setRandom(rows, cols());
218 #endif // EIGEN_RANDOM_H Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:60
Derived & setRandom()
Definition: Random.h:131
Derived & setRandom(Index size)
Definition: Random.h:151
Namespace containing all symbols from the Eigen library.
Definition: Core:141
static const RandomReturnType Random()
Definition: Random.h:113
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Definition: Eigen_Colamd.h:50