This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] std::vector and Eigen::Vector3d problem

Tags: None
(comma "," separated)
cornail
Registered Member
Posts
8
Karma
0
Hi!

Here is a sample code of the phenomenon I found:

Code: Select all
#include
#include

typedef std::vector MyVec;

int main() {
  MyVec a(1);
  MyVec b(1);

  a[0].setOnes();
  b[0] = a[0];        // ok
  b[0] = a[0] * 1.0;  // error!

  std::cout , std::allocator > >::.std::vector::operator[] [with _Tp = Eigen::ei_unaligned_type >, _Alloc = Eigen::aligned_allocator > >](0ul) = Eigen::MatrixBase::operator*(const typename Eigen::ei_traits::Scalar&) const [with Derived = Eigen::Matrix](((const double&)((const double*)(&1.0e+0))))’
./eigen2/Eigen/src/StdVector/UnalignedType.h:29: note: candidates are: Eigen::ei_unaligned_type >& Eigen::ei_unaligned_type >::operator=(const Eigen::ei_unaligned_type >&)


I am using g++ (GCC) 4.2.4 (Ubuntu 4.2.4-3ubuntu4). Why does this assignment not work?
Thanks!

Last edited by cornail on Sun Mar 22, 2009 5:28 pm, edited 1 time in total.
User avatar
bjacob
Registered Member
Posts
658
Karma
3
This seems to be with Eigen-2.0.0. Can you try with trunk? The StdVector workaround is completely different there so I have good hopes that your problem will go away.

Gael: is this a reason to reconsider backporting?


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
cornail
Registered Member
Posts
8
Karma
0
Yes, I forgot to say, it's Eigen 2.0 stable. I will try trunk and post results later. Thanks.

bjacob wrote:This seems to be with Eigen-2.0.0. Can you try with trunk? The StdVector workaround is completely different there so I have good hopes that your problem will go away.

Gael: is this a reason to reconsider backporting?
cornail
Registered Member
Posts
8
Karma
0
You are right, trunk solved this issue. Thanx very much!

cornail wrote:Yes, I forgot to say, it's Eigen 2.0 stable. I will try trunk and post results later. Thanks.

bjacob wrote:This seems to be with Eigen-2.0.0. Can you try with trunk? The StdVector workaround is completely different there so I have good hopes that your problem will go away.

Gael: is this a reason to reconsider backporting?



Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell