From 312013a08911816e287425d598e55e5d356e0ac5 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sat, 23 Aug 2008 02:19:03 +0000 Subject: [PATCH] compile fix for code like Vector3d::Random().x() --- Eigen/src/Core/CwiseNullaryOp.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Eigen/src/Core/CwiseNullaryOp.h b/Eigen/src/Core/CwiseNullaryOp.h index aae396add..caa86fa97 100644 --- a/Eigen/src/Core/CwiseNullaryOp.h +++ b/Eigen/src/Core/CwiseNullaryOp.h @@ -91,7 +91,10 @@ class CwiseNullaryOp : ei_no_assignment_operator, const Scalar coeff(int index) const { - return m_functor(index); + if(RowsAtCompileTime == 1) + return m_functor(0, index); + else + return m_functor(index, 0); } template