Registered Member
|
Hi guys,
I'm not sure which version I'm using, but I think Eigen2-stable. I have the following code: Eigen::Vector2f *temp; temp = new Eigen::Vector2f[bufsize/sizeof(POINTFX)]; and the visual-studio-2005-compiler responds with: d:codinginsubversionistladdonseigen2srccorematrix.h(353) : error C2039: 'THIS_METHOD_IS_ONLY_FOR_VECTORS_OF_A_SPECIFIC_SIZE' : is not a member of 'Eigen::ei_static_assert' with [ condition=false ] d:codinginsubversionistladdonseigen2srccorematrix.h(350) : while compiling class template member function 'Eigen::Matrix::Matrix(const float &,const float &,const float &)' with [ _Scalar=float, _Rows=2, _Cols=1 ] when I look at the source-line of the assertions it's here: /** constructs an initialized 3D vector with given coefficients */ EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z) { _check_template_params(); EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 3) m_storage.data()[0] = x; m_storage.data()[1] = y; m_storage.data()[2] = z; } which is strange, because it's using the constructor of the 3-dimensional-vector?!? (and as a sidenote in the matrix.h the constructor for the 2-dim-matrix is not templated by "Scalar" but two ones, one with float and one with double; I think this is also a minor bug; this is how I suppose it should look: /** constructs an initialized 2D vector with given coefficients */ EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y) { _check_template_params(); EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 2) m_storage.data()[0] = x; m_storage.data()[1] = y; } ) any thoughts?
Last edited by ggael on Tue Mar 31, 2009 2:10 pm, edited 1 time in total.
|
Moderator
|
wow, MSVC is really wonderful ! The only solution I see is to try using malloc or a std::vector instead of new.
about the 2D constructor, the problem is that we also need a Matrix(int, int) ctor and so when Scalar==int we'd have twice the same ctor.... |
Registered Member
|
Maybe try with MSVC 2008 ?
Another option might be to replace your array of Vector2f by a single matrix of type
which would have the additional advantage of allowing certain operations to get vectorized (although with MSVC vectorization happens only with 2008)
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
okay, I've found out why msvc acted like that, for the records:
I had code looking like this: Eigen::Vector2f *temp; temp = new Eigen::Vector2f[100]; ... temp[0] = Eigen::Vector2f(0.0f, 0.0f, 0.0f); so the wrong constructor was used because of the Vector2f with 3 floats... anyway, thanks for you support |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell