Commit Graph

29 Commits

Author SHA1 Message Date
Paolo Cignoni 69a82d6174 fix the is "inaccessible" issue with g++-4.0.1 - more fixes ;) 2008-10-29 11:29:57 +00:00
Paolo Cignoni 07f2e976ea * change all remaining Transpose to transpose,
* update the gl/math wrappers to make them more Eigen friendly
  (and remove the useless, and not used, and somehow dangerous
   *Direct and *E functions)
* add automatic reinterpret_casting from Eigen::Matrix to vcg
  specialized types
2008-10-29 00:05:44 +00:00
Paolo Cignoni 0361427bc0 big cleaning in Point* and Matrix*, now they are very closed to be simple typedef of
Eigen's Matrix. Now the dilema is how to mimic those typedefs, using inheritence ?
or using the classic workaround: typename Point3<float>::Type; with Point3<T>::Type defined
to Eigen::Matrix<T,3,1>. Anyway currently I support both (and the inheritence scheme has
to be preserved for compatibility). The advantage of the second approach is that when
eigen has to evaluate an expression it uses an Eigen::Matrix<>, so it is probably better
to only use Eigen::Matrix but I'm not 100% sure that makes a big difference especially if
we add some automatic reinterpret_cast between Eigen::Matrix and vcg::Point*....
2008-10-28 20:06:17 +00:00
Paolo Cignoni 7befff7bec make point2 derived Eigen's Matrix, and a set of minimal fixes to make meshlab compile
with both old and new version. The fixes include:
- dot product: vec0 * vec1 => vec0.dot(vec1) (I added .dot() to the old Point classes too)
- Transpose: Transpose is an Eigen type, so we cannot keep it if Eigen is used. Therefore
  I added a .tranpose() to old matrix classes, and modified most of the Transpose() to transpose()
  both in vcg and meshlab. In fact, transpose() are free with Eigen, it simply returns a transpose
  expression without copies. On the other be carefull:  m = m.transpose() won't work as expected,
  here me must evaluate to a temporary: m = m.transpose().eval(); However, this operation in very
  rarely needed: you transpose at the same sime you set m, or you use m.transpose() directly.
- the last issue is Normalize which both modifies *this and return a ref to it. This behavior
  don't make sense anymore when using expression template, e.g., in (a+b).Normalize(), the type
  of a+b if not a Point (or whatever Vector types), it an expression of the addition of 2 points,
  so we cannot modify the value of *this, since there is no value. Therefore I've already changed
  all those .Normalize() of expressions to the Eigen's version .normalized().
- Finally I've changed the Zero to SetZero in the old Point classes too.
2008-10-28 00:59:46 +00:00
Paolo Cignoni ab200fc950 Port to eigen2: state of the mess:
* curently nothing change if you don't define VCG_USE_EIGEN
* make Matrix*, Point3 and Point4 derive Eigen::Matrix (still ugly)
* now catching all the dot products to replace them by .dot()
  note that most of meshlab already compile
2008-10-27 19:35:17 +00:00
Paolo Cignoni 4db69febbe big replacement .Zero => .SetZero, and start of Eigen's compatibilities (currently disabled by default) 2008-10-27 14:48:14 +00:00
Paolo Cignoni 24ea4251a9 Matrix33: make const the binary operators 2008-10-24 12:20:44 +00:00
Paolo Cignoni 7c66288207 changed a RotateRad to the new SetRotateRad 2008-08-14 10:02:07 +00:00
ganovelli 3462f6a8c2 changed from Rotate (in degrees) to SetRotateRad and SetRotateDeg (the same as in Matrix44.h)
Added return type to the functions SetXXX
2008-08-12 17:31:11 +00:00
ganovelli 1e94f7cf46 Add covariance matrix of a set of points 2008-08-07 18:33:23 +00:00
ganovelli a7e016e1ef added RandomRotation 2008-01-03 17:40:17 +00:00
Nico Pietroni 85175e7dc4 added RotationMatrix method to calculate rotation matrix along an axis 2007-04-19 14:30:26 +00:00
Nico Pietroni ac5e8a2143 Added function RotationMatrix 2007-04-07 23:06:47 +00:00
Nico Pietroni 2d7c1bbdd2 -Used scalar type passed as template argument istead of double to prevent warnings.. in Rotate function 2007-01-29 00:20:25 +00:00
ganovelli d1eea25504 added constructor from matrix44 excluding a row and colum 2006-09-25 23:05:29 +00:00
ganovelli 9587cc0350 bug in operator + with MatrixxDig 2006-06-22 08:00:05 +00:00
Nico Pietroni cf9fd0ca9f added operators:
operator -= ( const Matrix33Diag<S>  &p )
           Matrix33  operator - ( const Matrix33Diag<S>  &p )
           Matrix33  operator + ( const Matrix33 &m )
           Matrix33  operator + ( const Matrix33Diag<S>  &p )
2006-01-20 16:41:44 +00:00
Paolo Cignoni 0f7d072b0f Changed Invert -> FastInvert for the function based on the maple expansion 2005-11-14 10:28:25 +00:00
Federico Ponchio a06ae78c6e Changed a Zero in SetZero in WeightedCrossCovariance() (again) 2005-10-13 15:45:23 +00:00
Nico Pietroni 7580221931 corrected sintax error on singular value decomposition 2005-10-05 17:06:12 +00:00
ganovelli 44e86f5a9b added inverse by SVD 2005-09-29 09:53:58 +00:00
Paolo Cignoni bebc58f9b1 Changed a Zero in SetZero in WeightedCrossCovariance() 2005-06-10 14:51:54 +00:00
Nico Pietroni 47b654861c Added Norm Function 2005-06-10 11:46:49 +00:00
ganovelli b14537dcff changed from Matrix33Ide to MatrixeeDiag 2005-06-07 14:29:56 +00:00
ganovelli 5aea057836 Matrix33Ide Added: it implements diagonal matrix. Added only operator += in Matrix33 2005-05-23 15:05:26 +00:00
Nico Pietroni 9cb3c240e6 changed swap to math::Swap in Traspose Function 2005-04-11 14:11:22 +00:00
Paolo Cignoni 13190dfe88 Updated interface: all Matrix classes have now the same interface 2004-10-18 15:03:14 +00:00
Paolo Cignoni 2376184409 removed uppercase references in include 2004-07-13 06:48:30 +00:00
ganovelli e463b177f3 created 2004-05-28 13:09:05 +00:00