Another big refactoring change:

* add a new Eigen2Support module including Cwise, Flagged, and some other deprecated stuff
* add a few cwiseXxx functions
* adapt a few modules to use cwiseXxx instead of the .cwise() prefix
This commit is contained in:
Gael Guennebaud
2009-11-18 18:15:19 +01:00
parent 0529ecfe1b
commit e3d890bc5a
48 changed files with 634 additions and 408 deletions

View File

@@ -247,6 +247,7 @@ template<typename Derived> class MatrixBase
#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase
#include "CwiseUnaryOps.h"
#include "CwiseBinaryOps.h"
#undef EIGEN_CURRENT_STORAGE_BASE_CLASS
/** Copies \a other into *this. \returns a reference to *this. */
@@ -275,12 +276,6 @@ template<typename Derived> class MatrixBase
template<typename OtherDerived>
Derived& lazyAssign(const MatrixBase<OtherDerived>& other);
/** \deprecated because .lazy() is deprecated
* Overloaded for cache friendly product evaluation */
template<typename OtherDerived>
Derived& lazyAssign(const Flagged<OtherDerived, 0, EvalBeforeAssigningBit>& other)
{ return lazyAssign(other._expression()); }
template<typename ProductDerived, typename Lhs, typename Rhs>
Derived& lazyAssign(const ProductBase<ProductDerived, Lhs,Rhs>& other);
@@ -342,15 +337,6 @@ template<typename Derived> class MatrixBase
Scalar& z();
Scalar& w();
template<typename OtherDerived>
const CwiseBinaryOp<ei_scalar_sum_op<typename ei_traits<Derived>::Scalar>, Derived, OtherDerived>
operator+(const MatrixBase<OtherDerived> &other) const;
template<typename OtherDerived>
const CwiseBinaryOp<ei_scalar_difference_op<typename ei_traits<Derived>::Scalar>, Derived, OtherDerived>
operator-(const MatrixBase<OtherDerived> &other) const;
template<typename OtherDerived>
Derived& operator+=(const MatrixBase<OtherDerived>& other);
template<typename OtherDerived>
@@ -373,14 +359,6 @@ template<typename Derived> class MatrixBase
const DiagonalProduct<Derived, DiagonalDerived, OnTheRight>
operator*(const DiagonalBase<DiagonalDerived> &diagonal) const;
template<typename OtherDerived>
typename ei_plain_matrix_type_column_major<OtherDerived>::type
solveTriangular(const MatrixBase<OtherDerived>& other) const;
template<typename OtherDerived>
void solveTriangularInPlace(const MatrixBase<OtherDerived>& other) const;
template<typename OtherDerived>
Scalar dot(const MatrixBase<OtherDerived>& other) const;
RealScalar squaredNorm() const;
@@ -542,11 +520,11 @@ template<typename Derived> class MatrixBase
template<typename OtherDerived>
inline bool operator==(const MatrixBase<OtherDerived>& other) const
{ return (cwise() == other).all(); }
{ return cwiseEqual(other).all(); }
template<typename OtherDerived>
inline bool operator!=(const MatrixBase<OtherDerived>& other) const
{ return (cwise() != other).any(); }
{ return cwiseNotEqual(other).all(); }
/** \returns the matrix or vector obtained by evaluating this expression.
@@ -560,10 +538,6 @@ template<typename Derived> class MatrixBase
template<typename OtherDerived>
void swap(MatrixBase<OtherDerived> EIGEN_REF_TO_TEMPORARY other);
template<unsigned int Added>
const Flagged<Derived, Added, 0> marked() const;
const Flagged<Derived, 0, EvalBeforeAssigningBit> lazy() const;
NoAlias<Derived,Eigen::MatrixBase > noalias();
/** \returns number of elements to skip to pass from one row (resp. column) to another
@@ -575,12 +549,6 @@ template<typename Derived> class MatrixBase
inline const NestByValue<Derived> nestByValue() const;
template<typename CustomBinaryOp, typename OtherDerived>
const CwiseBinaryOp<CustomBinaryOp, Derived, OtherDerived>
binaryExpr(const MatrixBase<OtherDerived> &other, const CustomBinaryOp& func = CustomBinaryOp()) const;
Scalar sum() const;
Scalar mean() const;
Scalar trace() const;
@@ -736,6 +704,33 @@ template<typename Derived> class MatrixBase
#include EIGEN_MATRIXBASE_PLUGIN
#endif
#ifdef EIGEN2_SUPPORT
/** \deprecated because .lazy() is deprecated
* Overloaded for cache friendly product evaluation */
template<typename OtherDerived>
Derived& lazyAssign(const Flagged<OtherDerived, 0, EvalBeforeAssigningBit>& other)
{ return lazyAssign(other._expression()); }
template<unsigned int Added>
const Flagged<Derived, Added, 0> marked() const;
const Flagged<Derived, 0, EvalBeforeAssigningBit> lazy() const;
inline const Cwise<Derived> cwise() const;
inline Cwise<Derived> cwise();
// a workaround waiting the Array class
inline const Cwise<Derived> array() const { return cwise(); }
// a workaround waiting the Array class
inline Cwise<Derived> array() { return cwise(); }
template<typename OtherDerived>
typename ei_plain_matrix_type_column_major<OtherDerived>::type
solveTriangular(const MatrixBase<OtherDerived>& other) const;
template<typename OtherDerived>
void solveTriangularInPlace(const MatrixBase<OtherDerived>& other) const;
#endif
protected:
/** Default constructor. Do nothing. */
MatrixBase()