Registered Member
|
Hi, I'm switching my code to use Eigen and it's been going OK, but I can't seem to get head and other block-like functions to work. For example, this code:
Gives errors like:
For every head call (clang, via Xcode). Whereas replacing the body of the function with this compiles fine:
I've been able to find fixes for other problems pretty easily online, but this doesn't turn anything up. Am I using it wrong? |
Registered Member
|
I've narrowed it down a bit more, and it seems to be related to the templates. This works:
but this doesn't:
foo isn't actually called anywhere, but the second version complains about head<3>() as before. Using head(3) instead compiles fine, but obviously that's not as good. I can only assume this is related to the template-based optimisation Eigen uses, but I'm having trouble debugging further because "typename DenseBase<Derived>::template FixedSegmentReturnType<Size>::Type" isn't syntax which I'm familiar with. |
Moderator
|
|
Registered Member
|
Thanks. Can I suggest mentioning "expected expression" in that reference page to make it turn up in searches?
To have a concise reference for anyone finding this thread, this works:
|
Registered Member
|
That's a good idea; I'll take care of it. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]