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&
182 #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:287
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:38
static const RandomReturnType Random()
Definition: Random.h:113
Definition: Eigen_Colamd.h:50