aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/ReturnByValue.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-10-19 10:56:37 -0400
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-10-19 10:56:37 -0400
commit9a700c297490024bd94edfcd73f14c8a984705c9 (patch)
treef00a20af09cacc07ec5f3638194463baba6f1275 /Eigen/src/Core/ReturnByValue.h
parent47eeb4038004b761db08b91cbb04b0b9403c4f18 (diff)
* LU unit test: finally test fixed sizes
* ReturnByValue: after all don't eval to temporary for generic MatrixBase impl
Diffstat (limited to 'Eigen/src/Core/ReturnByValue.h')
-rw-r--r--Eigen/src/Core/ReturnByValue.h18
1 files changed, 2 insertions, 16 deletions
diff --git a/Eigen/src/Core/ReturnByValue.h b/Eigen/src/Core/ReturnByValue.h
index 297ed2456..55652db48 100644
--- a/Eigen/src/Core/ReturnByValue.h
+++ b/Eigen/src/Core/ReturnByValue.h
@@ -65,22 +65,8 @@ template<typename Derived>
template<typename OtherDerived>
Derived& MatrixBase<Derived>::operator=(const ReturnByValue<OtherDerived>& other)
{
- // Here we evaluate to a temporary matrix tmp, which we then copy. The main purpose
- // of this is to limit the number of instantiations of the template method evalTo<Destination>():
- // we only instantiate for PlainMatrixType.
- // Notice that this behaviour is specific to this operator in MatrixBase. The corresponding operator in class Matrix
- // does not evaluate into a temporary first.
- // TODO find a way to avoid evaluating into a temporary in the cases that matter. At least Block<> matters
- // for the implementation of blocked algorithms.
- // Should we:
- // - try a trick like for the products, where the destination is abstracted as an array with stride?
- // - or just add an operator in class Block, so we get a separate instantiation there (bad) but at least not more
- // than that, and at least that's easy to make work?
- // - or, since here we're talking about a compromise between code size and performance, let the user choose?
- // Not obvious: many users will never find out about this feature, and it's hard to find a good API.
- PlainMatrixType tmp;
- other.evalTo(tmp);
- return derived() = tmp;
+ other.evalTo(derived());
+ return derived();
}
#endif // EIGEN_RETURNBYVALUE_H