[eigen] Is it really impossible to modify a column of a matrix with in function? |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: "eigen@xxxxxxxxxxxxxxxxxxx" <eigen@xxxxxxxxxxxxxxxxxxx>*Subject*: [eigen] Is it really impossible to modify a column of a matrix with in function?*From*: Helmut Jarausch <jarausch@xxxxxxxxxxxxxxxxxxx>*Date*: Tue, 30 Aug 2011 11:58:22 +0200

Hi, the following program does not compile with Eigen (SVN version from today) #include <iostream> #include <Eigen/Core> using Eigen::MatrixXi; using Eigen::VectorXi; void set_Col(VectorXi& V) { V[0]=1; } int main() { MatrixXi A(2,3); A << 1,2,3, 4,5,6; set_Col(A.col(1)); std::cout << "A=\n" << A << std::endl; } It looks as if a column cannot be passed by a non-const reference. Why doesn't the col-method return a non-const reference for a non- const object (the col-method could be overloaded with/without the const attribute)? Many thanks for a hint, Helmut.

**Follow-Ups**:**Re: [eigen] Is it really impossible to modify a column of a matrix with in function?***From:*Christoph Hertzberg

**Messages sorted by:**[ date | thread ]- Prev by Date:
**[eigen] Problems compiling 3.0.2 tests on VS2008** - Next by Date:
**Re: [eigen] Is it really impossible to modify a column of a matrix with in function?** - Previous by thread:
**[eigen] Problems compiling 3.0.2 tests on VS2008** - Next by thread:
**Re: [eigen] Is it really impossible to modify a column of a matrix with in function?**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |