aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2010-02-05 23:44:24 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2010-02-05 23:44:24 +0100
commit6f3f8578979b8af3d29abc8bfc17e7995bf54143 (patch)
tree8b4ac5a7bde533572ecb169c490cce631a58a549 /Eigen
parent52167be4c8a2ea72213ebbd9ce828eeb3dcff5f3 (diff)
make noalias works for coefficient based products
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/DenseBase.h3
-rw-r--r--Eigen/src/Core/Flagged.h14
-rw-r--r--Eigen/src/Core/NoAlias.h8
-rw-r--r--Eigen/src/Core/ProductBase.h2
-rw-r--r--Eigen/src/Core/util/Constants.h2
-rw-r--r--Eigen/src/Core/util/ForwardDeclarations.h1
6 files changed, 28 insertions, 2 deletions
diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h
index a2165b52f..9ef9108e4 100644
--- a/Eigen/src/Core/DenseBase.h
+++ b/Eigen/src/Core/DenseBase.h
@@ -233,6 +233,9 @@ template<typename Derived> class DenseBase
CommaInitializer<Derived> operator<< (const Scalar& s);
+ template<unsigned int Added,unsigned int Removed>
+ const Flagged<Derived, Added, Removed> flagged() const;
+
template<typename OtherDerived>
CommaInitializer<Derived> operator<< (const DenseBase<OtherDerived>& other);
diff --git a/Eigen/src/Core/Flagged.h b/Eigen/src/Core/Flagged.h
index af00a68be..7f42a1e73 100644
--- a/Eigen/src/Core/Flagged.h
+++ b/Eigen/src/Core/Flagged.h
@@ -118,4 +118,18 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas
ExpressionTypeNested m_matrix;
};
+/** \returns an expression of *this with added and removed flags
+ *
+ * This is mostly for internal use.
+ *
+ * \sa class Flagged
+ */
+template<typename Derived>
+template<unsigned int Added,unsigned int Removed>
+inline const Flagged<Derived, Added, Removed>
+DenseBase<Derived>::flagged() const
+{
+ return derived();
+}
+
#endif // EIGEN_FLAGGED_H
diff --git a/Eigen/src/Core/NoAlias.h b/Eigen/src/Core/NoAlias.h
index bfea5c91d..e09fd0091 100644
--- a/Eigen/src/Core/NoAlias.h
+++ b/Eigen/src/Core/NoAlias.h
@@ -69,6 +69,14 @@ class NoAlias
template<typename ProductDerived, typename Lhs, typename Rhs>
EIGEN_STRONG_INLINE ExpressionType& operator-=(const ProductBase<ProductDerived, Lhs,Rhs>& other)
{ other.derived().subTo(m_expression); return m_expression; }
+
+ template<typename Lhs, typename Rhs>
+ EIGEN_STRONG_INLINE ExpressionType& operator+=(const GeneralProduct<Lhs,Rhs,UnrolledProduct>& other)
+ { return m_expression.derived() += other.template flagged<0,EvalBeforeAssigningBit|EvalBeforeNestingBit>(); }
+
+ template<typename Lhs, typename Rhs>
+ EIGEN_STRONG_INLINE ExpressionType& operator-=(const GeneralProduct<Lhs,Rhs,UnrolledProduct>& other)
+ { return m_expression.derived() -= other.template flagged<0,EvalBeforeAssigningBit|EvalBeforeNestingBit>(); }
#endif
protected:
diff --git a/Eigen/src/Core/ProductBase.h b/Eigen/src/Core/ProductBase.h
index ef986baaa..5c51ea27c 100644
--- a/Eigen/src/Core/ProductBase.h
+++ b/Eigen/src/Core/ProductBase.h
@@ -25,8 +25,6 @@
#ifndef EIGEN_PRODUCTBASE_H
#define EIGEN_PRODUCTBASE_H
-enum { OuterProduct, InnerProduct, UnrolledProduct, GemvProduct, GemmProduct };
-
/** \class ProductBase
*
*/
diff --git a/Eigen/src/Core/util/Constants.h b/Eigen/src/Core/util/Constants.h
index 6ae103e66..c747d970b 100644
--- a/Eigen/src/Core/util/Constants.h
+++ b/Eigen/src/Core/util/Constants.h
@@ -267,4 +267,6 @@ namespace Architecture
enum DenseStorageMatrix {};
enum DenseStorageArray {};
+enum { OuterProduct, InnerProduct, UnrolledProduct, GemvProduct, GemmProduct };
+
#endif // EIGEN_CONSTANTS_H
diff --git a/Eigen/src/Core/util/ForwardDeclarations.h b/Eigen/src/Core/util/ForwardDeclarations.h
index b6bba04e6..ac7824dc1 100644
--- a/Eigen/src/Core/util/ForwardDeclarations.h
+++ b/Eigen/src/Core/util/ForwardDeclarations.h
@@ -51,6 +51,7 @@ template<typename ViewOp, typename MatrixType> class CwiseUnaryView;
template<typename BinaryOp, typename Lhs, typename Rhs> class CwiseBinaryOp;
template<typename BinOp, typename MatrixType> class SelfCwiseBinaryOp;
template<typename Derived, typename Lhs, typename Rhs> class ProductBase;
+template<typename Lhs, typename Rhs, int Mode> class GeneralProduct;
template<typename Derived> class DiagonalBase;
template<typename _DiagonalVectorType> class DiagonalWrapper;