bug #482: pass scalar arguments by const references. Still remains a few cases that might affect the ABI (see the bug entry)

This commit is contained in:
Gael Guennebaud
2013-02-25 18:05:57 +01:00
parent cc35c44256
commit 12a1313b09
28 changed files with 70 additions and 70 deletions

View File

@@ -110,7 +110,7 @@ class IncompleteLUT : internal::noncopyable
{}
template<typename MatrixType>
IncompleteLUT(const MatrixType& mat, RealScalar droptol=NumTraits<Scalar>::dummy_precision(), int fillfactor = 10)
IncompleteLUT(const MatrixType& mat, const RealScalar& droptol=NumTraits<Scalar>::dummy_precision(), int fillfactor = 10)
: m_droptol(droptol),m_fillfactor(fillfactor),
m_analysisIsOk(false),m_factorizationIsOk(false),m_isInitialized(false)
{
@@ -154,7 +154,7 @@ class IncompleteLUT : internal::noncopyable
return *this;
}
void setDroptol(RealScalar droptol);
void setDroptol(const RealScalar& droptol);
void setFillfactor(int fillfactor);
template<typename Rhs, typename Dest>
@@ -203,7 +203,7 @@ protected:
* \param droptol Drop any element whose magnitude is less than this tolerance
**/
template<typename Scalar>
void IncompleteLUT<Scalar>::setDroptol(RealScalar droptol)
void IncompleteLUT<Scalar>::setDroptol(const RealScalar& droptol)
{
this->m_droptol = droptol;
}

View File

@@ -120,7 +120,7 @@ public:
RealScalar tolerance() const { return m_tolerance; }
/** Sets the tolerance threshold used by the stopping criteria */
Derived& setTolerance(RealScalar tolerance)
Derived& setTolerance(const RealScalar& tolerance)
{
m_tolerance = tolerance;
return derived();