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

set of vectors?

Tags: None
(comma "," separated)
martinakos
Registered Member
Posts
53
Karma
0
OS

set of vectors?

Fri Oct 22, 2010 5:45 pm
Hi there,

I'm trying to use Transform to apply a Affine transformation to a set of 3d points. In the help for the operator * in Transform:
http://eigen.tuxfamily.org/dox-devel/cl ... 6c6dfffba8

says the right hand side may be a number of things, among them "a set of vectors of size Dim x Dynamic". I assume this will be equivalent to a set of points. What I intend here is to transform all the points in a single operation.

How do I construct a set of vectors (or points)?
Can I do something like VectorXd<Vector3d>?

At the moment I have a MatrixXd<numberOfPoints, 3> could I map this to the "set of vectors"?

Thanks in advance.
Martin
Hauke
Registered Member
Posts
109
Karma
3
OS

Re: set of vectors?

Sun Oct 24, 2010 3:11 pm
The following code should work just fine
Code: Select all
#include <Eigen/Core>

using namespace Eigen;

int main(int argc, char* argv[])
{
  Matrix3Xd x = Matrix3Xd::Random(3,200);
  Affine3d A = Affine3d::Identity();
  // configure the affine transformation
  Matrix3Xd y = A*x;
}


I.e. just stick to your matrix representation but use a matrix where the number of rows is fixed (Matrix3Xd = Matrix<double,3,Dynamic>).

I hope that helps a bit.

- Hauke
martinakos
Registered Member
Posts
53
Karma
0
OS

Re: set of vectors?

Mon Oct 25, 2010 3:44 pm
Thanks!
That works well.


Bookmarks



Who is online

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