|
From: Gael G. <gae...@gm...> - 2008-10-30 01:11:34
|
UPDATE: eventually I managed to workaround the second incompatibility I listed about Transpose (but that does not means you should not care about updating them ;), see my remarks ) So, it remains only the dot product as the unique incompatibility. gael. On Wed, Oct 29, 2008 at 5:36 PM, Gael Guennebaud <gae...@gm...> wrote: > Dear all, > > for your information all the changes I made in vcg related to matrices > and points are enabled only if you define VCG_USE_EIGEN. > > Since 2 minutes or so, meshlab compiled with that token on the > following three platforms: > - linux, gcc 4.3 > - linux gcc 4.0.1 (= mac's version + epsilon) > - msvc 9.0 > > This token is now defined by default in meshlab. If you really have > big troubles, then edit the files shared.pri and meshlab/meshlab.pro > to remove it and, please, send me you compiler errors. > > In order to allow for a smooth transition, the goal was to try to keep > a source compatibility with previous matrix/point classes once > VCG_USE_EIGEN defined. In practice this was not entirely possible, and > here is the list of the major issues you might have while enabling > VCG_USE_EIGEN: > > - first of all make sure your code compile without it. In particular > we had to change Point*::Zero() to the more explicit SetZero(). Remind > that p.Zero(); set p to zero. Once VCG_USE_EIGEN is defined, p.Zero() > will still compile but it will do nothing ! Indeed in Eigen, Zero is a > static member function which returns the expression of a zero matrix > or vector. For consistency I've also changed the few other Zero() > functions which actually performed a "set *this to zero", a big regexp > replacement should do the job in most cases. > > - the second major difference is that the dot product is no longer > defined via the operator*. Instead use p1.dot(p2). Perhaps we can also > add a global function vcg::dot(p1,p2) if some of you would prefer such > a syntax. Fortunately those errors are caught at compile time: you > should first get some weird messages stating that it cannot convert a > Eigen::Product<...> to a scalar followed by the very explicit: > invalid_vector_vector_product__if_you_wanted_a_dot_or_coeff_wise_product_you_must_use_the_explicit_functions > > - the third and last incompatibility is with respect to m.Transpose() > and vcg::Transpose(m). I cannot provide such functions because > Transpose is the name of a class in Eigen. The quick fix is to replace > them by either: > * m.transposeInPlace() if you really want to transpose the matrix > you have in hand (it returns nothing). > * m.transpose() if you only want to use the transpose of m (it does > not change m, and returns a transposed expression) > If you want to be a bit smarter, you should also check for code like that: > Matrix33 mt = m; > mt.Transpose(); > m * mt; > which should be replaced by the more efficient and intuitive: m * > m.transpose(); > Note that those 2 functions also work if VCG_USE_EIGEN is not defined. > > - finally I removed a couple of things which seemed to be used only > internally by vcg math classes like MatrixDiag*, and LinearSolver. > Again fell free to contact me if that's a major problem for you or if > you are unsure about how to work around. > > These 3 modifications are the only ones I had to do to make meshlab > compatible. So you have some troubles please report them to me. > > Once you've done that you can start using Eigen's API which is > available trough all Matrix and Point types. > > Of course, this is only the first step towards this major change, more > to come later... > > > cheers, > gael. > > > > > On Tue, Oct 28, 2008 at 9:44 AM, Paolo Cignoni > <pao...@is...> wrote: >> Dear Developers, >> >> as you could have noted, some major changes happened to our VCG library: >> the currently very chaotic, buggy, and incomplete math folder is going >> to be replaced by >> a clean, documented and efficient template library for linear algebra >> (vectors, matrices, >> and related algorithms): Eigen ( http://eigen.tuxfamily.org ) >> >> You should have seen a new folder in the vcglib repository, eigen, this >> folder >> is a SVN direct link to the repository of eigen, so you have no write >> permission >> on that folder (you have to be a eigen developer to commit stuff there). >> More details on these changes later. >> >> In the meantime, if something stop compiling, dont panic :) >> >> I wish to thank warmly Gael Guennebaud, a core developer of eigen, for >> suggesting and implementing this change >> (and obviously for all his point related contribs inside meshlab :) ) >> >> Cheers >> >> Paolo >> >> -- >> Paolo Cignoni -- Senior Researcher >> Visual Computing Laboratory - ISTI - CNR >> http://vcg.isti.cnr.it/~cignoni >> >> ISTI - CNR >> Via Moruzzi 1, >> 56124 Pisa >> ITALY >> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Vcg-devel mailing list >> Vcg...@li... >> https://lists.sourceforge.net/lists/listinfo/vcg-devel >> > |