17template<
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>(); }
23template<
typename Scalar>
24struct functor_traits<scalar_random_op<Scalar> >
25{
enum { Cost = 5 * NumTraits<Scalar>::MulCost, PacketAccess =
false, IsRepeatable =
false }; };
47template<
typename Derived>
51 return NullaryExpr(rows, cols, internal::scalar_random_op<Scalar>());
74template<
typename Derived>
78 return NullaryExpr(size, internal::scalar_random_op<Scalar>());
95template<
typename Derived>
109template<
typename Derived>
112 return *
this =
Random(rows(), cols());
124template<
typename Derived>
125EIGEN_STRONG_INLINE Derived&
142template<
typename Derived>
143EIGEN_STRONG_INLINE Derived&
Generic expression of a matrix where all coefficients are defined by a functor.
Definition CwiseNullaryOp.h:51
static const CwiseNullaryOp< CustomNullaryOp, Derived > NullaryExpr(Index rows, Index cols, const CustomNullaryOp &func)
Definition CwiseNullaryOp.h:117
internal::traits< Derived >::Index Index
The type of indices.
Definition DenseBase.h:51
static const CwiseNullaryOp< internal::scalar_random_op< Scalar >, Derived > Random(Index rows, Index cols)
Definition Random.h:49
static const CwiseNullaryOp< internal::scalar_random_op< Scalar >, Derived > Random()
Definition Random.h:97
Derived & setRandom()
Definition Random.h:110
@ RowsAtCompileTime
Definition DenseBase.h:92
@ ColsAtCompileTime
Definition DenseBase.h:98
void resize(Index rows, Index cols)
Definition PlainObjectBase.h:219
Derived & setRandom(Index size)
Definition Random.h:126