diff options
author | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2016-05-11 09:00:18 +0200 |
---|---|---|
committer | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2016-05-11 09:00:18 +0200 |
commit | 0f61343893588656a160fcd27bc1ef77cd95a18c (patch) | |
tree | 33cfcb15ef6e2c9c75de2602d73045eb590d1638 /Eigen/src/SparseCore/SparseCwiseBinaryOp.h | |
parent | 3bfc9b47ca83022534f2dbdf0a8ebc552823d43c (diff) |
Workaround maybe-uninitialized warning
Diffstat (limited to 'Eigen/src/SparseCore/SparseCwiseBinaryOp.h')
-rw-r--r-- | Eigen/src/SparseCore/SparseCwiseBinaryOp.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Eigen/src/SparseCore/SparseCwiseBinaryOp.h b/Eigen/src/SparseCore/SparseCwiseBinaryOp.h index c57d9ac59..d422f3cbe 100644 --- a/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +++ b/Eigen/src/SparseCore/SparseCwiseBinaryOp.h @@ -165,7 +165,7 @@ public: public: EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator& aEval, Index outer) - : m_lhsEval(aEval.m_lhsImpl), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor), m_id(-1), m_innerSize(aEval.m_expr.rhs().innerSize()) + : m_lhsEval(aEval.m_lhsImpl), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor), m_value(0), m_id(-1), m_innerSize(aEval.m_expr.rhs().innerSize()) { this->operator++(); } @@ -189,7 +189,7 @@ public: return *this; } - EIGEN_STRONG_INLINE Scalar value() const { return m_value; } + EIGEN_STRONG_INLINE Scalar value() const { eigen_internal_assert(m_id<m_innerSize); return m_value; } EIGEN_STRONG_INLINE StorageIndex index() const { return m_id; } EIGEN_STRONG_INLINE Index row() const { return IsRowMajor ? m_rhsIter.outer() : m_id; } @@ -253,7 +253,7 @@ public: public: EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator& aEval, Index outer) - : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsEval(aEval.m_rhsImpl), m_functor(aEval.m_functor), m_id(-1), m_innerSize(aEval.m_expr.lhs().innerSize()) + : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsEval(aEval.m_rhsImpl), m_functor(aEval.m_functor), m_value(0), m_id(-1), m_innerSize(aEval.m_expr.lhs().innerSize()) { this->operator++(); } @@ -277,7 +277,7 @@ public: return *this; } - EIGEN_STRONG_INLINE Scalar value() const { return m_value; } + EIGEN_STRONG_INLINE Scalar value() const { eigen_internal_assert(m_id<m_innerSize); return m_value; } EIGEN_STRONG_INLINE StorageIndex index() const { return m_id; } EIGEN_STRONG_INLINE Index row() const { return IsRowMajor ? m_lhsIter.outer() : m_id; } |