Registered Member
|
Hi, I'm trying:
template class Matrix< double, Dynamic, Dynamic >; and getting: YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX Is there a way to fix that? EDIT: g++ 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1) Thank you. |
Registered Member
|
|
Registered Member
|
I am _not_ calling any specific methods. Please Google "explicit template instantiation" to see what it does.
However, the error is apparently happening inside this function:
In Core/Matrix.h line 237. |
Moderator
|
This means you are calling a vector constructor, like:
Matrix<double,Dynamic,Dynamic> mat(10); that is not allowed. |
Registered Member
|
Thanks for trying to help, but...
Would you please read my posts first??? I am trying to do EXPLICIT TEMPLATE INSTANTIATION. I am NOT calling any methods. This is my entire code (very short) which I'm compiling using g++ -fno-implicit-templates -I ../eigen-3.05-6e7488e20373 -c templates.cpp all.h:
templates.cpp
|
Moderator
|
okay, now I see your issue.The workaround is to turn the static assertions into runtime asserts by defining EIGEN_NO_STATIC_ASSERT before including Eigen. You can do this only in your cpp file doing explicit instantiation. Nevertheless, I'm afraid you won't be able get any benefits by explicitly instantiating Eigen's type. Recall that's an expression template library, so any expression defines new types...
|
Registered Member
|
Great, it works! But you're absolutely right, I didn't think of that. Hmm.. I wonder if there is some way to do this sort of thing; i.e. tell g++ to "follow" different plausible possibilities automatically. But the main question seems answered, thanks a lot. |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell