TR-mbed 1.0
Loading...
Searching...
No Matches
Random.h
Go to the documentation of this file.
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
5//
6// This Source Code Form is subject to the terms of the Mozilla
7// Public License v. 2.0. If a copy of the MPL was not distributed
8// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
10#ifndef EIGEN_RANDOM_H
11#define EIGEN_RANDOM_H
12
13namespace Eigen {
14
15namespace internal {
16
17template<typename Scalar> struct scalar_random_op {
19 inline const Scalar operator() () const { return random<Scalar>(); }
20};
21
22template<typename Scalar>
25
26} // end namespace internal
27
54template<typename Derived>
55inline const typename DenseBase<Derived>::RandomReturnType
60
85template<typename Derived>
86inline const typename DenseBase<Derived>::RandomReturnType
91
111template<typename Derived>
112inline const typename DenseBase<Derived>::RandomReturnType
114{
115 return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_random_op<Scalar>());
116}
117
130template<typename Derived>
132{
133 return *this = Random(rows(), cols());
134}
135
149template<typename Derived>
150EIGEN_STRONG_INLINE Derived&
152{
153 resize(newSize);
154 return setRandom();
155}
156
172template<typename Derived>
173EIGEN_STRONG_INLINE Derived&
179
191template<typename Derived>
192EIGEN_STRONG_INLINE Derived&
197
209template<typename Derived>
210EIGEN_STRONG_INLINE Derived&
215
216} // end namespace Eigen
217
218#endif // EIGEN_RANDOM_H
A setRandom()
#define EIGEN_DEVICE_FUNC
Definition Macros.h:976
#define EIGEN_STRONG_INLINE
Definition Macros.h:917
v resize(3)
int rows
Definition Tutorial_commainit_02.cpp:1
int cols
Definition Tutorial_commainit_02.cpp:1
#define EIGEN_EMPTY_STRUCT_CTOR(X)
Definition XprHelper.h:22
Scalar Scalar int size
Definition benchVecAdd.cpp:17
SCALAR Scalar
Definition bench_gemm.cpp:46
Generic expression of a matrix where all coefficients are defined by a functor.
Definition CwiseNullaryOp.h:61
EIGEN_DEVICE_FUNC Derived & setRandom()
Definition Random.h:131
static const RandomReturnType Random()
Definition Random.h:113
Derived & setRandom(Index size)
Definition Random.h:151
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
NoChange_t
Definition Constants.h:360
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
Definition BandTriangularSolver.h:13
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition NumTraits.h:233
Definition XprHelper.h:176
@ PacketAccess
Definition XprHelper.h:180
@ Cost
Definition XprHelper.h:179
@ IsRepeatable
Definition XprHelper.h:181
Definition Random.h:17
Definition ForwardDeclarations.h:17