diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-01-07 09:34:21 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-01-07 09:34:21 +0000 |
commit | 8ba30554473ebcf3ac1c5a5e8b2139af0d730046 (patch) | |
tree | fb9dd10f5b7afb45217d15bb990750ad4f848a72 /Eigen | |
parent | 5111ace0d6ad7ceb505efbf7c591c23e8087ffa9 (diff) |
Ready for alpha2 release.
- complete documentation
- add TODO
- update copyright years
Diffstat (limited to 'Eigen')
34 files changed, 213 insertions, 53 deletions
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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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<typename Lhs, typename Rhs> class Difference : NoOperatorEquals, public MatrixBase<typename Lhs::Scalar, Difference<Lhs, Rhs> > { @@ -59,7 +72,12 @@ template<typename Lhs, typename Rhs> 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<typename Scalar, typename Derived1, typename Derived2> const Difference<Derived1, Derived2> operator-(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Derived2> &mat2) @@ -67,6 +85,10 @@ operator-(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Der return Difference<Derived1, Derived2>(mat1.ref(), mat2.ref()); } +/** replaces \c *this by \c *this - \a other. + * + * \returns a reference to \c *this + */ template<typename Scalar, typename Derived> template<typename OtherDerived> 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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<typename Scalar, typename Derived> template<typename OtherDerived> bool MatrixBase<Scalar, Derived>::isApprox( @@ -48,6 +64,16 @@ bool MatrixBase<Scalar, Derived>::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<Scalar, OtherDerived>&, RealScalar) const + */ template<typename Scalar, typename Derived> bool MatrixBase<Scalar, Derived>::isMuchSmallerThan( const typename NumTraits<Scalar>::Real& other, @@ -67,6 +93,16 @@ bool MatrixBase<Scalar, Derived>::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<typename Scalar, typename Derived> template<typename OtherDerived> bool MatrixBase<Scalar, Derived>::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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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<Matrix> Ref; friend class MatrixRef<Matrix>; + /** \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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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<float>, \c std::complex<double>. + * \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<typename Scalar, typename Derived> class MatrixBase typedef typename ForwardDecl<Derived>::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<T> 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<T> then RealScalar is \a T. + * + * In fact, \a RealScalar is defined as follows: + * \code typedef typename NumTraits<Scalar>::Real RealScalar; \endcode + * + * \sa class NumTraits + */ typedef typename NumTraits<Scalar>::Real RealScalar; /** \returns the number of rows. \sa cols(), Traits::RowsAtCompileTime */ @@ -124,8 +127,9 @@ template<typename Scalar, typename Derived> class MatrixBase template<typename OtherDerived> Derived& operator=(const MatrixBase<Scalar, OtherDerived>& 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=<Derived>(other); @@ -191,7 +195,7 @@ template<typename Scalar, typename Derived> class MatrixBase template<typename OtherDerived> bool isApprox(const OtherDerived& other, RealScalar prec = precision<Scalar>()) const; - bool isMuchSmallerThan(const typename NumTraits<Scalar>::Real& other, + bool isMuchSmallerThan(const RealScalar& other, RealScalar prec = precision<Scalar>()) const; template<typename OtherDerived> bool isMuchSmallerThan(const MatrixBase<Scalar, OtherDerived>& 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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<float>, \c std::complex<double>. + * + * 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<U> 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<typename T> struct NumTraits; template<> struct NumTraits<int> 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <michael.olbrich@gmx.net> -// Copyright (C) 2006-2007 Benoit Jacob <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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<typename MatrixType> class Opposite : NoOperatorEquals, public MatrixBase<typename MatrixType::Scalar, Opposite<MatrixType> > { @@ -53,6 +65,8 @@ template<typename MatrixType> class Opposite : NoOperatorEquals, MatRef m_matrix; }; +/** \returns an expression of the opposite of \c *this + */ template<typename Scalar, typename Derived> const Opposite<Derived> MatrixBase<Scalar, Derived>::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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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<Index, 0, Lhs, Rhs> 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<typename Lhs, typename Rhs> class Product : NoOperatorEquals, public MatrixBase<typename Lhs::Scalar, Product<Lhs, Rhs> > { @@ -106,6 +119,15 @@ template<typename Lhs, typename Rhs> 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<typename Scalar, typename Derived> template<typename OtherDerived> const Product<Derived, OtherDerived> @@ -116,7 +138,8 @@ MatrixBase<Scalar, Derived>::lazyProduct(const MatrixBase<Scalar, OtherDerived> /** \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<Scalar, Derived>::lazyProduct(const MatrixBase<Scalar, OtherDerived> * \sa MatrixBase::lazyProduct(), MatrixBase::operator*=(const MatrixBase&) */ template<typename Scalar, typename Derived1, typename Derived2> -Eval<Product<Derived1, Derived2> > +const Eval<Product<Derived1, Derived2> > operator*(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Derived2> &mat2) { return mat1.lazyProduct(mat2).eval(); } +/** replaces \c *this by \c *this * \a other. + * + * \returns a reference to \c *this + */ template<typename Scalar, typename Derived> template<typename OtherDerived> 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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<typename FactorType, typename MatrixType> class ScalarMultiple : NoOperatorEquals, public MatrixBase<typename MatrixType::Scalar, ScalarMultiple<FactorType, MatrixType> > { @@ -56,7 +67,7 @@ template<typename FactorType, typename MatrixType> class ScalarMultiple : NoOper }; #define EIGEN_MAKE_SCALAR_OPS(FactorType) \ -/** \relates MatrixBase */ \ +/** \relates MatrixBase \sa class ScalarMultiple */ \ template<typename Scalar, typename Derived> \ const ScalarMultiple<FactorType, Derived> \ operator*(const MatrixBase<Scalar, Derived>& matrix, \ @@ -65,7 +76,7 @@ operator*(const MatrixBase<Scalar, Derived>& matrix, \ return ScalarMultiple<FactorType, Derived>(matrix.ref(), scalar); \ } \ \ -/** \relates MatrixBase */ \ +/** \relates MatrixBase \sa class ScalarMultiple */ \ template<typename Scalar, typename Derived> \ const ScalarMultiple<FactorType, Derived> \ operator*(FactorType scalar, \ @@ -74,7 +85,7 @@ operator*(FactorType scalar, \ return ScalarMultiple<FactorType, Derived>(matrix.ref(), scalar); \ } \ \ -/** \relates MatrixBase */ \ +/** \relates MatrixBase \sa class ScalarMultiple */ \ template<typename Scalar, typename Derived> \ const ScalarMultiple<typename NumTraits<FactorType>::FloatingPoint, Derived> \ operator/(const MatrixBase<Scalar, Derived>& matrix, \ @@ -86,6 +97,7 @@ operator/(const MatrixBase<Scalar, Derived>& matrix, \ >(1) / scalar); \ } \ \ +/** \sa class ScalarMultiple */ \ template<typename Scalar, typename Derived> \ Derived & \ MatrixBase<Scalar, Derived>::operator*=(const FactorType &other) \ @@ -93,6 +105,7 @@ MatrixBase<Scalar, Derived>::operator*=(const FactorType &other) \ return *this = *this * other; \ } \ \ +/** \sa class ScalarMultiple */ \ template<typename Scalar, typename Derived> \ Derived & \ MatrixBase<Scalar, Derived>::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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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<typename Lhs, typename Rhs> class Sum : NoOperatorEquals, public MatrixBase<typename Lhs::Scalar, Sum<Lhs, Rhs> > { @@ -59,7 +72,12 @@ template<typename Lhs, typename Rhs> 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<typename Scalar, typename Derived1, typename Derived2> const Sum<Derived1, Derived2> operator+(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Derived2> &mat2) @@ -67,6 +85,10 @@ operator+(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Der return Sum<Derived1, Derived2>(mat1.ref(), mat2.ref()); } +/** replaces \c *this by \c *this + \a other. + * + * \returns a reference to \c *this + */ template<typename Scalar, typename Derived> template<typename OtherDerived> 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 <jacob@math.jussieu.fr> +// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr> // // 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 |