Re: [eigen] Eigen2 in Avogadro

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Quoting Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:

On Tue, Aug 26, 2008 at 11:35 AM, Daniel Gómez <dgomezferro@xxxxxxxxx> wrote:
They also use some wrapper classes around std::vector and plain C arrays
(gmm::array1D_reference for instance). Should these be made VectorXd ?

if the purpose is to warp std::vectors, then I would say:
Map<VectorXd>(&v[0], v.size())

Little explanation: the solution proposed by Gael is if you want to keep std::vector for storage, but use Eigen do the computations. Eigen::Map<VectorXd> takes a memory area and makes a Eigen expression that behaves exactly like a VectorXd, wrapping around this memory area as the array of coefficients.

But, in many cases (don't know if it's the case for Step) people indeed use std::vector<double> when they could really use VectorXd. In this case, it's just easier to completely convert to VectorXd, it spares the hassle of using Eigen::Map's.

That needs to be seen with Vladimir and Aliona.

I hope you'll be around to answer questions, otherwise I'll be stuck
forever :P

yes, sure no problem !

Me too: no problem! Just because I don't have time to develop new features doesn't mean I don't have time to answer questions.

Benoit

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/