Registered Member
|
Hi,
I'm new to Eigen and template programming, hope you can help me out with this one: the function is:
and I do:
The compiler complains: no matching function for call to ‘step(Eigen::Block<Eigen::Matrix<float, -0x00000000000000001, 1, 0, -0x00000000000000001, 1>, 1, 1, true>)’ Trainsample is a VectorXf, so in my understanding the i'th row of it should be a VectorXf of length 1. I'm using the 3.0beta1 of Eigen. Cheers, Victor Edit: I think I found the reason why this does not work: viewtopic.php?f=74&t=88577&p=161739&hilit=segment#p161739 The solution is to declare input as const |
Registered Member
|
If you're OK with your block being passed as const and you're OK with the block expression being evaluated into a temporary, then yes you can do just a const matrix reference.
Otherwise, the issue is that a block isn't a Matrix, it's a MatrixBase<T>. This question has been answered several times already, see also http://eigen.tuxfamily.org/dox-devel/To ... Types.html (but this page is for Eigen 3. For eigen 2, you want MatrixBase, not DenseBase.).
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]