Registered Member
|
I have some column vectors that are tightly coupled to other column vectors, so a logical layout may be like this:
m.col(0), m.col(1) etc will be regularly used as vectors in algebraic expressions. But I also have many functions that require whole rows.
|
Moderator
|
For m.b() you can return a "MatrixType::ColXpr"
For the second question, the best is to template your function to make it take a const MatrixBase<Derived>& object. If you don't want to use templates, then you can use the Ref class (http://eigen.tuxfamily.org/dox/classEigen_1_1Ref.html). Don't miss this page for more details: http://eigen.tuxfamily.org/dox/TopicFun ... Types.html To name elements, you can use our plugin mechanism to add member functions to the MatrixBase (or DenseBase) class. This way you will be able to add members as m.a(), m.b(), etc. See this page: http://eigen.tuxfamily.org/dox/TopicCus ... Eigen.html |
Registered Member
|
Thanks very much, I should've read that section of the documentation more carefully. I'll work on using the plugin mechanism to try and come up with something that works for me.
As written, do you know if those plugins will have 0 abstraction penalty? e.g. compared to having
|
Moderator
|
The generated code will be exactly the same.
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell