diff options
Diffstat (limited to 'Eigen/src/Eigen2Support/Geometry')
-rw-r--r-- | Eigen/src/Eigen2Support/Geometry/AlignedBox.h | 5 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/Geometry/All.h | 8 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/Geometry/AngleAxis.h | 6 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/Geometry/Hyperplane.h | 17 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/Geometry/ParametrizedLine.h | 14 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/Geometry/Quaternion.h | 15 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/Geometry/Rotation2D.h | 6 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/Geometry/RotationBase.h | 5 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/Geometry/Scaling.h | 6 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/Geometry/Transform.h | 6 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/Geometry/Translation.h | 6 |
11 files changed, 39 insertions, 55 deletions
diff --git a/Eigen/src/Eigen2Support/Geometry/AlignedBox.h b/Eigen/src/Eigen2Support/Geometry/AlignedBox.h index cedce218c..1c915be22 100644 --- a/Eigen/src/Eigen2Support/Geometry/AlignedBox.h +++ b/Eigen/src/Eigen2Support/Geometry/AlignedBox.h @@ -22,8 +22,7 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see <http://www.gnu.org/licenses/>. -#ifndef EIGEN_ALIGNEDBOX_H -#define EIGEN_ALIGNEDBOX_H +// no include guard, we'll include this twice from All.h from Eigen2Support, and it's internal anyway /** \geometry_module \ingroup Geometry_Module * \nonstableyet @@ -169,5 +168,3 @@ inline Scalar AlignedBox<Scalar,AmbiantDim>::squaredExteriorDistance(const Vecto } return dist2; } - -#endif // EIGEN_ALIGNEDBOX_H diff --git a/Eigen/src/Eigen2Support/Geometry/All.h b/Eigen/src/Eigen2Support/Geometry/All.h index a399549fe..7b076806b 100644 --- a/Eigen/src/Eigen2Support/Geometry/All.h +++ b/Eigen/src/Eigen2Support/Geometry/All.h @@ -58,6 +58,10 @@ #define Hyperplane eigen2_Hyperplane #define ParametrizedLine eigen2_ParametrizedLine +#define ei_toRotationMatrix eigen2_ei_toRotationMatrix +#define ei_quaternion_assign_impl eigen2_ei_quaternion_assign_impl +#define ei_transform_product_impl eigen2_ei_transform_product_impl + #include "RotationBase.h" #include "Rotation2D.h" #include "Quaternion.h" @@ -69,6 +73,10 @@ #include "Hyperplane.h" #include "ParametrizedLine.h" +#undef ei_toRotationMatrix +#undef ei_quaternion_assign_impl +#undef ei_transform_product_impl + #undef RotationBase #undef Rotation2D #undef Rotation2Df diff --git a/Eigen/src/Eigen2Support/Geometry/AngleAxis.h b/Eigen/src/Eigen2Support/Geometry/AngleAxis.h index d1b784066..f7b2d51e3 100644 --- a/Eigen/src/Eigen2Support/Geometry/AngleAxis.h +++ b/Eigen/src/Eigen2Support/Geometry/AngleAxis.h @@ -22,8 +22,8 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see <http://www.gnu.org/licenses/>. -#ifndef EIGEN_ANGLEAXIS_H -#define EIGEN_ANGLEAXIS_H +// no include guard, we'll include this twice from All.h from Eigen2Support, and it's internal anyway + /** \geometry_module \ingroup Geometry_Module * @@ -224,5 +224,3 @@ AngleAxis<Scalar>::toRotationMatrix(void) const return res; } - -#endif // EIGEN_ANGLEAXIS_H diff --git a/Eigen/src/Eigen2Support/Geometry/Hyperplane.h b/Eigen/src/Eigen2Support/Geometry/Hyperplane.h index 420b30fe9..81c4f55b1 100644 --- a/Eigen/src/Eigen2Support/Geometry/Hyperplane.h +++ b/Eigen/src/Eigen2Support/Geometry/Hyperplane.h @@ -23,8 +23,7 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see <http://www.gnu.org/licenses/>. -#ifndef EIGEN_HYPERPLANE_H -#define EIGEN_HYPERPLANE_H +// no include guard, we'll include this twice from All.h from Eigen2Support, and it's internal anyway /** \geometry_module \ingroup Geometry_Module * @@ -71,7 +70,7 @@ public: : m_coeffs(n.size()+1) { normal() = n; - offset() = -e.dot(n); + offset() = -e.eigen2_dot(n); } /** Constructs a plane from its normal \a n and distance to the origin \a d @@ -92,7 +91,7 @@ public: { Hyperplane result(p0.size()); result.normal() = (p1 - p0).unitOrthogonal(); - result.offset() = -result.normal().dot(p0); + result.offset() = -result.normal().eigen2_dot(p0); return result; } @@ -104,7 +103,7 @@ public: EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(VectorType, 3) Hyperplane result(p0.size()); result.normal() = (p2 - p0).cross(p1 - p0).normalized(); - result.offset() = -result.normal().dot(p0); + result.offset() = -result.normal().eigen2_dot(p0); return result; } @@ -116,7 +115,7 @@ public: explicit Hyperplane(const ParametrizedLine<Scalar, AmbientDimAtCompileTime>& parametrized) { normal() = parametrized.direction().unitOrthogonal(); - offset() = -normal().dot(parametrized.origin()); + offset() = -normal().eigen2_dot(parametrized.origin()); } ~Hyperplane() {} @@ -133,7 +132,7 @@ public: /** \returns the signed distance between the plane \c *this and a point \a p. * \sa absDistance() */ - inline Scalar signedDistance(const VectorType& p) const { return p.dot(normal()) + offset(); } + inline Scalar signedDistance(const VectorType& p) const { return p.eigen2_dot(normal()) + offset(); } /** \returns the absolute distance between the plane \c *this and a point \a p. * \sa signedDistance() @@ -231,7 +230,7 @@ public: TransformTraits traits = Affine) { transform(t.linear(), traits); - offset() -= t.translation().dot(normal()); + offset() -= t.translation().eigen2_dot(normal()); return *this; } @@ -264,5 +263,3 @@ protected: Coefficients m_coeffs; }; - -#endif // EIGEN_HYPERPLANE_H diff --git a/Eigen/src/Eigen2Support/Geometry/ParametrizedLine.h b/Eigen/src/Eigen2Support/Geometry/ParametrizedLine.h index d48f44a79..411c4b570 100644 --- a/Eigen/src/Eigen2Support/Geometry/ParametrizedLine.h +++ b/Eigen/src/Eigen2Support/Geometry/ParametrizedLine.h @@ -23,8 +23,8 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see <http://www.gnu.org/licenses/>. -#ifndef EIGEN_PARAMETRIZEDLINE_H -#define EIGEN_PARAMETRIZEDLINE_H +// no include guard, we'll include this twice from All.h from Eigen2Support, and it's internal anyway + /** \geometry_module \ingroup Geometry_Module * @@ -85,7 +85,7 @@ public: RealScalar squaredDistance(const VectorType& p) const { VectorType diff = p-origin(); - return (diff - diff.dot(direction())* direction()).squaredNorm(); + return (diff - diff.eigen2_dot(direction())* direction()).squaredNorm(); } /** \returns the distance of a point \a p to its projection onto the line \c *this. * \sa squaredDistance() @@ -94,7 +94,7 @@ public: /** \returns the projection of a point \a p onto the line \c *this. */ VectorType projection(const VectorType& p) const - { return origin() + (p-origin()).dot(direction()) * direction(); } + { return origin() + (p-origin()).eigen2_dot(direction()) * direction(); } Scalar intersection(const Hyperplane<_Scalar, _AmbientDim>& hyperplane); @@ -148,8 +148,6 @@ inline ParametrizedLine<_Scalar, _AmbientDim>::ParametrizedLine(const Hyperplane template <typename _Scalar, int _AmbientDim> inline _Scalar ParametrizedLine<_Scalar, _AmbientDim>::intersection(const Hyperplane<_Scalar, _AmbientDim>& hyperplane) { - return -(hyperplane.offset()+origin().dot(hyperplane.normal())) - /(direction().dot(hyperplane.normal())); + return -(hyperplane.offset()+origin().eigen2_dot(hyperplane.normal())) + /(direction().eigen2_dot(hyperplane.normal())); } - -#endif // EIGEN_PARAMETRIZEDLINE_H diff --git a/Eigen/src/Eigen2Support/Geometry/Quaternion.h b/Eigen/src/Eigen2Support/Geometry/Quaternion.h index c81a3f92a..a75fa42ae 100644 --- a/Eigen/src/Eigen2Support/Geometry/Quaternion.h +++ b/Eigen/src/Eigen2Support/Geometry/Quaternion.h @@ -22,8 +22,7 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see <http://www.gnu.org/licenses/>. -#ifndef EIGEN_QUATERNION_H -#define EIGEN_QUATERNION_H +// no include guard, we'll include this twice from All.h from Eigen2Support, and it's internal anyway template<typename Other, int OtherRows=Other::RowsAtCompileTime, @@ -172,7 +171,7 @@ public: * corresponds to the cosine of half the angle between the two rotations. * \sa angularDistance() */ - inline Scalar dot(const Quaternion& other) const { return m_coeffs.dot(other.m_coeffs); } + inline Scalar eigen2_dot(const Quaternion& other) const { return m_coeffs.eigen2_dot(other.m_coeffs); } inline Scalar angularDistance(const Quaternion& other) const; @@ -353,7 +352,7 @@ inline Quaternion<Scalar>& Quaternion<Scalar>::setFromTwoVectors(const MatrixBas { Vector3 v0 = a.normalized(); Vector3 v1 = b.normalized(); - Scalar c = v0.dot(v1); + Scalar c = v0.eigen2_dot(v1); // if dot == 1, vectors are the same if (ei_isApprox(c,Scalar(1))) @@ -412,12 +411,12 @@ inline Quaternion<Scalar> Quaternion<Scalar>::conjugate() const } /** \returns the angle (in radian) between two rotations - * \sa dot() + * \sa eigen2_dot() */ template <typename Scalar> inline Scalar Quaternion<Scalar>::angularDistance(const Quaternion& other) const { - double d = ei_abs(this->dot(other)); + double d = ei_abs(this->eigen2_dot(other)); if (d>=1.0) return 0; return Scalar(2) * std::acos(d); @@ -430,7 +429,7 @@ template <typename Scalar> Quaternion<Scalar> Quaternion<Scalar>::slerp(Scalar t, const Quaternion& other) const { static const Scalar one = Scalar(1) - machine_epsilon<Scalar>(); - Scalar d = this->dot(other); + Scalar d = this->eigen2_dot(other); Scalar absD = ei_abs(d); Scalar scale0; @@ -505,5 +504,3 @@ struct ei_quaternion_assign_impl<Other,4,1> q.coeffs() = vec; } }; - -#endif // EIGEN_QUATERNION_H diff --git a/Eigen/src/Eigen2Support/Geometry/Rotation2D.h b/Eigen/src/Eigen2Support/Geometry/Rotation2D.h index dfa60d0b3..ee7c80e7e 100644 --- a/Eigen/src/Eigen2Support/Geometry/Rotation2D.h +++ b/Eigen/src/Eigen2Support/Geometry/Rotation2D.h @@ -22,8 +22,8 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see <http://www.gnu.org/licenses/>. -#ifndef EIGEN_ROTATION2D_H -#define EIGEN_ROTATION2D_H +// no include guard, we'll include this twice from All.h from Eigen2Support, and it's internal anyway + /** \geometry_module \ingroup Geometry_Module * @@ -155,5 +155,3 @@ Rotation2D<Scalar>::toRotationMatrix(void) const Scalar cosA = ei_cos(m_angle); return (Matrix2() << cosA, -sinA, sinA, cosA).finished(); } - -#endif // EIGEN_ROTATION2D_H diff --git a/Eigen/src/Eigen2Support/Geometry/RotationBase.h b/Eigen/src/Eigen2Support/Geometry/RotationBase.h index 5fec0f18d..2f494f198 100644 --- a/Eigen/src/Eigen2Support/Geometry/RotationBase.h +++ b/Eigen/src/Eigen2Support/Geometry/RotationBase.h @@ -22,8 +22,7 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see <http://www.gnu.org/licenses/>. -#ifndef EIGEN_ROTATIONBASE_H -#define EIGEN_ROTATIONBASE_H +// no include guard, we'll include this twice from All.h from Eigen2Support, and it's internal anyway // this file aims to contains the various representations of rotation/orientation // in 2D and 3D space excepted Matrix and Quaternion. @@ -133,5 +132,3 @@ inline static const MatrixBase<OtherDerived>& ei_toRotationMatrix(const MatrixBa YOU_MADE_A_PROGRAMMING_MISTAKE) return mat; } - -#endif // EIGEN_ROTATIONBASE_H diff --git a/Eigen/src/Eigen2Support/Geometry/Scaling.h b/Eigen/src/Eigen2Support/Geometry/Scaling.h index 747ce1d97..108e6d7d5 100644 --- a/Eigen/src/Eigen2Support/Geometry/Scaling.h +++ b/Eigen/src/Eigen2Support/Geometry/Scaling.h @@ -22,8 +22,8 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see <http://www.gnu.org/licenses/>. -#ifndef EIGEN_SCALING_H -#define EIGEN_SCALING_H +// no include guard, we'll include this twice from All.h from Eigen2Support, and it's internal anyway + /** \geometry_module \ingroup Geometry_Module * @@ -177,5 +177,3 @@ Scaling<Scalar,Dim>::operator* (const TransformType& t) const res.prescale(m_coeffs); return res; } - -#endif // EIGEN_SCALING_H diff --git a/Eigen/src/Eigen2Support/Geometry/Transform.h b/Eigen/src/Eigen2Support/Geometry/Transform.h index 1374a77dd..88956c86c 100644 --- a/Eigen/src/Eigen2Support/Geometry/Transform.h +++ b/Eigen/src/Eigen2Support/Geometry/Transform.h @@ -23,8 +23,8 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see <http://www.gnu.org/licenses/>. -#ifndef EIGEN_TRANSFORM_H -#define EIGEN_TRANSFORM_H +// no include guard, we'll include this twice from All.h from Eigen2Support, and it's internal anyway + // Note that we have to pass Dim and HDim because it is not allowed to use a template // parameter to define a template specialization. To be more precise, in the following @@ -796,5 +796,3 @@ struct ei_transform_product_impl<Other,Dim,HDim, Dim,1> { return ((tr.linear() * other) + tr.translation()) * (Scalar(1) / ( (tr.matrix().template block<1,Dim>(Dim,0) * other).coeff(0) + tr.matrix().coeff(Dim,Dim))); } }; - -#endif // EIGEN_TRANSFORM_H diff --git a/Eigen/src/Eigen2Support/Geometry/Translation.h b/Eigen/src/Eigen2Support/Geometry/Translation.h index ca5a9115f..e651e3102 100644 --- a/Eigen/src/Eigen2Support/Geometry/Translation.h +++ b/Eigen/src/Eigen2Support/Geometry/Translation.h @@ -22,8 +22,8 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see <http://www.gnu.org/licenses/>. -#ifndef EIGEN_TRANSLATION_H -#define EIGEN_TRANSLATION_H +// no include guard, we'll include this twice from All.h from Eigen2Support, and it's internal anyway + /** \geometry_module \ingroup Geometry_Module * @@ -194,5 +194,3 @@ Translation<Scalar,Dim>::operator* (const TransformType& t) const res.pretranslate(m_coeffs); return res; } - -#endif // EIGEN_TRANSLATION_H |