aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-08-23 02:19:03 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-08-23 02:19:03 +0000
commit312013a08911816e287425d598e55e5d356e0ac5 (patch)
tree23d6e55855892bfc8be7e76eafc52efd52199dd5 /Eigen/src/Core
parent0e60e22151c8edafda76b233370bb8f0030fc6ab (diff)
compile fix for code like Vector3d::Random().x()
Diffstat (limited to 'Eigen/src/Core')
-rw-r--r--Eigen/src/Core/CwiseNullaryOp.h5
1 files changed, 4 insertions, 1 deletions
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<int LoadMode>