aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Swap.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-08-07 04:31:05 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-08-07 04:31:05 +0000
commit58ba9ca72f1a7c0f3f81ce1bf01e7410900682c0 (patch)
treec19e0a67a85b07d6a08b9b8e150b5610e9962f7b /Eigen/src/Core/Swap.h
parent88bb2087c100d21f40546829759ebd58d14947ff (diff)
LU: remove partial-pivoting path (moderately useful since it's does
not allow to easily get the rank), fix a bug (which could have been triggered by matrices having coefficients of very different magnitudes). Part: add an assert to prevent hard to find bugs Swap: update comments
Diffstat (limited to 'Eigen/src/Core/Swap.h')
-rw-r--r--Eigen/src/Core/Swap.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/Eigen/src/Core/Swap.h b/Eigen/src/Core/Swap.h
index 0ee57017e..99ca5f72c 100644
--- a/Eigen/src/Core/Swap.h
+++ b/Eigen/src/Core/Swap.h
@@ -27,14 +27,9 @@
/** \class SwapWrapper
*
- * \brief Expression which must be nested by value
+ * \internal
*
- * \param ExpressionType the type of the object of which we are requiring nesting-by-value
- *
- * This class is the return type of MatrixBase::nestByValue()
- * and most of the time this is the only way it is used.
- *
- * \sa MatrixBase::nestByValue()
+ * \brief Internal helper class for swapping two expressions
*/
template<typename ExpressionType>
struct ei_traits<SwapWrapper<ExpressionType> >
@@ -116,12 +111,10 @@ template<typename ExpressionType> class SwapWrapper
/** swaps *this with the expression \a other.
*
- * \note \a other is only marked const because I couln't find another way
- * to get g++ (4.2 and 4.3) to accept that template parameter resolution.
- * The problem seems to be that when swapping expressions as in
- * m.row(i).swap(m.row(j)); the Row object returned by row(j) is a temporary
- * and g++ doesn't dare to pass it by non-constant reference.
- * It gets const_cast'd of course. TODO: get rid of const here.
+ * \note \a other is only marked for internal reasons, but of course
+ * it gets const-casted. One reason is that one will often call swap
+ * on temporary objects (hence non-const references are forbidden).
+ * Another reason is that lazyAssign takes a const argument anyway.
*/
template<typename Derived>
template<typename OtherDerived>
@@ -131,3 +124,9 @@ void MatrixBase<Derived>::swap(const MatrixBase<OtherDerived>& other)
}
#endif // EIGEN_SWAP_H
+
+
+
+
+
+