aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Random.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-01-06 13:17:07 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-01-06 13:17:07 +0000
commit495eb7053ab7101f714718332399d51b10645b8b (patch)
treec835f693522b380b53563e0c0fe870b27e5fb9a4 /Eigen/src/Core/Random.h
parentd1d55e67e967a9bd0d447a7ea105ac2771cde557 (diff)
Patch by Gael Guennebaud, making Eigen compatible with the Intel compiler (icc).
CCMAIL:eigen@lists.tuxfamily.org
Diffstat (limited to 'Eigen/src/Core/Random.h')
-rw-r--r--Eigen/src/Core/Random.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/Eigen/src/Core/Random.h b/Eigen/src/Core/Random.h
index 1b870af74..164c24e30 100644
--- a/Eigen/src/Core/Random.h
+++ b/Eigen/src/Core/Random.h
@@ -39,11 +39,12 @@ template<typename MatrixType> class Random : NoOperatorEquals,
typedef typename MatrixType::Scalar Scalar;
friend class MatrixBase<Scalar, Random<MatrixType> >;
+ static const TraversalOrder Order = Indifferent;
+ static const int RowsAtCompileTime = MatrixType::RowsAtCompileTime,
+ ColsAtCompileTime = MatrixType::ColsAtCompileTime;
+
private:
- static const TraversalOrder _Order = Indifferent;
- static const int _RowsAtCompileTime = MatrixType::RowsAtCompileTime,
- _ColsAtCompileTime = MatrixType::ColsAtCompileTime;
-
+
const Random& _ref() const { return *this; }
int _rows() const { return m_rows; }
int _cols() const { return m_cols; }
@@ -57,9 +58,9 @@ template<typename MatrixType> class Random : NoOperatorEquals,
Random(int rows, int cols) : m_rows(rows), m_cols(cols)
{
assert(rows > 0
- && (_RowsAtCompileTime == Dynamic || _RowsAtCompileTime == rows)
+ && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows)
&& cols > 0
- && (_ColsAtCompileTime == Dynamic || _ColsAtCompileTime == cols));
+ && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols));
}
protected:
@@ -105,8 +106,8 @@ const Eval<Random<Derived> > MatrixBase<Scalar, Derived>::random(int rows, int c
template<typename Scalar, typename Derived>
const Eval<Random<Derived> > MatrixBase<Scalar, Derived>::random(int size)
{
- assert(IsVectorAtCompileTime);
- if(RowsAtCompileTime == 1) return Random<Derived>(1, size).eval();
+ assert(Traits::IsVectorAtCompileTime);
+ if(Traits::RowsAtCompileTime == 1) return Random<Derived>(1, size).eval();
else return Random<Derived>(size, 1).eval();
}
@@ -124,7 +125,7 @@ const Eval<Random<Derived> > MatrixBase<Scalar, Derived>::random(int size)
template<typename Scalar, typename Derived>
const Eval<Random<Derived> > MatrixBase<Scalar, Derived>::random()
{
- return Random<Derived>(RowsAtCompileTime, ColsAtCompileTime).eval();
+ return Random<Derived>(Traits::RowsAtCompileTime, Traits::ColsAtCompileTime).eval();
}
#endif // EIGEN_RANDOM_H