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 template<typename Index>
20 inline const Scalar operator() (Index, Index = 0)
const {
return random<Scalar>(); }
23 template<
typename Scalar>
24 struct functor_traits<scalar_random_op<Scalar> >
25 {
enum { Cost = 5 * NumTraits<Scalar>::MulCost, PacketAccess =
false, IsRepeatable =
false }; };
55 template<
typename Derived>
56 inline const typename DenseBase<Derived>::RandomReturnType
59 return NullaryExpr(rows, cols, internal::scalar_random_op<Scalar>());
86 template<
typename Derived>
90 return NullaryExpr(size, internal::scalar_random_op<Scalar>());
112 template<
typename Derived>
116 return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_random_op<Scalar>());
131 template<
typename Derived>
134 return *
this = Random(rows(), cols());
150 template<
typename Derived>
151 EIGEN_STRONG_INLINE Derived&
173 template<
typename Derived>
174 EIGEN_STRONG_INLINE Derived&
183 #endif // EIGEN_RANDOM_H Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:44
Derived & setRandom()
Definition: Random.h:132
Derived & setRandom(Index size)
Definition: Random.h:152
static const RandomReturnType Random()
Definition: Random.h:114
Definition: Eigen_Colamd.h:54