I have tried writing a function which takes a ColXpr
value as input:
typedef Eigen::Array<float, Eigen::Dynamic, Eigen::Dynamic> Signal2D;
void Threshold(Signal2D::ColXpr& params)
{
params = (params >= 0.0f).template cast<float>();
}
When I try to call this function I do something like this:
Signal2D arr;
// fill it with stuff
Threshold(arr.col(0));
Then I get this compiler error:
src/core/Neuron.h:91:14: note: no known conversion for argument 1 from ‘Eigen::DenseBase<Eigen::Array<float, -1, -1> >::ColXpr {aka Eigen::Block<Eigen::Array<float, -1, -1>, -1, 1, true>}’ to ‘Eigen::DenseBase<Eigen::Array<float, -1, -1> >::ColXpr& {aka Eigen::Block<Eigen::Array<float, -1, -1>, -1, 1, true>&}’
make: *** [src/training/Fibonacci.o] Error 1
Without reposting the entire series of code that leads to this, could someone explain what it means when the compiler says no known conversion for argument from Value to Value&
? Why can't it get a reference in this instance? Note that I've seen a similar problem related to the this
pointer which I've posted here:
error: no match for 'operator<<' using boost::serialisation
Could this be some peculiarity of GCC 4.9.0 or am I doing something wrong here? Please let me know if you need to see a self-contained example, it will take a while to cobble together and I thought there might be enough info here to point out an obvious error on my part.