diff --git a/Doxyfile b/Doxyfile index c4c5456c6..646fa5867 100644 --- a/Doxyfile +++ b/Doxyfile @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = Eigen -PROJECT_NUMBER = 2.0-alpha1 +PROJECT_NUMBER = 2.0-alpha2 OUTPUT_DIRECTORY = ./ CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index c6a41d551..92d8a1d8d 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Cast.h b/Eigen/src/Core/Cast.h index 83cec459a..73fdbc25a 100644 --- a/Eigen/src/Core/Cast.h +++ b/Eigen/src/Core/Cast.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Coeffs.h b/Eigen/src/Core/Coeffs.h index a902fc9ba..99d789dd9 100644 --- a/Eigen/src/Core/Coeffs.h +++ b/Eigen/src/Core/Coeffs.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Column.h b/Eigen/src/Core/Column.h index 97c3d7415..53af21528 100644 --- a/Eigen/src/Core/Column.h +++ b/Eigen/src/Core/Column.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Conjugate.h b/Eigen/src/Core/Conjugate.h index 620f16234..48423e0b1 100644 --- a/Eigen/src/Core/Conjugate.h +++ b/Eigen/src/Core/Conjugate.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/DiagonalCoeffs.h b/Eigen/src/Core/DiagonalCoeffs.h index 8906d213c..b3bc8c7fe 100644 --- a/Eigen/src/Core/DiagonalCoeffs.h +++ b/Eigen/src/Core/DiagonalCoeffs.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h index ca125d6f3..9ce9871eb 100644 --- a/Eigen/src/Core/DiagonalMatrix.h +++ b/Eigen/src/Core/DiagonalMatrix.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Difference.h b/Eigen/src/Core/Difference.h index 1f666e555..814ab937e 100644 --- a/Eigen/src/Core/Difference.h +++ b/Eigen/src/Core/Difference.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -26,6 +26,19 @@ #ifndef EIGEN_DIFFERENCE_H #define EIGEN_DIFFERENCE_H +/** \class Difference + * + * \brief Expression of the difference (substraction) of two matrices or vectors + * + * \param Lhs the type of the left-hand side + * \param Rhs the type of the right-hand side + * + * This class represents an expression of the difference of two matrices or vectors. + * It is the return type of the operator- between matrices or vectors, and most + * of the time this is the only way it is used. + * + * \sa class Sum, class Opposite + */ template class Difference : NoOperatorEquals, public MatrixBase > { @@ -59,7 +72,12 @@ template class Difference : NoOperatorEquals, const RhsRef m_rhs; }; -/** \relates MatrixBase */ +/** \relates MatrixBase + * + * \returns an expression of the difference of \a mat1 and \a mat2 + * + * \sa class Difference, MatrixBase::operator-=() + */ template const Difference operator-(const MatrixBase &mat1, const MatrixBase &mat2) @@ -67,6 +85,10 @@ operator-(const MatrixBase &mat1, const MatrixBase(mat1.ref(), mat2.ref()); } +/** replaces \c *this by \c *this - \a other. + * + * \returns a reference to \c *this + */ template template Derived & diff --git a/Eigen/src/Core/Dot.h b/Eigen/src/Core/Dot.h index ebea30d6b..3ff416fba 100644 --- a/Eigen/src/Core/Dot.h +++ b/Eigen/src/Core/Dot.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/DynBlock.h b/Eigen/src/Core/DynBlock.h index 1d8951c11..da32bcd28 100644 --- a/Eigen/src/Core/DynBlock.h +++ b/Eigen/src/Core/DynBlock.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Eval.h b/Eigen/src/Core/Eval.h index 039b10b91..7fa661c48 100644 --- a/Eigen/src/Core/Eval.h +++ b/Eigen/src/Core/Eval.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Fuzzy.h b/Eigen/src/Core/Fuzzy.h index 48e4e7b07..261f14b4a 100644 --- a/Eigen/src/Core/Fuzzy.h +++ b/Eigen/src/Core/Fuzzy.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -26,6 +26,22 @@ #ifndef EIGEN_FUZZY_H #define EIGEN_FUZZY_H +/** \returns \c true if \c *this is approximately equal to \a other, within the precision + * determined by \a prec. + * + * \note The fuzzy compares are done multiplicatively. Two vectors \f$ v \f$ and \f$ w \f$ + * are considered to be approximately equal within precision \f$ p \f$ if + * \f[ \Vert v - w \Vert \leqslant p\,\min(\Vert v\Vert, \Vert w\Vert). \f] + * For matrices, the comparison is done on all columns. + * + * \note Because of the multiplicativeness of this comparison, one can't use this function + * to check whether \c *this is approximately equal to the zero matrix or vector. + * Indeed, \c isApprox(zero) returns false unless \c *this itself is exactly the zero matrix + * or vector. If you want to test whether \c *this is zero, use isMuchSmallerThan(const + * RealScalar&, RealScalar) instead. + * + * \sa isMuchSmallerThan(const RealScalar&, RealScalar) const + */ template template bool MatrixBase::isApprox( @@ -48,6 +64,16 @@ bool MatrixBase::isApprox( } } +/** \returns \c true if the norm of \c *this is much smaller than \a other, + * within the precision determined by \a prec. + * + * \note The fuzzy compares are done multiplicatively. A vector \f$ v \f$ is + * considered to be much smaller than \f$ x \f$ within precision \f$ p \f$ if + * \f[ \Vert v \Vert \leqslant p\,\vert x\vert. \f] + * For matrices, the comparison is done on all columns. + * + * \sa isApprox(), isMuchSmallerThan(const MatrixBase&, RealScalar) const + */ template bool MatrixBase::isMuchSmallerThan( const typename NumTraits::Real& other, @@ -67,6 +93,16 @@ bool MatrixBase::isMuchSmallerThan( } } +/** \returns \c true if the norm of \c *this is much smaller than the norm of \a other, + * within the precision determined by \a prec. + * + * \note The fuzzy compares are done multiplicatively. A vector \f$ v \f$ is + * considered to be much smaller than a vector \f$ w \f$ within precision \f$ p \f$ if + * \f[ \Vert v \Vert \leqslant p\,\Vert w\Vert. \f] + * For matrices, the comparison is done on all columns. + * + * \sa isApprox(), isMuchSmallerThan(const RealScalar&, RealScalar) const + */ template template bool MatrixBase::isMuchSmallerThan( diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h index feb2a24a0..ac45d5bc9 100644 --- a/Eigen/src/Core/IO.h +++ b/Eigen/src/Core/IO.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Identity.h b/Eigen/src/Core/Identity.h index 0cf0991ac..bf40acda4 100644 --- a/Eigen/src/Core/Identity.h +++ b/Eigen/src/Core/Identity.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h index 899062cf3..ca16d1a23 100644 --- a/Eigen/src/Core/Map.h +++ b/Eigen/src/Core/Map.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index c4b021baa..3b72a29c0 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 8984f3893..25ef36182 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -87,9 +87,11 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, _Storage typedef MatrixRef Ref; friend class MatrixRef; + /** \returns a const pointer to the data array of this matrix */ const Scalar* data() const { return Storage::m_data; } + /** \returns a pointer to the data array of this matrix */ Scalar* data() { return Storage::m_data; } diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index b23b0ffee..a32568d29 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -33,13 +33,10 @@ * This class is the base that is inherited by all matrix, vector, and expression * types. Most of the Eigen API is contained in this class. * - * This class takes two template parameters: - * - * \a Scalar is the type of the coefficients, e.g. float, double, etc. - * - * \a Derived is the derived type, e.g. a matrix type, or an expression, etc. - * Indeed, a separate MatrixBase type is generated for each derived type - * so one knows from inside MatrixBase, at compile-time, what the derived type is. + * \param Scalar is the type of the coefficients. Recall that Eigen allows + * only the following types for \a Scalar: \c int, \c float, \c double, + * \c std::complex, \c std::complex. + * \param Derived is the derived type, e.g. a matrix type, or an expression, etc. * * When writing a function taking Eigen objects as argument, if you want your function * to take as argument any matrix, vector, or expression, just let it take a @@ -100,8 +97,14 @@ template class MatrixBase typedef typename ForwardDecl::Ref Ref; /** This is the "real scalar" type; if the \a Scalar type is already real numbers - * (e.g. int, float or double) then RealScalar is just the same as \a Scalar. If - * \a Scalar is \a std::complex then RealScalar is \a T. */ + * (e.g. int, float or double) then \a RealScalar is just the same as \a Scalar. If + * \a Scalar is \a std::complex then RealScalar is \a T. + * + * In fact, \a RealScalar is defined as follows: + * \code typedef typename NumTraits::Real RealScalar; \endcode + * + * \sa class NumTraits + */ typedef typename NumTraits::Real RealScalar; /** \returns the number of rows. \sa cols(), Traits::RowsAtCompileTime */ @@ -124,8 +127,9 @@ template class MatrixBase template Derived& operator=(const MatrixBase& other); - // Special case of the above template operator=, in order to prevent the compiler - //from generating a default operator= (issue hit with g++ 4.1) + /** Special case of the template operator=, in order to prevent the compiler + * from generating a default operator= (issue hit with g++ 4.1) + */ Derived& operator=(const MatrixBase& other) { return this->operator=(other); @@ -191,7 +195,7 @@ template class MatrixBase template bool isApprox(const OtherDerived& other, RealScalar prec = precision()) const; - bool isMuchSmallerThan(const typename NumTraits::Real& other, + bool isMuchSmallerThan(const RealScalar& other, RealScalar prec = precision()) const; template bool isMuchSmallerThan(const MatrixBase& other, diff --git a/Eigen/src/Core/MatrixRef.h b/Eigen/src/Core/MatrixRef.h index e2f281fab..0d97f9b4d 100644 --- a/Eigen/src/Core/MatrixRef.h +++ b/Eigen/src/Core/MatrixRef.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/MatrixStorage.h b/Eigen/src/Core/MatrixStorage.h index 112d904b9..ebeaf4922 100644 --- a/Eigen/src/Core/MatrixStorage.h +++ b/Eigen/src/Core/MatrixStorage.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Minor.h b/Eigen/src/Core/Minor.h index c300e35cf..c846e16f2 100644 --- a/Eigen/src/Core/Minor.h +++ b/Eigen/src/Core/Minor.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/NumTraits.h b/Eigen/src/Core/NumTraits.h index d020c60f4..bb6d5de7e 100644 --- a/Eigen/src/Core/NumTraits.h +++ b/Eigen/src/Core/NumTraits.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -26,6 +26,26 @@ #ifndef EIGEN_NUMTRAITS_H #define EIGEN_NUMTRAITS_H +/** \class NumTraits + * + * \brief Holds some data about the various numeric (i.e. scalar) types allowed by Eigen. + * + * \param T the numeric type about which this class provides data. Recall that Eigen allows + * only the following types for \a T: \c int, \c float, \c double, + * \c std::complex, \c std::complex. + * + * The provided data consists of: + * \li A typedef \a Real, giving the "real part" type of \a T. If \a T is already real, + * then \a Real is just a typedef to \a T. If \a T is \c std::complex then \a Real + * is a typedef to \a U. + * \li A typedef \a FloatingPoint, giving the "floating-point type" of \a T. If \a T is + * \c int, then \a FloatingPoint is a typedef to \c double. Otherwise, \a FloatingPoint + * is a typedef to \a T. + * \li A static const bool \a IsComplex. It is equal to \c true if \a T is a \c std::complex + * type, and to false otherwise. + * \li A static const bool \a HasFloatingPoint. It is equal to \c false if \a T is \c int, + * and to \c true otherwise. + */ template struct NumTraits; template<> struct NumTraits diff --git a/Eigen/src/Core/Ones.h b/Eigen/src/Core/Ones.h index 2f2d42417..3bb11423e 100644 --- a/Eigen/src/Core/Ones.h +++ b/Eigen/src/Core/Ones.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/OperatorEquals.h b/Eigen/src/Core/OperatorEquals.h index 7f86cb8f2..4fe3dbe15 100644 --- a/Eigen/src/Core/OperatorEquals.h +++ b/Eigen/src/Core/OperatorEquals.h @@ -2,7 +2,7 @@ // for linear algebra. Eigen itself is part of the KDE project. // // Copyright (C) 2007 Michael Olbrich -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Opposite.h b/Eigen/src/Core/Opposite.h index f1166be16..7f7aabd23 100644 --- a/Eigen/src/Core/Opposite.h +++ b/Eigen/src/Core/Opposite.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -26,6 +26,18 @@ #ifndef EIGEN_OPPOSITE_H #define EIGEN_OPPOSITE_H +/** \class Opposite + * + * \brief Expression of the opposite of a matrix or vector + * + * \param MatrixType the type of which we are taking the opposite + * + * This class represents an expression of the opposite of a matrix or vector. + * It is the return type of the unary operator- for matrices or vectors, and most + * of the time this is the only way it is used. + * + * \sa class Difference + */ template class Opposite : NoOperatorEquals, public MatrixBase > { @@ -53,6 +65,8 @@ template class Opposite : NoOperatorEquals, MatRef m_matrix; }; +/** \returns an expression of the opposite of \c *this + */ template const Opposite MatrixBase::operator-() const diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index e31320208..71e29a088 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -60,6 +60,19 @@ struct ProductUnroller static void run(int, int, const Lhs&, const Rhs&, typename Lhs::Scalar&) {} }; +/** \class Product + * + * \brief Expression of the product of two matrices + * + * \param Lhs the type of the left-hand side + * \param Rhs the type of the right-hand side + * + * This class represents an expression of the product of two matrices. + * It is the return type of MatrixBase::lazyProduct(), which is used internally by + * the operator* between matrices, and most of the time this is the only way it is used. + * + * \sa class Sum, class Difference + */ template class Product : NoOperatorEquals, public MatrixBase > { @@ -106,6 +119,15 @@ template class Product : NoOperatorEquals, const RhsRef m_rhs; }; +/** \returns an expression of the matrix product of \c this and \a other, in this order. + * + * This function is used internally by the operator* between matrices. The difference between + * lazyProduct() and that operator* is that lazyProduct() only constructs and returns an + * expression without actually computing the matrix product, while the operator* between + * matrices immediately evaluates the product and returns the resulting matrix. + * + * \sa class Product + */ template template const Product @@ -116,7 +138,8 @@ MatrixBase::lazyProduct(const MatrixBase /** \relates MatrixBase * - * \returns the matrix product of \a mat1 and \a mat2. + * \returns the matrix product of \a mat1 and \a mat2. More precisely, the return statement is: + * \code return mat1.lazyProduct(mat2).eval(); \endcode * * \note This function causes an immediate evaluation. If you want to perform a matrix product * without immediate evaluation, use MatrixBase::lazyProduct() instead. @@ -124,12 +147,16 @@ MatrixBase::lazyProduct(const MatrixBase * \sa MatrixBase::lazyProduct(), MatrixBase::operator*=(const MatrixBase&) */ template -Eval > +const Eval > operator*(const MatrixBase &mat1, const MatrixBase &mat2) { return mat1.lazyProduct(mat2).eval(); } +/** replaces \c *this by \c *this * \a other. + * + * \returns a reference to \c *this + */ template template Derived & diff --git a/Eigen/src/Core/Random.h b/Eigen/src/Core/Random.h index deb0dbde7..bbc74ec1a 100644 --- a/Eigen/src/Core/Random.h +++ b/Eigen/src/Core/Random.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Row.h b/Eigen/src/Core/Row.h index 1473e0a63..5fcab9e3a 100644 --- a/Eigen/src/Core/Row.h +++ b/Eigen/src/Core/Row.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/ScalarMultiple.h b/Eigen/src/Core/ScalarMultiple.h index 11b074e38..e8261f539 100644 --- a/Eigen/src/Core/ScalarMultiple.h +++ b/Eigen/src/Core/ScalarMultiple.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -26,6 +26,17 @@ #ifndef EIGEN_SCALARMULTIPLE_H #define EIGEN_SCALARMULTIPLE_H +/** \class ScalarMultiple + * + * \brief Expression of the product of a matrix or vector by a scalar + * + * \param FactorTye the type of scalar by which to multiply + * \param MatrixType the type of the matrix or vector to multiply + * + * This class represents an expression of the product of a matrix or vector by a scalar. + * It is the return type of the operator* between a matrix or vector and a scalar, and most + * of the time this is the only way it is used. + */ template class ScalarMultiple : NoOperatorEquals, public MatrixBase > { @@ -56,7 +67,7 @@ template class ScalarMultiple : NoOper }; #define EIGEN_MAKE_SCALAR_OPS(FactorType) \ -/** \relates MatrixBase */ \ +/** \relates MatrixBase \sa class ScalarMultiple */ \ template \ const ScalarMultiple \ operator*(const MatrixBase& matrix, \ @@ -65,7 +76,7 @@ operator*(const MatrixBase& matrix, \ return ScalarMultiple(matrix.ref(), scalar); \ } \ \ -/** \relates MatrixBase */ \ +/** \relates MatrixBase \sa class ScalarMultiple */ \ template \ const ScalarMultiple \ operator*(FactorType scalar, \ @@ -74,7 +85,7 @@ operator*(FactorType scalar, \ return ScalarMultiple(matrix.ref(), scalar); \ } \ \ -/** \relates MatrixBase */ \ +/** \relates MatrixBase \sa class ScalarMultiple */ \ template \ const ScalarMultiple::FloatingPoint, Derived> \ operator/(const MatrixBase& matrix, \ @@ -86,6 +97,7 @@ operator/(const MatrixBase& matrix, \ >(1) / scalar); \ } \ \ +/** \sa class ScalarMultiple */ \ template \ Derived & \ MatrixBase::operator*=(const FactorType &other) \ @@ -93,6 +105,7 @@ MatrixBase::operator*=(const FactorType &other) \ return *this = *this * other; \ } \ \ +/** \sa class ScalarMultiple */ \ template \ Derived & \ MatrixBase::operator/=(const FactorType &other) \ diff --git a/Eigen/src/Core/Sum.h b/Eigen/src/Core/Sum.h index b9b35cdca..93cfc4e4b 100644 --- a/Eigen/src/Core/Sum.h +++ b/Eigen/src/Core/Sum.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -26,6 +26,19 @@ #ifndef EIGEN_SUM_H #define EIGEN_SUM_H +/** \class Sum + * + * \brief Expression of the sum of two matrices or vectors + * + * \param Lhs the type of the left-hand side + * \param Rhs the type of the right-hand side + * + * This class represents an expression of the sum of two matrices or vectors. + * It is the return type of the operator+ between matrices or vectors, and most + * of the time this is the only way it is used. + * + * \sa class Difference + */ template class Sum : NoOperatorEquals, public MatrixBase > { @@ -59,7 +72,12 @@ template class Sum : NoOperatorEquals, const RhsRef m_rhs; }; -/** \relates MatrixBase */ +/** \relates MatrixBase + * + * \returns an expression of the sum of \a mat1 and \a mat2 + * + * \sa class Sum, MatrixBase::operator+=() + */ template const Sum operator+(const MatrixBase &mat1, const MatrixBase &mat2) @@ -67,6 +85,10 @@ operator+(const MatrixBase &mat1, const MatrixBase(mat1.ref(), mat2.ref()); } +/** replaces \c *this by \c *this + \a other. + * + * \returns a reference to \c *this + */ template template Derived & diff --git a/Eigen/src/Core/Trace.h b/Eigen/src/Core/Trace.h index 24a31a2f8..e87ffeccf 100644 --- a/Eigen/src/Core/Trace.h +++ b/Eigen/src/Core/Trace.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h index 274a159e5..fbb37bc60 100644 --- a/Eigen/src/Core/Transpose.h +++ b/Eigen/src/Core/Transpose.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Util.h b/Eigen/src/Core/Util.h index 0522c3fbf..288d9999d 100644 --- a/Eigen/src/Core/Util.h +++ b/Eigen/src/Core/Util.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Eigen/src/Core/Zero.h b/Eigen/src/Core/Zero.h index 853171c0c..76c13b4e4 100644 --- a/Eigen/src/Core/Zero.h +++ b/Eigen/src/Core/Zero.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/Mainpage.dox b/Mainpage.dox index 12aea6202..52052a9d9 100644 --- a/Mainpage.dox +++ b/Mainpage.dox @@ -13,4 +13,7 @@ In order to generate the documentation of Eigen, please follow these steps: After doing that, you will find the HTML documentation in the doc/html/ subdirectory of the build directory. +

Note however that the documentation is available online here: +http://eigen.tuxfamily.org/2 + */ diff --git a/TODO b/TODO new file mode 100644 index 000000000..3736c24ba --- /dev/null +++ b/TODO @@ -0,0 +1,78 @@ +Things that need to be done for 2.0: + +The Core modules is essentially ready. Now we need more modules: +- QR decomposition + -> ANY VOLUNTEER? I can provide a scanned copy of Golub&vanLoan. + -> investigate various algorithms, balance numerical stability vs. speed, + maybe go for a different algos for fixed-size (small) vs. dynamic-size + (typically bigger). + -> applications: eigenvalues, eigenspaces, operator norm... + -> more applications: by computing eigenvalues of a companion matrix, + we can provide a general polynomial solver. I can explain that to + a potential volunteer... also this is optional. + +- SVD decomposition + -> ANY VOLUNTEER? + -> Same remarks as for QR. + -> applications include pseudo-inverse and linear regression (in Eigen1 we + did linear regression with LU but that was not very good). + +- Array + -> ANY VOLUNTEER? + -> We should group in this module all the functionality that consists in + abusing a matrix as an array. Many people have asked for such + functionality: + -> coefficient-wise product (a.k.a. "Schur product" of matrices). + This should return a new expression. Look at Core/Sum.h for a starting + point. + -> Apply some function (such as "exp") to every coefficient of a matrix. + This should return a new expression. Look at Core/Conjugate.h for a + starting point. + -> stack matrices horizontally and vertically to form larger matrix + expressions. Look at Core/Block.h, Core/Minor.h for a starting point. + -> sum over the elements of a vector (look at Core/Trace.h to get + a starting point). + -> Given a matrix, return a vector whose i-th coefficient is the sum + of the coefficients in the i-th column of that matrix. Same for rows. + -> This should return an actual vector (i.e. evaluate immediately), + not an expression, because a loop is involved. + -> Yes, this can be done as "matrix * VectorType::ones()" but we + should implement it separately so as to not be too hard on the + compiler. + +- Gaussian elimination + -> LEAVE IT TO ME as I did something similar in Eigen1. + -> I don't call this module LU because I want to code certain operations + such as inverse in an optimized way that bypasses the LU decomposition. + But yes, LU is one of the things that will be provided by this module. + -> Other things to do here: determinant, basis of kernel, basis of range, + antecedent etc... + -> Should be do a "simple linear solver" like in eigen1? Did anybody + use it? + -> linear regression should use SVD instead. However as a temporary + solution we could borrow the implementation from eigen1, using gaussian + elimination. + +- Geometry + -> LEAVE IT TO ME as I did something similar in Eigen1. + ->low-dimensional geometry (quaternions, cross product, rotations) + ->projective geometry(opengl matrices, Qt matrices) + ->euclidean geometry (Gram-Schmidt) + +- Sparse objects support, by wrapping GMM++ + -> ANY VOLUNTEER? I'm looking at the folks already used to GMM++. I will + provide support but am not used to GMM++ so wouldn't like to have to do + all that alone. + -> Goal: provide a nice wrapper around GMM++ with Qt-style copy-on-write + (I can code the copy-on-write part if you don't want to do it) + -> Very important for Krita 2.1 and Step + -> No expression templates here. So the API won't be quite identical to the + rest of Eigen. Should be release under a different name? "Speisen" comes + to mind ;) + -> No need to wrap all of GMM++. Only sparse objects. Only what's useful + for KOffice 2.1 and Step (if you want more, do it). + -> Step uses: + -gmm::cg, constrained_cg + -dantzig algorithm + -types: gmm::row_matrix, col_matrix, rsvector, array1D_reference + -> What is needed for Krita? diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index dd1e57297..fc699b0d0 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = Eigen -PROJECT_NUMBER = 2.0-alpha1 +PROJECT_NUMBER = 2.0-alpha2 OUTPUT_DIRECTORY = ${CMAKE_BINARY_DIR}/doc CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English @@ -152,7 +152,7 @@ LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide -EXTRA_PACKAGES = +EXTRA_PACKAGES = amssymb LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO diff --git a/doc/Mainpage.dox b/doc/Mainpage.dox index 591754bba..e6f5e60a6 100644 --- a/doc/Mainpage.dox +++ b/doc/Mainpage.dox @@ -4,6 +4,7 @@ o /** @mainpage Eigen Overview
License
Features
+Compiler Support
News
Download
Relation to KDE
@@ -33,11 +34,25 @@ This is similar to the LGPL in spirit. The reason why we don't use the LGPL is t WARNING: this alpha release is NOT feature complete -- far from it! It contains only the Core module, while several other modules are planned. +Here are general features of Eigen and more specific features of the Core module: +
    -
  • Add items
  • -
  • Add more items
  • +
  • Expression templates everywhere. This is an optimization (elimination of temporaries, lazy evaluation), but more importantly this allows for a much nicer API, especially as Eigen supports lvalue expressions. For example, the following is valid with Eigen and compiles to optimized code: + \code matrix.row(i) += factor * matrix.row(j); \endcode
  • +
  • Both fixed-size and dynamic-size objects are supported, in a way that allows Eigen to make + all usual optimizations in the case of fixed size, such as loop unrolling.
  • +
  • Both column-vectors and row-vectors are supported, as special cases of matrices.
  • +
  • The following scalar types are supported and well tested: \c int, \c float, \c double, + \c std::complex, \c std::complex.
+ +

Compiler Support

+ +Eigen is well tested with recent versions of GCC and gives very good performance with GCC 4.2. For some reason the performance is not so great with GCC 4.1. + +Eigen is also well tested on ICC, and gives even better performance with it than with GCC 4.2. +

News

@@ -45,7 +60,7 @@ If you want to stay informed of Eigen news and releases, please subscribe to our

Download

-The source code of the latest release is here: eigen-2.0-alpha1.tar.gz
+The source code of the latest release is here: eigen-2.0-alpha2.tar.gz
Alternatively, you can checkout the development tree by anonymous svn, by doing:
svn co svn://anonsvn.kde.org/home/kde/branches/work/eigen2
@@ -70,24 +85,29 @@ Although Eigen itself doesn't have any dependency, the unit-tests require Qt.

Examples

-TODO: write more examples, update this section. +There are a lot of small examples throughout the documentation. TODO: write more interesting, +standalone "demos".

Applications using Eigen

-TODO: update this section +TODO: update this section; make web links + +Currently: Kalzium, Avogadro, KSpread(a bit), Krita(a bit) +Planned: much more use in KOffice 2.1, Step (if we make Eigen good enough!) Please tell us if you know of other interesting projects using Eigen!

Authors

-Lead Developer: Benoit Jacob (jacob at math jussieu fr) +Main Developer: Benoit Jacob (jacob at math jussieu fr) Contributors during the Eigen 2 development process:
    -
  • Michael Olbrich (michael olbrich at gmx net) : initial loop-unrolling metaprogram
  • +
  • Gael Guennebaud (gael guennebaud at gmail com) : Intel compiler (ICC) support
  • Christian Mayer (mail at christianmayer de) : reviewed the source code, made many useful suggestions
  • +
  • Michael Olbrich (michael olbrich at gmx net) : initial loop-unrolling metaprogram
  • and thanks to everyone on the mailing list for your input!
diff --git a/doc/snippets/MatrixBase_identity_int.cpp b/doc/snippets/MatrixBase_identity_int.cpp new file mode 100644 index 000000000..8cf39d93d --- /dev/null +++ b/doc/snippets/MatrixBase_identity_int.cpp @@ -0,0 +1,2 @@ +cout << Matrix2d::identity() << endl; +cout << MatrixXd::identity(3) << endl; diff --git a/test/adjoint.cpp b/test/adjoint.cpp index 690f0424a..4b6b692e4 100644 --- a/test/adjoint.cpp +++ b/test/adjoint.cpp @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index 2c2a945c3..d5732dde7 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/test/linearstructure.cpp b/test/linearstructure.cpp index 32199c5e0..c90488dd0 100644 --- a/test/linearstructure.cpp +++ b/test/linearstructure.cpp @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/test/main.cpp b/test/main.cpp index 91f83e396..67f7062dc 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/test/main.h b/test/main.h index 460000511..d914a14f5 100644 --- a/test/main.h +++ b/test/main.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/test/map.cpp b/test/map.cpp index fece15853..4f28a8513 100644 --- a/test/map.cpp +++ b/test/map.cpp @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/test/miscmatrices.cpp b/test/miscmatrices.cpp index e0aa13270..57d6f94eb 100644 --- a/test/miscmatrices.cpp +++ b/test/miscmatrices.cpp @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/test/product.cpp b/test/product.cpp index e56d6aee9..449c0f3f7 100644 --- a/test/product.cpp +++ b/test/product.cpp @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/test/smallvectors.cpp b/test/smallvectors.cpp index e05937e2f..3496733e2 100644 --- a/test/smallvectors.cpp +++ b/test/smallvectors.cpp @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software diff --git a/test/submatrices.cpp b/test/submatrices.cpp index e263bfb6a..9981d9f83 100644 --- a/test/submatrices.cpp +++ b/test/submatrices.cpp @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2006-2007 Benoit Jacob +// Copyright (C) 2006-2008 Benoit Jacob // // Eigen is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software