aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-12-22 20:50:47 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-12-22 20:50:47 +0000
commit789ea9d6762b2a0b2c737978f83939853cdb9fc3 (patch)
treea24c40b1ea4683edc86887c7e3a70ed029d1298b
parent4336cf3833d87bc1c8b4c9ef6f884547c80e31f0 (diff)
unless i find more failures in the tests, this will be beta3...
* fixes for mistakes (especially in the cast() methods in Geometry) revealed by the new "mixing types" test * dox love, including a section on coeff access in core and an overview in geometry
-rw-r--r--Eigen/src/Geometry/AlignedBox.h4
-rw-r--r--Eigen/src/Geometry/AngleAxis.h2
-rw-r--r--Eigen/src/Geometry/Hyperplane.h2
-rw-r--r--Eigen/src/Geometry/ParametrizedLine.h4
-rw-r--r--Eigen/src/Geometry/Quaternion.h2
-rw-r--r--Eigen/src/Geometry/Scaling.h2
-rw-r--r--Eigen/src/Geometry/Transform.h2
-rw-r--r--Eigen/src/Geometry/Translation.h2
-rw-r--r--Eigen/src/QR/EigenSolver.h2
-rw-r--r--doc/Doxyfile.in3
-rw-r--r--doc/QuickStartGuide.dox16
-rw-r--r--doc/TutorialGeometry.dox22
12 files changed, 51 insertions, 12 deletions
diff --git a/Eigen/src/Geometry/AlignedBox.h b/Eigen/src/Geometry/AlignedBox.h
index 3d4608e73..a835d0edd 100644
--- a/Eigen/src/Geometry/AlignedBox.h
+++ b/Eigen/src/Geometry/AlignedBox.h
@@ -142,8 +142,8 @@ public:
template<typename OtherScalarType>
inline explicit AlignedBox(const AlignedBox<OtherScalarType,AmbientDimAtCompileTime>& other)
{
- m_min = other.min().template cast<OtherScalarType>();
- m_max = other.max().template cast<OtherScalarType>();
+ m_min = other.min().template cast<Scalar>();
+ m_max = other.max().template cast<Scalar>();
}
/** \returns \c true if \c *this is approximately equal to \a other, within the precision
diff --git a/Eigen/src/Geometry/AngleAxis.h b/Eigen/src/Geometry/AngleAxis.h
index d5667190f..289b3e62d 100644
--- a/Eigen/src/Geometry/AngleAxis.h
+++ b/Eigen/src/Geometry/AngleAxis.h
@@ -146,7 +146,7 @@ public:
template<typename OtherScalarType>
inline explicit AngleAxis(const AngleAxis<OtherScalarType>& other)
{
- m_axis = other.axis().template cast<OtherScalarType>();
+ m_axis = other.axis().template cast<Scalar>();
m_angle = other.angle();
}
diff --git a/Eigen/src/Geometry/Hyperplane.h b/Eigen/src/Geometry/Hyperplane.h
index 98611d146..666411ab0 100644
--- a/Eigen/src/Geometry/Hyperplane.h
+++ b/Eigen/src/Geometry/Hyperplane.h
@@ -254,7 +254,7 @@ public:
/** Copy constructor with scalar type conversion */
template<typename OtherScalarType>
inline explicit Hyperplane(const Hyperplane<OtherScalarType,AmbientDimAtCompileTime>& other)
- { m_coeffs = other.coeffs().template cast<OtherScalarType>(); }
+ { m_coeffs = other.coeffs().template cast<Scalar>(); }
/** \returns \c true if \c *this is approximately equal to \a other, within the precision
* determined by \a prec.
diff --git a/Eigen/src/Geometry/ParametrizedLine.h b/Eigen/src/Geometry/ParametrizedLine.h
index b344493c7..5a73b0fde 100644
--- a/Eigen/src/Geometry/ParametrizedLine.h
+++ b/Eigen/src/Geometry/ParametrizedLine.h
@@ -118,8 +118,8 @@ public:
template<typename OtherScalarType>
inline explicit ParametrizedLine(const ParametrizedLine<OtherScalarType,AmbientDimAtCompileTime>& other)
{
- m_origin = other.origin().template cast<OtherScalarType>();
- m_direction = other.direction().template cast<OtherScalarType>();
+ m_origin = other.origin().template cast<Scalar>();
+ m_direction = other.direction().template cast<Scalar>();
}
/** \returns \c true if \c *this is approximately equal to \a other, within the precision
diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h
index f6630e63e..02c9e3075 100644
--- a/Eigen/src/Geometry/Quaternion.h
+++ b/Eigen/src/Geometry/Quaternion.h
@@ -207,7 +207,7 @@ public:
/** Copy constructor with scalar type conversion */
template<typename OtherScalarType>
inline explicit Quaternion(const Quaternion<OtherScalarType>& other)
- { m_coeffs = other.coeffs().template cast<OtherScalarType>(); }
+ { m_coeffs = other.coeffs().template cast<Scalar>(); }
/** \returns \c true if \c *this is approximately equal to \a other, within the precision
* determined by \a prec.
diff --git a/Eigen/src/Geometry/Scaling.h b/Eigen/src/Geometry/Scaling.h
index 54b01d8a0..c8550ec17 100644
--- a/Eigen/src/Geometry/Scaling.h
+++ b/Eigen/src/Geometry/Scaling.h
@@ -140,7 +140,7 @@ public:
/** Copy constructor with scalar type conversion */
template<typename OtherScalarType>
inline explicit Scaling(const Scaling<OtherScalarType,Dim>& other)
- { m_coeffs = other.coeffs().template cast<OtherScalarType>(); }
+ { m_coeffs = other.coeffs().template cast<Scalar>(); }
/** \returns \c true if \c *this is approximately equal to \a other, within the precision
* determined by \a prec.
diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h
index d62a9c98d..700246610 100644
--- a/Eigen/src/Geometry/Transform.h
+++ b/Eigen/src/Geometry/Transform.h
@@ -271,7 +271,7 @@ public:
/** Copy constructor with scalar type conversion */
template<typename OtherScalarType>
inline explicit Transform(const Transform<OtherScalarType,Dim>& other)
- { m_matrix = other.matrix().template cast<OtherScalarType>(); }
+ { m_matrix = other.matrix().template cast<Scalar>(); }
/** \returns \c true if \c *this is approximately equal to \a other, within the precision
* determined by \a prec.
diff --git a/Eigen/src/Geometry/Translation.h b/Eigen/src/Geometry/Translation.h
index eec829690..d1a3d354b 100644
--- a/Eigen/src/Geometry/Translation.h
+++ b/Eigen/src/Geometry/Translation.h
@@ -143,7 +143,7 @@ public:
/** Copy constructor with scalar type conversion */
template<typename OtherScalarType>
inline explicit Translation(const Translation<OtherScalarType,Dim>& other)
- { m_coeffs = other.vector().template cast<OtherScalarType>(); }
+ { m_coeffs = other.vector().template cast<Scalar>(); }
/** \returns \c true if \c *this is approximately equal to \a other, within the precision
* determined by \a prec.
diff --git a/Eigen/src/QR/EigenSolver.h b/Eigen/src/QR/EigenSolver.h
index 6f6631462..7fcd8cd4a 100644
--- a/Eigen/src/QR/EigenSolver.h
+++ b/Eigen/src/QR/EigenSolver.h
@@ -150,7 +150,7 @@ typename EigenSolver<MatrixType>::EigenvectorType EigenSolver<MatrixType>::eigen
if (ei_isMuchSmallerThan(ei_abs(ei_imag(m_eivalues.coeff(j))), ei_abs(ei_real(m_eivalues.coeff(j)))))
{
// we have a real eigen value
- matV.col(j) = m_eivec.col(j);
+ matV.col(j) = m_eivec.col(j).template cast<Complex>();
}
else
{
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index c3a6a9ddb..a781d39d1 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -1193,7 +1193,8 @@ INCLUDE_FILE_PATTERNS =
PREDEFINED = EIGEN_EMPTY_STRUCT \
EIGEN_PARSED_BY_DOXYGEN \
EIGEN_VECTORIZE \
- EIGEN_QT_SUPPORT
+ EIGEN_QT_SUPPORT \
+ EIGEN_STRONG_INLINE=inline
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
diff --git a/doc/QuickStartGuide.dox b/doc/QuickStartGuide.dox
index 81df4aa3d..446bade0c 100644
--- a/doc/QuickStartGuide.dox
+++ b/doc/QuickStartGuide.dox
@@ -14,6 +14,7 @@ namespace Eigen {
- \ref TutorialCoreSimpleExampleFixedSize
- \ref TutorialCoreSimpleExampleDynamicSize
- \ref TutorialCoreMatrixTypes
+ - \ref TutorialCoreCoefficients
- \ref TutorialCoreMatrixInitialization
- \ref TutorialCoreArithmeticOperators
- \ref TutorialCoreReductions
@@ -87,8 +88,23 @@ For example, \c Vector3d is a typedef for \code Matrix<double, 3, 1> \endcode
For dynamic-size, that is in order to left the number of rows or of columns unspecified at compile-time, use the special value Eigen::Dynamic. For example, \c VectorXd is a typedef for \code Matrix<double, Dynamic, 1> \endcode
+<a href="#" class="top">top</a>\section TutorialCoreCoefficients Coefficient access
+Eigen supports the following syntaxes for read and write coefficient access:
+\code
+matrix(i,j);
+vector(i)
+vector[i]
+vector.x() // first coefficient
+vector.y() // second coefficient
+vector.z() // third coefficient
+vector.w() // fourth coefficient
+\endcode
+
+Notice that these coefficient access methods have assertions checking the ranges. So if you do a lot of coefficient access, these assertion can have an important cost. There are then two possibilities if you want avoid paying this cost:
+\li Either you can disable assertions altogether, by defining EIGEN_NO_DEBUG or NDEBUG. Notice that some IDEs like MS Visual Studio define NDEBUG automatically in "Release Mode".
+\li Or you can disable the checks on a case-by-case basis by using the coeff() and coeffRef() methods: see MatrixBase::coeff(int,int) const, MatrixBase::coeffRef(int,int), etc.
<a href="#" class="top">top</a>\section TutorialCoreMatrixInitialization Matrix and vector creation and initialization
diff --git a/doc/TutorialGeometry.dox b/doc/TutorialGeometry.dox
index 5a1a3e06e..b30499763 100644
--- a/doc/TutorialGeometry.dox
+++ b/doc/TutorialGeometry.dox
@@ -18,6 +18,28 @@ namely 2D and 3D rotations and affine transformations.
- \ref TutorialGeoTransform
- \ref TutorialGeoEulerAngles
+Eigen's Geometry module provides two different kinds of geometric transformations:
+ - Abstract transformations, such as rotations (represented by \ref AngleAxis "angle and axis" or by a \ref Quaternion "quaternion"), \ref Translation "translations", \ref Scaling "scalings". These transformations are NOT represented as matrices, but you can nevertheless mix them with matrices and vectors in expressions, and convert them to matrices if you wish.
+ - Affine transformation matrices: see the Transform class. These are really matrices.
+
+\note If you are working with OpenGL 4x4 matrices then Transform3f and Transform3d are what you want. Since Eigen defaults to column-major storage, you can directly use the Transform::data() method to pass your transformation matrix to OpenGL.
+
+You can construct a Transform from an abstract transformation, like this:
+\code
+ Transform t(AngleAxis(angle,axis));
+\endcode
+or like this:
+\code
+ Transform t;
+ t = AngleAxis(angle,axis);
+\endcode
+But note that unfortunately, because of how C++ works, you can \b not do this:
+\code
+ Transform t = AngleAxis(angle,axis);
+\endcode
+<span class="note">\b Explanation: In the C++ language, this would require Transform to have a non-explicit conversion constructor from AngleAxis, but we really don't want to allow implicit casting here.
+</span>
+
\section TutorialGeoElementaryTransformations Transformation types
<table class="tutorial_code">