aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Swap.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-08-09 04:37:09 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-08-09 04:37:09 +0000
commita41f2b4216eda0181db6cc33fb064a368a900591 (patch)
tree97050ff1d9ed025c420224ac5de2cb64a29c76d9 /Eigen/src/Core/Swap.h
parent9bbe396939c925854cdce8aabcff1ebe0a8f23bc (diff)
* fix bug in SwapWrapper : store the wrapped expression by reference
* optimize setIdentity: when the matrix is large enough it is better to setZero() and overwrite the diagonal * start of LU solver, disabled for now
Diffstat (limited to 'Eigen/src/Core/Swap.h')
-rw-r--r--Eigen/src/Core/Swap.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Eigen/src/Core/Swap.h b/Eigen/src/Core/Swap.h
index 99ca5f72c..b58fd1279 100644
--- a/Eigen/src/Core/Swap.h
+++ b/Eigen/src/Core/Swap.h
@@ -53,7 +53,7 @@ template<typename ExpressionType> class SwapWrapper
EIGEN_GENERIC_PUBLIC_INTERFACE(SwapWrapper)
typedef typename ei_packet_traits<Scalar>::type Packet;
- inline SwapWrapper(ExpressionType& matrix) : m_expression(matrix) {}
+ inline SwapWrapper(ExpressionType& xpr) : m_expression(xpr) {}
inline int rows() const { return m_expression.rows(); }
inline int cols() const { return m_expression.cols(); }
@@ -106,7 +106,7 @@ template<typename ExpressionType> class SwapWrapper
}
protected:
- ExpressionType m_expression;
+ ExpressionType& m_expression;
};
/** swaps *this with the expression \a other.