Registered Member
|
Hello all,
I'm new to Eigen. One of the requirements for my application is that matrix dimensions are allowed to be zero. After some quick tests under Windows (MSVC 2010), I was pleased to find that Eigen works just fine in this regard. Unfortunately, gcc gives the following compilation error: call of overloaded ‘Matrix(int)’ is ambiguous This is the line that produces the error:
Changing the argument to 1 (or presumably any other integer > 0) solves the compilation issue, but of course this doesn't really solve my problem. Any insight into what is causing the issue? Is there something to which the zero can be cast to resolve the ambiguity? Thanks and happy holidays, Kerry |
Moderator
|
You can simply declare an empty vector as VectorXd v; or disambiguate with VectorXd v(std::ptrdiff_t(0));.
|
Registered Member
|
Ahha - the default constructor seems so obvious now...
I never would have guessed that casting to std::ptrdiff_t would work, though. Thanks for your help! |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]