diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-04-03 11:10:17 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-04-03 11:10:17 +0000 |
commit | d1a29d6319d6919e0c3d1c624ad45d8202be1942 (patch) | |
tree | b9882a823c7d08819037d341f7e61971304eeadf /Eigen/src/Core/Random.h | |
parent | e74fbfb2bc13dee268950361a957aea73bcefc21 (diff) |
-new: recursive costs system, useful to determine automatically
when to evaluate arguments and when to meta-unroll.
-use it in Product to determine when to eval args. not yet used
to determine when to unroll. for now, not used anywhere else but
that'll follow.
-fix badness of my last commit
Diffstat (limited to 'Eigen/src/Core/Random.h')
-rw-r--r-- | Eigen/src/Core/Random.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Eigen/src/Core/Random.h b/Eigen/src/Core/Random.h index 03f08ef06..4bd482958 100644 --- a/Eigen/src/Core/Random.h +++ b/Eigen/src/Core/Random.h @@ -41,7 +41,8 @@ struct ei_traits<Random<MatrixType> > ColsAtCompileTime = ei_traits<MatrixType>::ColsAtCompileTime, MaxRowsAtCompileTime = ei_traits<MatrixType>::MaxRowsAtCompileTime, MaxColsAtCompileTime = ei_traits<MatrixType>::MaxColsAtCompileTime, - Flags = ei_traits<MatrixType>::Flags + Flags = ei_traits<MatrixType>::Flags, + CoeffReadCost = 2 * NumTraits<Scalar>::MulCost // FIXME: arbitrary value }; }; @@ -92,7 +93,7 @@ template<typename MatrixType> class Random : ei_no_assignment_operator, * \sa ei_random(), ei_random(int) */ template<typename Derived> -const typename ei_eval_unless_lazy<Random<Derived> >::Type +const typename ei_eval_unless_lazy<Random<Derived> >::type MatrixBase<Derived>::random(int rows, int cols) { return Random<Derived>(rows, cols).eval(); @@ -115,7 +116,7 @@ MatrixBase<Derived>::random(int rows, int cols) * \sa ei_random(), ei_random(int,int) */ template<typename Derived> -const typename ei_eval_unless_lazy<Random<Derived> >::Type +const typename ei_eval_unless_lazy<Random<Derived> >::type MatrixBase<Derived>::random(int size) { ei_assert(IsVectorAtCompileTime); @@ -135,7 +136,7 @@ MatrixBase<Derived>::random(int size) * \sa ei_random(int), ei_random(int,int) */ template<typename Derived> -const typename ei_eval_unless_lazy<Random<Derived> >::Type +const typename ei_eval_unless_lazy<Random<Derived> >::type MatrixBase<Derived>::random() { return Random<Derived>(RowsAtCompileTime, ColsAtCompileTime).eval(); |