Commit Graph

44 Commits

Author SHA1 Message Date
Gael Guennebaud
1b194193ef Big change in DiagonalMatrix and Geometry/Scaling:
* previous DiagonalMatrix expression is now DiagonalMatrixWrapper
* DiagonalMatrix class is now for storage
* add the DiagonalMatrixBase class to factorize code of the
  two previous classes
* remove Scaling class (it is now a global function)
* add UniformScaling helper class
  (don't use it directly, use the Scaling function)
* add the Scaling global function to simplify the creation
  of scaling objects
There is still a lot to do, in particular about DiagonalProduct for which
the goal is to get rid of the "if()" in the coeff() function. At least
it is not worse than before ! Also need to uptade the tutorial and add more doc.
2009-01-28 16:26:06 +00:00
Benoit Jacob
d384671793 now these tests succeed with 10,000 repeats 2009-01-27 20:47:12 +00:00
Benoit Jacob
291ee89684 add computeRotationScaling and computeScalingRotation in SVD
add convenience functions in Transform
reimplement Transform::rotation() to use that
add unit-test
2009-01-22 16:39:08 +00:00
Benoit Jacob
7ccea9222c fix warnings 2009-01-21 20:06:16 +00:00
Benoit Jacob
4d44ca226e * make std::vector specializations also for Transform and for Quaternion
* update test_stdvector
* Quaternion() does nothing (instead of bug)
* update test_geometry
* some renaming
2009-01-12 16:06:04 +00:00
Benoit Jacob
7db3f2f72a *fix compilation with MSVC 2005 in the Transform::construct_from_matrix
*fix warnings with MSVC 2005: converting M_PI to float gives loss-of-precision warnings
2009-01-05 14:47:38 +00:00
Benoit Jacob
986f301233 *add PartialRedux::cross() with unit test
*add transform-from-matrices test
*undo an unwanted change in Matrix
2009-01-05 14:26:34 +00:00
Gael Guennebaud
ebf906a23a add matrix * transform product 2008-12-19 16:31:22 +00:00
Benoit Jacob
df4bd5e46f * fix a test giving some false positives
* add coverage for various operator*=
2008-12-19 16:16:39 +00:00
Benoit Jacob
a3fad2e3c3 Transform*Transform should return Transform
unit test compiles again
2008-12-19 15:55:35 +00:00
Benoit Jacob
22875683b9 * extractRotation ---> rotation
* expand the geometry/Transform tests, after Mek's reports
* fix my own stupidity in eigensolver test
2008-12-19 14:52:03 +00:00
Gael Guennebaud
9c0deb55ca bugfix in matrix to Euler-angles function 2008-12-06 11:04:33 +00:00
Gael Guennebaud
faf942a947 Add a generic matrix to Euler-angles function.
Perhaps the prototype of this function could be improved,
see comments in the code
2008-12-05 15:56:28 +00:00
Benoit Jacob
3d90c13970 norm2() renamed to squaredNorm(), kept as deprecated for now. 2008-11-03 19:14:17 +00:00
Gael Guennebaud
ec0a423862 Add isApprox in Geometry module's classes.
Complete unit tests wrt previous commits.
2008-10-25 23:10:21 +00:00
Gael Guennebaud
e5c50afed6 * Quaternion: added dot product and angularDistance functions. The latter is
based on the former.
* opengl_demo: makes IcoSphere better (vertices are instanciated only once) and
               removed the generation of a big geometry for the fancy spheres...
2008-09-11 11:19:34 +00:00
Gael Guennebaud
52406aecad * Extend a bit ParametrizedLine and move it to a separate file,
add unit-tests for it.
* remove "using namespace std" in test/main.h such that the compilation
  bug found today in SVD won't happen again.
2008-09-03 22:35:45 +00:00
Benoit Jacob
46fe7a3d9e if EIGEN_NICE_RANDOM is defined, the random functions will return numbers with
few bits left of the comma and for floating-point types will never return zero.
This replaces the custom functions in test/main.h, so one does not anymore need
to think about that when writing tests.
2008-09-01 17:31:21 +00:00
Gael Guennebaud
49ff9b204c remove the conceptualy broken "NoShear" transformation traits,
and rename NonAfine => Projective, GenericAffine => Affine, NoScaling => Isometry
2008-09-01 17:14:34 +00:00
Gael Guennebaud
7e8aa63bb7 * Add Hyperplane::transform(Matrix/Transform)
* Fix compilations with gcc 3.4, ICC and doxygen
* Fix krazy directives (hopefully)
2008-08-31 13:32:29 +00:00
Gael Guennebaud
5c8c09e021 add uniform scale/prescale functions in Tranform 2008-08-30 23:10:46 +00:00
Gael Guennebaud
6ba991aa3a * added a RotationBase class following the CRT pattern
This allow code factorization and generic template specialization
  of functions
* added any_rotation * {Translation,Scaling,Transform} products methods
* rewrite of the actually broken ToRoationMatrix helper class to
  a global ei_toRotationMatrix function.
2008-08-30 20:11:04 +00:00
Gael Guennebaud
f1e6c56b77 * rename TranformationKnowledge to TransformTraits
* apply the same principle to extractRotation and fix it to
  extract a rotation corresponding to a positive scaling
2008-08-30 15:22:45 +00:00
Gael Guennebaud
236b7a545d update Transform::inverse() to take an optional argument stating whether the transformation is:
NonAffine, Affine (default), contains NoShear, contains NoScaling
that allows significant speed improvements. If you like it, this concept could be applied to
Transform::extractRotation (or to a more advanced decomposition function) and to Hyperplane::transformed()
and maybe to some other places... e.g., I think a Transform::normalMatrix() function would not harm and
warn user that the transformation of normals is not that trivial (I saw this mistake much too often)
2008-08-30 12:42:06 +00:00
Gael Guennebaud
9e7a9cde14 Add Scaling and Translation class as discussed on ML, still missing:
* handling Quaternion, AngleAxis and Rotation2D, 2 options here:
 1- make all of them inheriting a common base class Rotation such that we can
    have a single version of operator* for all the rotation type (they all get converted to a matrix)
 2- write a version for all type (so 3 rotations types * 3 for Transform,Translation and Scaling)
* real documentation
2008-08-30 00:08:23 +00:00
Gael Guennebaud
7ea821d18e spelling + some krazy directives 2008-08-28 21:44:56 +00:00
Benoit Jacob
5ac883b10a Fix a bug discovered in Avogadro: the AngleAxis*Matrix and the newer
AngleAxis*Vector products were wrong because they returned the product
_expression_
   toRotationMatrix()*other;
and toRotationMatrix() died before that expression would be later
evaluated. Here it would not have been practical to NestByValue as this
is a whole matrix. So, let them simply evaluate and return the result by
value.

The geometry.cpp unit-test only checked for compatibility between
various rotations, it didn't check the correctness of the rotations
themselves. That's why this bug escaped us. So, this commit checks that
the rotations produced by AngleAxis have all the expected properties.
Since the compatibility with the other rotations is already checked,
this should validate them as well.
2008-08-24 23:16:51 +00:00
Benoit Jacob
251ecc0ab9 Rename someOrthogonal to unitOrthogonal. Fix a bug in it, with dyn-size vectors of size <=3.
Update doc and test to reflect that it always returns a unit vector.
2008-08-24 17:31:03 +00:00
Gael Guennebaud
2120fed849 * bug fixes in: Dot, generalized eigen problem, singular matrix detetection in Cholesky
* fix all numerical instabilies in the unit tests, now all tests can be run 2000 times
  with almost zero failures.
2008-08-23 15:14:20 +00:00
Gael Guennebaud
f0394edfa7 * bugfix in SolveTriangular found by Timothy Hunter (did not compiled for very small fixed size matrices)
* bugfix in Dot unroller
* added special random generator for the unit tests and reduced the tolerance threshold by an order of magnitude
  this fixes issues with sum.cpp but other tests still failed sometimes, this have to be carefully checked...
2008-08-22 17:48:36 +00:00
Gael Guennebaud
60804c306d *patch by Daniel Gomez:
- bugfix in SparseMatrix
 - add a sparse unit test
* renamed Transform::affine => linear
2008-08-21 17:02:47 +00:00
Gael Guennebaud
e77ccf2928 * Rewrite the triangular solver so that we can take advantage of our efficient matrix-vector products:
=> up to 6 times faster !
* Added DirectAccessBit to Part
* Added an exemple of a cwise operator
* Renamed perpendicular() => someOrthogonal() (geometry module)
* Fix a weired bug in ei_constant_functor: the default copy constructor did not copy
  the imaginary part when the single member of the class is a complex...
2008-07-26 20:40:29 +00:00
Gael Guennebaud
172000aaeb Add .perpendicular() function in Geometry module (adapted from Eigen1)
Documentation:
 * add an overview for each module.
 * add an example for .all() and Cwise::operator<
2008-07-22 10:54:42 +00:00
Gael Guennebaud
c10f069b6b * Merge Extract and Part to the Part expression.
Renamed "MatrixBase::extract() const" to "MatrixBase::part() const"
* Renamed static functions identity, zero, ones, random with an upper case
  first letter: Identity, Zero, Ones and Random.
2008-07-21 00:34:46 +00:00
Gael Guennebaud
05ad083467 Added MatrixBase::Unit*() static function to easily create unit/basis vectors.
Removed EulerAngles, addes typdefs for Quaternion and AngleAxis,
and added automatic conversions from Quaternion/AngleAxis to Matrix3 such that:
 Matrix3f m = AngleAxisf(0.2,Vector3f::UnitX) * AngleAxisf(0.2,Vector3f::UnitY);
just works.
2008-07-19 13:03:23 +00:00
Benoit Jacob
f5791eeb70 the big Array/Cwise rework as discussed on the mailing list. The new API
can be seen in Eigen/src/Core/Cwise.h.
2008-07-08 00:49:10 +00:00
Benoit Jacob
3b94436d2f * vectorize dot product, copying code from sum.
* make the conj functor vectorizable: it is just identity in real case,
  and complex doesn't use the vectorized path anyway.
* fix bug in Block: a 3x1 block in a 4x4 matrix (all fixed-size)
  should not be vectorizable, since in fixed-size we are assuming
  the size to be a multiple of packet size. (Or would you prefer
  Vector3d to be flagged "packetaccess" even though no packet access
  is possible on vectors of that type?)
* rename:
  isOrtho for vectors ---> isOrthogonal
  isOrtho for matrices ---> isUnitary
* add normalize()
* reimplement normalized with quotient1 functor
2008-06-24 15:13:00 +00:00
Gael Guennebaud
32c5ea388e work on rotations in the Geometry module:
- convertions are done trough constructors and operator=
 - added a EulerAngles class
2008-06-21 15:01:49 +00:00
Gael Guennebaud
bc0c7c57ed Added an extensible mechanism to support any kind of rotation
representation in Transform via the template static class
ToRotationMatrix.
Added a lightweight AngleAxis class (similar to Rotation2D).
2008-06-15 17:22:41 +00:00
Gael Guennebaud
0ee6b08128 * split Product to a DiagonalProduct template specialization
to optimize matrix-diag and diag-matrix products without
  making Product over complicated.
* compilation fixes in Tridiagonalization and HessenbergDecomposition
  in the case of 2x2 matrices.
* added an Orientation2D small class with similar interface than Quaternion
  (used by Transform to handle 2D and 3D orientations seamlessly)
* added a couple of features in Transform.
2008-06-15 11:54:18 +00:00
Gael Guennebaud
fbbd8afe30 Started a Transform class in the Geometry module to represent
homography.
Fix indentation in Quaternion.h
2008-06-15 08:33:44 +00:00
Gael Guennebaud
915587d03d * add CommaInitializer::finished to allow the use of (Matrix3() << v0, v1, v2).finished()
as an argument of a function. Other possibilities for the name could be "end" or "matrix" ??
* various update in Quaternion, in particular I added a lot of FIXME about the API options,
  these have to be discussed and fixed.
2008-06-03 15:50:09 +00:00
Gael Guennebaud
196f38f5db improved Quaternion class:
- Euler angles and angle axis conversions,
 - stable spherical interpolation
 - documentation
 - update the respective unit test
2008-06-03 13:43:29 +00:00
Gael Guennebaud
a9cf229e15 add a geometry unit test and fix a couple of typo in Quaternion.h 2008-06-03 07:32:12 +00:00