From 5111ace0d6ad7ceb505efbf7c591c23e8087ffa9 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sun, 6 Jan 2008 19:34:28 +0000 Subject: [PATCH] move default parameter values from function definition to function declaration. doxygen likes it and this fixes compilation on ICC. --- Eigen/src/Core/DiagonalMatrix.h | 2 +- Eigen/src/Core/Dot.h | 4 ++-- Eigen/src/Core/Fuzzy.h | 6 +++--- Eigen/src/Core/Identity.h | 2 +- Eigen/src/Core/MatrixBase.h | 32 +++++++++++++++++--------------- Eigen/src/Core/Ones.h | 2 +- Eigen/src/Core/Zero.h | 2 +- 7 files changed, 26 insertions(+), 24 deletions(-) diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h index d02fc5e62..ca125d6f3 100644 --- a/Eigen/src/Core/DiagonalMatrix.h +++ b/Eigen/src/Core/DiagonalMatrix.h @@ -98,7 +98,7 @@ MatrixBase::asDiagonal() const */ template bool MatrixBase::isDiagonal -(typename NumTraits::Real prec = precision()) const +(typename NumTraits::Real prec) const { if(cols() != rows()) return false; RealScalar maxAbsOnDiagonal = static_cast(-1); diff --git a/Eigen/src/Core/Dot.h b/Eigen/src/Core/Dot.h index 2ae8b3093..ebea30d6b 100644 --- a/Eigen/src/Core/Dot.h +++ b/Eigen/src/Core/Dot.h @@ -138,7 +138,7 @@ template template bool MatrixBase::isOrtho (const OtherDerived& other, - typename NumTraits::Real prec = precision()) const + typename NumTraits::Real prec) const { return abs2(dot(other)) <= prec * prec * norm2() * other.norm2(); } @@ -156,7 +156,7 @@ bool MatrixBase::isOrtho */ template bool MatrixBase::isOrtho -(typename NumTraits::Real prec = precision()) const +(typename NumTraits::Real prec) const { for(int i = 0; i < cols(); i++) { diff --git a/Eigen/src/Core/Fuzzy.h b/Eigen/src/Core/Fuzzy.h index 9337cadc8..48e4e7b07 100644 --- a/Eigen/src/Core/Fuzzy.h +++ b/Eigen/src/Core/Fuzzy.h @@ -30,7 +30,7 @@ template template bool MatrixBase::isApprox( const OtherDerived& other, - typename NumTraits::Real prec = precision() + typename NumTraits::Real prec ) const { assert(rows() == other.rows() && cols() == other.cols()); @@ -51,7 +51,7 @@ bool MatrixBase::isApprox( template bool MatrixBase::isMuchSmallerThan( const typename NumTraits::Real& other, - typename NumTraits::Real prec = precision() + typename NumTraits::Real prec ) const { if(Traits::IsVectorAtCompileTime) @@ -71,7 +71,7 @@ template template bool MatrixBase::isMuchSmallerThan( const MatrixBase& other, - typename NumTraits::Real prec = precision() + typename NumTraits::Real prec ) const { assert(rows() == other.rows() && cols() == other.cols()); diff --git a/Eigen/src/Core/Identity.h b/Eigen/src/Core/Identity.h index 7c1893b08..0cf0991ac 100644 --- a/Eigen/src/Core/Identity.h +++ b/Eigen/src/Core/Identity.h @@ -92,7 +92,7 @@ const Identity MatrixBase::identity(int rows) */ template bool MatrixBase::isIdentity -(typename NumTraits::Real prec = precision()) const +(typename NumTraits::Real prec) const { if(cols() != rows()) return false; for(int j = 0; j < cols(); j++) diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index fbf17b581..b23b0ffee 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -59,6 +59,7 @@ template class MatrixBase public: /** \brief Some traits provided by the Derived type. + * * Grouping these in a nested subclass is what was needed for ICC compatibility. */ struct Traits { @@ -103,17 +104,17 @@ template class MatrixBase * \a Scalar is \a std::complex then RealScalar is \a T. */ typedef typename NumTraits::Real RealScalar; - /** \returns the number of rows. \sa cols(), DerivedTraits::RowsAtCompileTime */ + /** \returns the number of rows. \sa cols(), Traits::RowsAtCompileTime */ int rows() const { return static_cast(this)->_rows(); } - /** \returns the number of columns. \sa row(), DerivedTraits::ColsAtCompileTime*/ + /** \returns the number of columns. \sa row(), Traits::ColsAtCompileTime*/ int cols() const { return static_cast(this)->_cols(); } /** \returns the number of coefficients, which is \a rows()*cols(). - * \sa rows(), cols(), DerivedTraits::SizeAtCompileTime. */ + * \sa rows(), cols(), Traits::SizeAtCompileTime. */ int size() const { return rows() * cols(); } /** \returns true if either the number of rows or the number of columns is equal to 1. * In other words, this function returns * \code rows()==1 || cols()==1 \endcode - * \sa rows(), cols(), DerivedTraits::IsVectorAtCompileTime. */ + * \sa rows(), cols(), Traits::IsVectorAtCompileTime. */ bool isVector() const { return rows()==1 || cols()==1; } /** \returns a Ref to *this. \sa Ref */ Ref ref() const @@ -163,8 +164,8 @@ template class MatrixBase RealScalar norm() const; const ScalarMultiple normalized() const; template - bool isOrtho(const OtherDerived& other, RealScalar prec) const; - bool isOrtho(RealScalar prec) const; + bool isOrtho(const OtherDerived& other, RealScalar prec = precision()) const; + bool isOrtho(RealScalar prec = precision()) const; static const Eval > random(int rows, int cols); static const Eval > random(int size); @@ -177,10 +178,10 @@ template class MatrixBase static const Ones ones(); static const Identity identity(int rows = Derived::RowsAtCompileTime); - bool isZero(RealScalar prec) const; - bool isOnes(RealScalar prec) const; - bool isIdentity(RealScalar prec) const; - bool isDiagonal(RealScalar prec) const; + bool isZero(RealScalar prec = precision()) const; + bool isOnes(RealScalar prec = precision()) const; + bool isIdentity(RealScalar prec = precision()) const; + bool isDiagonal(RealScalar prec = precision()) const; const DiagonalMatrix asDiagonal() const; @@ -188,12 +189,13 @@ template class MatrixBase const DiagonalCoeffs diagonal() const; template - bool isApprox(const OtherDerived& other, RealScalar prec) const; - bool isMuchSmallerThan - (const typename NumTraits::Real& other, RealScalar prec) const; + bool isApprox(const OtherDerived& other, + RealScalar prec = precision()) const; + bool isMuchSmallerThan(const typename NumTraits::Real& other, + RealScalar prec = precision()) const; template - bool isMuchSmallerThan - (const MatrixBase& other, RealScalar prec) const; + bool isMuchSmallerThan(const MatrixBase& other, + RealScalar prec = precision()) const; template const Product diff --git a/Eigen/src/Core/Ones.h b/Eigen/src/Core/Ones.h index 30aad4c3c..2f2d42417 100644 --- a/Eigen/src/Core/Ones.h +++ b/Eigen/src/Core/Ones.h @@ -135,7 +135,7 @@ const Ones MatrixBase::ones() */ template bool MatrixBase::isOnes -(typename NumTraits::Real prec = precision()) const +(typename NumTraits::Real prec) const { for(int j = 0; j < cols(); j++) for(int i = 0; i < rows(); i++) diff --git a/Eigen/src/Core/Zero.h b/Eigen/src/Core/Zero.h index ff587d886..853171c0c 100644 --- a/Eigen/src/Core/Zero.h +++ b/Eigen/src/Core/Zero.h @@ -135,7 +135,7 @@ const Zero MatrixBase::zero() */ template bool MatrixBase::isZero -(typename NumTraits::Real prec = precision()) const +(typename NumTraits::Real prec) const { for(int j = 0; j < cols(); j++) for(int i = 0; i < rows(); i++)