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