hehe, the complicated nesting scheme in Flagged in the previous commit

was a sign that we were doing something wrong. In fact, having
NestByValue as a special case of Flagged was wrong, and the previous
commit, while not buggy, was inefficient because then when the resulting
NestByValue xpr was nested -- hence copied -- the original xpr which was
already nested by value was copied again; hence instead of 1 copy we got
3 copies.
The solution was to ressuscitate the old Temporary.h (renamed
NestByValue.h) as it was the right approach.
This commit is contained in:
Benoit Jacob
2008-05-28 05:14:16 +00:00
parent aebecae510
commit f54760c889
10 changed files with 108 additions and 24 deletions

View File

@@ -305,8 +305,8 @@ template<typename Derived> class MatrixBase
Transpose<Derived> transpose();
const Transpose<Derived> transpose() const;
const Transpose<
Flagged<CwiseUnaryOp<ei_scalar_conjugate_op<typename ei_traits<Derived>::Scalar>, Derived>
, NestByValueBit, 0> >
NestByValue<CwiseUnaryOp<ei_scalar_conjugate_op<typename ei_traits<Derived>::Scalar>, Derived> >
>
adjoint() const;
//@}
@@ -452,7 +452,6 @@ template<typename Derived> class MatrixBase
template<unsigned int Added>
const Flagged<Derived, Added, 0> marked() const;
const Flagged<Derived, 0, EvalBeforeNestingBit | EvalBeforeAssigningBit> lazy() const;
const Flagged<Derived, NestByValueBit, 0> nestByValue() const;
/** \returns number of elements to skip to pass from one row (resp. column) to another
* for a row-major (resp. column-major) matrix.
@@ -460,6 +459,8 @@ template<typename Derived> class MatrixBase
* of the underlying matrix.
*/
inline int stride(void) const { return derived()._stride(); }
inline const NestByValue<Derived> nestByValue() const;
//@}
/// \name Coefficient-wise operations