This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Using Ref to pass Eigen types as argument

Tags: eigen eigen eigen
(comma "," separated)
kikiki
Registered Member
Posts
4
Karma
0
If I wish to avoid using template and making a copy (for both mat.col(0) and mat.row(0)), what method should I follow?
The sample code on Ref doc can't be compiled. http://eigen.tuxfamily.org/dox/classEigen_1_1Ref.html
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
see the question just before yours: viewtopic.php?f=74&t=132136
kikiki
Registered Member
Posts
4
Karma
0
Code: Select all
Ref<VectorXd,0,InnerStride<> >

As the doc page says, the above code can take both continuous and non-continuous layout.

However, even if the input is contiguously stored in memory, the calculation using this Ref won't be able to exploit vectorization.

So I wish to write two overloads to distinguish them as in http://eigen.tuxfamily.org/dox/classEigen_1_1Ref.html . Unfortunately, the method causes ambiguous calling thus compiler error.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient