Registered Member
|
I've defined a two-dimensional vector type using my own scalar type like so:
typedef Eigen::Matrix<Real, 2, 1> Vector2; I am having trouble constructing an object of this type using two Real objects, likely because there doesn't appear to be a constructor of the form "Matrix (const Scalar &x, const Scalar &y)" according to http://eigen.tuxfamily.org/dox/classEig ... atrix.html ...am I missing something obvious? This works fine for a similar three-dimensional vector typedef since the necessary constructor is present. |
Registered Member
|
OK, this is a limitation of Eigen 2.0 that thas been overcome in the development branch.
In Eigen 2.0, the 2D vector constructor taking 2 scalars works only with float and double. The reason for that is the conflict with the MatrixXd(int rows, int cols) constructor. Two possibilities: - either you switch to the development branch - or you define a EIGEN_MATRIX_PLUGIN file where you implement the 2d vector constructors for the types you're interested in. For a general plugins howto see this recent thread: viewtopic.php?f=74&t=86581
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]