From 107bb308c376a5a4b7f11f2792396d2fa0d12904 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 1 Aug 2014 16:24:23 +0200 Subject: [PATCH] Fix various small issues detected by gcc --- Eigen/src/Core/CoreEvaluators.h | 2 +- Eigen/src/Geometry/Transform.h | 2 +- Eigen/src/SparseCore/SparseBlock.h | 6 +++--- Eigen/src/SparseCore/SparseTriangularView.h | 2 +- Eigen/src/SparseQR/SparseQR.h | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Eigen/src/Core/CoreEvaluators.h b/Eigen/src/Core/CoreEvaluators.h index 66984e378..8c9190a0e 100644 --- a/Eigen/src/Core/CoreEvaluators.h +++ b/Eigen/src/Core/CoreEvaluators.h @@ -965,7 +965,7 @@ struct evaluator > typedef PartialReduxExpr XprType; typedef typename XprType::Scalar InputScalar; enum { - TraversalSize = Direction==Vertical ? ArgType::RowsAtCompileTime : XprType::ColsAtCompileTime + TraversalSize = Direction==int(Vertical) ? int(ArgType::RowsAtCompileTime) : int(XprType::ColsAtCompileTime) }; typedef typename MemberOp::template Cost CostOpType; enum { diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index a62548f12..bcf3e2723 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -375,7 +375,7 @@ public: #endif #ifdef EIGEN_TEST_EVALUATORS - Index rows() const { return Mode==Projective ? m_matrix.cols() : m_matrix.cols()-1; } + Index rows() const { return int(Mode)==int(Projective) ? m_matrix.cols() : (m_matrix.cols()-1); } Index cols() const { return m_matrix.cols(); } #endif diff --git a/Eigen/src/SparseCore/SparseBlock.h b/Eigen/src/SparseCore/SparseBlock.h index 39e636437..21445b645 100644 --- a/Eigen/src/SparseCore/SparseBlock.h +++ b/Eigen/src/SparseCore/SparseBlock.h @@ -577,7 +577,7 @@ namespace internal { #ifdef EIGEN_TEST_EVALUATORS // -template +template struct unary_evaluator, IteratorBased > : public evaluator_base > { @@ -615,7 +615,7 @@ struct unary_evaluator, IteratorBa const XprType &m_block; }; -template +template class unary_evaluator, IteratorBased>::InnerVectorInnerIterator : public EvalIterator { @@ -640,7 +640,7 @@ public: inline operator bool() const { return EvalIterator::operator bool() && EvalIterator::index() < m_end; } }; -template +template class unary_evaluator, IteratorBased>::OuterVectorInnerIterator { const unary_evaluator& m_eval; diff --git a/Eigen/src/SparseCore/SparseTriangularView.h b/Eigen/src/SparseCore/SparseTriangularView.h index 7586a0a6e..87f4ab18d 100644 --- a/Eigen/src/SparseCore/SparseTriangularView.h +++ b/Eigen/src/SparseCore/SparseTriangularView.h @@ -200,7 +200,7 @@ public: public: EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& xprEval, Index outer) - : Base(xprEval.m_argImpl,outer) + : Base(xprEval.m_argImpl,outer), m_returnOne(false) { if(SkipFirst) { diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h index 4c6553bf2..e8d7b8607 100644 --- a/Eigen/src/SparseQR/SparseQR.h +++ b/Eigen/src/SparseQR/SparseQR.h @@ -178,7 +178,7 @@ class SparseQR y.resize((std::max)(cols(),Index(y.rows())),y.cols()); y.topRows(rank) = this->matrixR().topLeftCorner(rank, rank).template triangularView().solve(b.topRows(rank)); y.bottomRows(y.rows()-rank).setZero(); - + // Apply the column permutation if (m_perm_c.size()) dest = colsPermutation() * y.topRows(cols()); else dest = y.topRows(cols()); @@ -447,7 +447,7 @@ void SparseQR::factorize(const MatrixType& mat) } } // End update current column - Scalar tau; + Scalar tau = 0; RealScalar beta = 0; if(nonzeroCol < diagSize)