From 99d952466f23308f87a7edda1d6b833cdd391754 Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Tue, 15 Jun 2010 10:26:12 +0200 Subject: [PATCH] This scalar needs to be passed by ref to preserve its alignment. --- Eigen/src/Core/MatrixBase.h | 2 +- Eigen/src/Sparse/SparseView.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index 986806e43..ac5951d1e 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -226,7 +226,7 @@ template class MatrixBase template SelfAdjointView selfadjointView(); template const SelfAdjointView selfadjointView() const; - const SparseView sparseView(const Scalar m_reference = Scalar(0), + const SparseView sparseView(const Scalar& m_reference = Scalar(0), typename NumTraits::Real m_epsilon = NumTraits::dummy_precision()) const; static const IdentityReturnType Identity(); static const IdentityReturnType Identity(Index rows, Index cols); diff --git a/Eigen/src/Sparse/SparseView.h b/Eigen/src/Sparse/SparseView.h index 3ee9b0024..56d00b396 100644 --- a/Eigen/src/Sparse/SparseView.h +++ b/Eigen/src/Sparse/SparseView.h @@ -35,7 +35,7 @@ class SparseView : public SparseMatrixBase > public: EIGEN_SPARSE_PUBLIC_INTERFACE(SparseView) - SparseView(const MatrixType& mat, const Scalar m_reference = Scalar(0), + SparseView(const MatrixType& mat, const Scalar& m_reference = Scalar(0), typename NumTraits::Real m_epsilon = NumTraits::dummy_precision()) : m_matrix(mat), m_reference(m_reference), m_epsilon(m_epsilon) {} class InnerIterator; @@ -86,7 +86,7 @@ private: }; template -const SparseView MatrixBase::sparseView(const Scalar m_reference, +const SparseView MatrixBase::sparseView(const Scalar& m_reference, typename NumTraits::Real m_epsilon) const { return SparseView(derived(), m_reference, m_epsilon);