From a4487ef19820754429bf9a76bbe567a8c7588f32 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 5 Feb 2009 21:19:40 +0000 Subject: [PATCH] add snippet for sub/super diagonal fix a few doc issues --- Eigen/src/Core/Cwise.h | 2 +- Eigen/src/Core/DiagonalCoeffs.h | 11 +++++++---- Eigen/src/Core/MatrixBase.h | 2 +- doc/C03_TutorialGeometry.dox | 4 ++-- doc/snippets/MatrixBase_diagonal_int.cpp | 5 +++++ unsupported/Eigen/AdolcForward | 10 ---------- 6 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 doc/snippets/MatrixBase_diagonal_int.cpp diff --git a/Eigen/src/Core/Cwise.h b/Eigen/src/Core/Cwise.h index 0e92dce4e..721916c8b 100644 --- a/Eigen/src/Core/Cwise.h +++ b/Eigen/src/Core/Cwise.h @@ -64,7 +64,7 @@ * It is the return type of MatrixBase::cwise() * and most of the time this is the only way it is used. * - * Note that some methods are defined in the \ref Array module. + * Note that some methods are defined in the \ref Array_Module array module. * * Example: \include MatrixBase_cwise_const.cpp * Output: \verbinclude MatrixBase_cwise_const.out diff --git a/Eigen/src/Core/DiagonalCoeffs.h b/Eigen/src/Core/DiagonalCoeffs.h index 665337a4b..ba5c0da62 100644 --- a/Eigen/src/Core/DiagonalCoeffs.h +++ b/Eigen/src/Core/DiagonalCoeffs.h @@ -49,12 +49,12 @@ struct ei_traits > enum { AbsDiagId = DiagId<0 ? -DiagId : DiagId, RowsAtCompileTime = int(MatrixType::SizeAtCompileTime) == Dynamic ? Dynamic - : EIGEN_ENUM_MIN(MatrixType::RowsAtCompileTime, - MatrixType::ColsAtCompileTime) - AbsDiagId, + : (EIGEN_ENUM_MIN(MatrixType::RowsAtCompileTime, + MatrixType::ColsAtCompileTime) - AbsDiagId), ColsAtCompileTime = 1, MaxRowsAtCompileTime = int(MatrixType::MaxSizeAtCompileTime) == Dynamic ? Dynamic - : EIGEN_ENUM_MIN(MatrixType::MaxRowsAtCompileTime, - MatrixType::MaxColsAtCompileTime), + : (EIGEN_ENUM_MIN(MatrixType::MaxRowsAtCompileTime, + MatrixType::MaxColsAtCompileTime) - AbsDiagId), MaxColsAtCompileTime = 1, Flags = (unsigned int)_MatrixTypeNested::Flags & (HereditaryBits | LinearAccessBit), CoeffReadCost = _MatrixTypeNested::CoeffReadCost @@ -135,6 +135,9 @@ MatrixBase::diagonal() const * The template parameter \a Id represent a super diagonal if \a Id > 0 * and a sub diagonal otherwise. \a Id == 0 is equivalent to the main diagonal. * + * Example: \include MatrixBase_diagonal_int.cpp + * Output: \verbinclude MatrixBase_diagonal_int.out + * * \sa MatrixBase::diagonal(), class DiagonalCoeffs */ template template diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index 5abf35f5f..f9c564ab3 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -34,7 +34,7 @@ * types. Most of the Eigen API is contained in this class. Other important classes for * the Eigen API are Matrix, Cwise, and PartialRedux. * - * Note that some methods are defined in the \ref Array module. + * Note that some methods are defined in the \ref Array_Module array module. * * \param Derived is the derived type, e.g. a matrix type, or an expression, etc. * diff --git a/doc/C03_TutorialGeometry.dox b/doc/C03_TutorialGeometry.dox index b3c860d53..2d3d742c9 100644 --- a/doc/C03_TutorialGeometry.dox +++ b/doc/C03_TutorialGeometry.dox @@ -10,7 +10,7 @@ namespace Eigen { | \ref TutorialSparse "Sparse matrix" -In this tutorial chapter we will shortly introduce the many possibilities offered by the \ref GeometryModule "geometry module", +In this tutorial chapter we will shortly introduce the many possibilities offered by the \ref Geometry_Module "geometry module", namely 2D and 3D rotations and affine transformations. \b Table \b of \b contents @@ -106,7 +106,7 @@ Transform3f m = Translation3f(..); Transform3f m = Matrix3f(..); top\section TutorialGeoCommontransformationAPI Common API across transformation types -To some extent, Eigen's \ref GeometryModule "geometry module" allows you to write +To some extent, Eigen's \ref Geometry_Module "geometry module" allows you to write generic algorithms working on any kind of transformation representations:
diff --git a/doc/snippets/MatrixBase_diagonal_int.cpp b/doc/snippets/MatrixBase_diagonal_int.cpp new file mode 100644 index 000000000..0e73d1c16 --- /dev/null +++ b/doc/snippets/MatrixBase_diagonal_int.cpp @@ -0,0 +1,5 @@ +Matrix4i m = Matrix4i::Random(); +cout << "Here is the matrix m:" << endl << m << endl; +cout << "Here are the coefficients on the 1st super-diagonal and 2nd sub-diagonal of m:" << endl + << m.diagonal<1>().transpose() << endl + << m.diagonal<-2>().transpose() << endl; diff --git a/unsupported/Eigen/AdolcForward b/unsupported/Eigen/AdolcForward index 310aa056b..1845cb917 100644 --- a/unsupported/Eigen/AdolcForward +++ b/unsupported/Eigen/AdolcForward @@ -79,16 +79,6 @@ namespace unsupported { */ //@{ - /** \class Foo - * \brief a foo class - */ - class Foo : public MatrixBase { - public: - /** a member - * \see MatrixBase::sum() */ - void member() {} - }; - } // namespace unsupported } // namespace Eigen