diff --git a/CMakeLists.txt b/CMakeLists.txt index cc78d5a46..38a7fceab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) OPTION(BUILD_TESTS "Build tests" OFF) -OPTION(BUILD_DOC "Build documentation and examples" OFF) OPTION(BUILD_DEMOS "Build demos" OFF) OPTION(BUILD_LIB "Build the binary shared library" OFF) OPTION(BUILD_BTL "Build benchmark suite" OFF) diff --git a/Eigen/Core b/Eigen/Core index 9e753a517..b1b61ebc2 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -9,8 +9,9 @@ namespace Eigen { /** \defgroup Core_Module Core module - * This is the main module of Eigen providing dense matrix and vector support with - * features equivalent to a BLAS library and much more... + * This is the main module of Eigen providing dense matrix and vector support + * (both fixed and dynamic size) with all the features corresponding to a BLAS library + * and much more... * * \code * #include diff --git a/Eigen/Geometry b/Eigen/Geometry index b5a80bd50..61b7d7038 100644 --- a/Eigen/Geometry +++ b/Eigen/Geometry @@ -9,7 +9,7 @@ namespace Eigen { -/** \defgroup Geometry Geometry module +/** \defgroup GeometryModule Geometry module * This module provides support for: * - fixed-size homogeneous transformations * - 2D and 3D rotations diff --git a/Eigen/src/Core/Assign.h b/Eigen/src/Core/Assign.h index 7bdf312c2..758858165 100644 --- a/Eigen/src/Core/Assign.h +++ b/Eigen/src/Core/Assign.h @@ -299,58 +299,28 @@ struct ei_assign_impl *** Linear vectorization *** ***************************/ -// template -// struct ei_assign_impl -// { -// static void run(Derived1 &dst, const Derived2 &src) -// { -// const int size = dst.size(); -// const int packetSize = ei_packet_traits::size; -// const int alignedStart = ei_assign_traits::DstIsAligned ? 0 -// : ei_alignmentOffset(&dst.coeffRef(0), size); -// const int alignedEnd = alignedStart + ((size-alignedStart)/packetSize)*packetSize; -// -// for(int index = 0; index < alignedStart; index++) -// dst.copyCoeff(index, src); -// -// for(int index = alignedStart; index < alignedEnd; index += packetSize) -// { -// dst.template copyPacket::SrcAlignment>(index, src); -// } -// -// for(int index = alignedEnd; index < size; index++) -// dst.copyCoeff(index, src); -// } -// }; template struct ei_assign_impl { - static void run(Derived1 &dst, const Derived2 &src) - { - asm("#begin"); - const int size = dst.size(); - const int packetSize = ei_packet_traits::size; - const int alignedStart = ei_assign_traits::DstIsAligned ? 0 - : ei_alignmentOffset(&dst.coeffRef(0), size); - const int alignedEnd = alignedStart + ((size-alignedStart)/packetSize)*packetSize; + static void run(Derived1 &dst, const Derived2 &src) + { + const int size = dst.size(); + const int packetSize = ei_packet_traits::size; + const int alignedStart = ei_assign_traits::DstIsAligned ? 0 + : ei_alignmentOffset(&dst.coeffRef(0), size); + const int alignedEnd = alignedStart + ((size-alignedStart)/packetSize)*packetSize; - asm("#unaligned start"); + for(int index = 0; index < alignedStart; index++) + dst.copyCoeff(index, src); - for(int index = 0; index < alignedStart; index++) - dst.copyCoeff(index, src); - asm("#aligned middle"); + for(int index = alignedStart; index < alignedEnd; index += packetSize) + { + dst.template copyPacket::SrcAlignment>(index, src); + } - for(int index = alignedStart; index < alignedEnd; index += packetSize) - { - dst.template copyPacket::SrcAlignment>(index, src); - } - - asm("#unaligned end"); - - for(int index = alignedEnd; index < size; index++) - dst.copyCoeff(index, src); - asm("#end"); - } + for(int index = alignedEnd; index < size; index++) + dst.copyCoeff(index, src); + } }; template diff --git a/Eigen/src/Geometry/AngleAxis.h b/Eigen/src/Geometry/AngleAxis.h index 503a3d160..502cbd0ec 100644 --- a/Eigen/src/Geometry/AngleAxis.h +++ b/Eigen/src/Geometry/AngleAxis.h @@ -25,7 +25,7 @@ #ifndef EIGEN_ANGLEAXIS_H #define EIGEN_ANGLEAXIS_H -/** \geometry_module \ingroup Geometry +/** \geometry_module \ingroup GeometryModule * * \class AngleAxis * @@ -122,10 +122,10 @@ public: Matrix3 toRotationMatrix(void) const; }; -/** \ingroup Geometry +/** \ingroup GeometryModule * single precision angle-axis type */ typedef AngleAxis AngleAxisf; -/** \ingroup Geometry +/** \ingroup GeometryModule * double precision angle-axis type */ typedef AngleAxis AngleAxisd; diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h index 56cb87493..a0d32bec8 100644 --- a/Eigen/src/Geometry/Quaternion.h +++ b/Eigen/src/Geometry/Quaternion.h @@ -30,7 +30,7 @@ template struct ei_quaternion_assign_impl; -/** \geometry_module \ingroup Geometry +/** \geometry_module \ingroup GeometryModule * * \class Quaternion * @@ -169,10 +169,10 @@ public: }; -/** \ingroup Geometry +/** \ingroup GeometryModule * single precision quaternion type */ typedef Quaternion Quaternionf; -/** \ingroup Geometry +/** \ingroup GeometryModule * double precision quaternion type */ typedef Quaternion Quaterniond; diff --git a/Eigen/src/Geometry/Rotation.h b/Eigen/src/Geometry/Rotation.h index 47a10938e..a0421b211 100644 --- a/Eigen/src/Geometry/Rotation.h +++ b/Eigen/src/Geometry/Rotation.h @@ -103,7 +103,7 @@ struct ToRotationMatrix > } }; -/** \geometry_module \ingroup Geometry +/** \geometry_module \ingroup GeometryModule * * \class Rotation2D * @@ -114,7 +114,7 @@ struct ToRotationMatrix > * This class is equivalent to a single scalar representing a counter clock wise rotation * as a single angle in radian. It provides some additional features such as the automatic * conversion from/to a 2x2 rotation matrix. Moreover this class aims to provide a similar - * interface to Quaternion in order to facilitate the writing of generic algorithm + * interface to Quaternion in order to facilitate the writing of generic algorithms * dealing with rotations. * * \sa class Quaternion, class Transform diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index 4645083b3..9caaa2418 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -35,7 +35,7 @@ template< typename Other, int OtherCols=Other::ColsAtCompileTime> struct ei_transform_product_impl; -/** \geometry_module \ingroup Geometry +/** \geometry_module \ingroup GeometryModule * * \class Transform * @@ -202,13 +202,13 @@ protected: }; -/** \ingroup Geometry */ +/** \ingroup GeometryModule */ typedef Transform Transform2f; -/** \ingroup Geometry */ +/** \ingroup GeometryModule */ typedef Transform Transform3f; -/** \ingroup Geometry */ +/** \ingroup GeometryModule */ typedef Transform Transform2d; -/** \ingroup Geometry */ +/** \ingroup GeometryModule */ typedef Transform Transform3d; #ifdef EIGEN_QT_SUPPORT diff --git a/Mainpage.dox b/Mainpage.dox index e4789af1d..eee01f8c4 100644 --- a/Mainpage.dox +++ b/Mainpage.dox @@ -7,8 +7,8 @@ In order to generate the documentation of Eigen, please follow these steps:
  • make sure you have the required software installed: cmake, doxygen, and a C++ compiler.
  • create a new directory, which we will call the "build directory", outside of the Eigen source directory.
  • enter the build directory
  • -
  • configure the project:
    cmake -DBUILD_DOC=ON /path/to/source/directory
  • -
  • now generate the documentaion:
    make
    or, if you have two CPUs,
    make -j2
    Note that this will compile the examples, run them, and integrate their output into the documentation, which can take some time.
  • +
  • configure the project:
    cmake /path/to/source/directory
  • +
  • now generate the documentaion:
    make doc
    or, if you have two CPUs,
    make doc -j2
    Note that this will compile the examples, run them, and integrate their output into the documentation, which can take some time.
  • After doing that, you will find the HTML documentation in the doc/html/ subdirectory of the build directory. diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 4a0ff6fa5..36d65efbb 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,4 +1,5 @@ -IF(BUILD_DOC) + +SET_DIRECTORY_PROPERTIES(PROPERTIES EXCLUDE_FROM_ALL TRUE) IF(CMAKE_COMPILER_IS_GNUCXX) IF(CMAKE_SYSTEM_NAME MATCHES Linux) @@ -28,7 +29,7 @@ ADD_SUBDIRECTORY(examples) ADD_SUBDIRECTORY(snippets) ADD_CUSTOM_TARGET( - run_doxygen + doc ALL COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/eigendoxy_tabs.css ${CMAKE_CURRENT_BINARY_DIR}/html/ @@ -39,6 +40,4 @@ ADD_CUSTOM_TARGET( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -ADD_DEPENDENCIES(run_doxygen all_snippets all_examples) - -ENDIF(BUILD_DOC) +ADD_DEPENDENCIES(doc all_snippets all_examples) diff --git a/doc/QuickStartGuide.dox b/doc/QuickStartGuide.dox index 50abf8b4d..004156873 100644 --- a/doc/QuickStartGuide.dox +++ b/doc/QuickStartGuide.dox @@ -492,17 +492,88 @@ forces immediate evaluation of the transpose | \ref TutorialAdvancedLinearAlgebra "Advanced linear algebra" +In this tutorial chapter we will shortly introduce the many possibilities offered by the \ref GeometryModule "geometry module", +namely 2D and 3D rotations and affine transformations. + \b Table \b of \b contents - \ref TutorialGeoRotations - \ref TutorialGeoTransformation top\section TutorialGeoRotations 2D and 3D Rotations -todo +\subsection TutorialGeoRotationTypes Rotation types -top\section TutorialGeoTransformation 2D and 3D Transformations -todo + + + + + + + +
    Rotation typeTypical initialization codeRecommended usage
    2D rotation from an angle\code +Rotation2D rot2(angle_in_radian);\endcode
    2D rotation matrix\code +Matrix2f rotmat2 = Rotation2Df(angle_in_radian);\endcode
    3D rotation as an angle + axis\code +AngleAxis aa(angle_in_radian, Vector3f(ax,ay,az));\endcode
    3D rotation as a quaternion\code +Quaternion q = AngleAxis(angle_in_radian, axis);\endcode
    3D rotation matrix\code +Matrix3f rotmat3 = AngleAxis(angle_in_radian, axis);\endcode
    + +To transform more than a single vector the prefered representations are rotation matrices, +for other usage Rotation2D and Quaternion are the representations of choice as they are +more compact, fast and stable. AngleAxis are only useful to create other rotation objects. + +\subsection TutorialGeoCommonRotationAPI Common API of rotation types + +To some extent, Eigen's \ref Geometry_Module "geometry module" allows you to write +generic algorithms working on both 2D and 3D rotations of any of the five above types. +The following operation are supported: + + + + + + +
    Convertion from and to any types (of same space dimension)\code +RotType2 a = RotType1();\endcode
    Concatenation of two rotations\code +rot3 = rot1 * rot2;\endcode
    Apply the rotation to a vector\code +vec2 = rot1 * vec1;\endcode
    Get the inverse rotation \n (not always the most effient choice)\code +rot2 = rot1.inverse();\endcode
    Spherical interpolation \n (Rotation2D and Quaternion only)\code +rot3 = rot1.slerp(alpha,rot2);\endcode
    + +\subsection TutorialGeoEulerAngles Euler angles + + +
    +Euler angles might be convenient to create rotation object. +Since there exist 24 differents convensions, they are one +the ahand pretty confusing to use. This example shows how +to create a rotation matrix according to the 2-1-2 convention.\code +Matrix3f m; +m = AngleAxisf(angle1, Vector3f::UnitZ()) + * AngleAxisf(angle2, Vector3f::UnitY()) + * AngleAxisf(angle3, Vector3f::UnitZ()); +\endcode
    + +top\section TutorialGeoTransformation Affine transformations +In Eigen we have chosen to not distinghish between points and vectors such that all points are +actually represented by displacement vector from the origine (pt \~ pt-0). With that in mind, +real points and vector distinguish when the rotation is applied. + + + + + + +
    Creation\code +Transform3f t; +t.setFrom \endcode
    Apply the transformation to a \b point \code +Vector3f p1, p2; +p2 = t * p1;\endcode
    Apply the transformation to a \b vector \code +Vector3f v1, v2; +v2 = t.linear() * v1;\endcode
    Concatenate two transformations\code +t3 = t1 * t2;\endcode
    OpenGL compatibility\code +glLoadMatrixf(t.data());\endcode
    + */ @@ -519,6 +590,8 @@ todo | \b Advanced \b linear \b algebra + + \b Table \b of \b contents - \ref TutorialAdvLinearSolvers - \ref TutorialAdvLU