mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-09 22:39:05 +08:00
make noalias works for coefficient based products
This commit is contained in:
parent
52167be4c8
commit
6f3f857897
@ -233,6 +233,9 @@ template<typename Derived> class DenseBase
|
|||||||
|
|
||||||
CommaInitializer<Derived> operator<< (const Scalar& s);
|
CommaInitializer<Derived> operator<< (const Scalar& s);
|
||||||
|
|
||||||
|
template<unsigned int Added,unsigned int Removed>
|
||||||
|
const Flagged<Derived, Added, Removed> flagged() const;
|
||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
CommaInitializer<Derived> operator<< (const DenseBase<OtherDerived>& other);
|
CommaInitializer<Derived> operator<< (const DenseBase<OtherDerived>& other);
|
||||||
|
|
||||||
|
@ -118,4 +118,18 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas
|
|||||||
ExpressionTypeNested m_matrix;
|
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
|
#endif // EIGEN_FLAGGED_H
|
||||||
|
@ -69,6 +69,14 @@ class NoAlias
|
|||||||
template<typename ProductDerived, typename Lhs, typename Rhs>
|
template<typename ProductDerived, typename Lhs, typename Rhs>
|
||||||
EIGEN_STRONG_INLINE ExpressionType& operator-=(const ProductBase<ProductDerived, Lhs,Rhs>& other)
|
EIGEN_STRONG_INLINE ExpressionType& operator-=(const ProductBase<ProductDerived, Lhs,Rhs>& other)
|
||||||
{ other.derived().subTo(m_expression); return m_expression; }
|
{ 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
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -25,8 +25,6 @@
|
|||||||
#ifndef EIGEN_PRODUCTBASE_H
|
#ifndef EIGEN_PRODUCTBASE_H
|
||||||
#define EIGEN_PRODUCTBASE_H
|
#define EIGEN_PRODUCTBASE_H
|
||||||
|
|
||||||
enum { OuterProduct, InnerProduct, UnrolledProduct, GemvProduct, GemmProduct };
|
|
||||||
|
|
||||||
/** \class ProductBase
|
/** \class ProductBase
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -267,4 +267,6 @@ namespace Architecture
|
|||||||
enum DenseStorageMatrix {};
|
enum DenseStorageMatrix {};
|
||||||
enum DenseStorageArray {};
|
enum DenseStorageArray {};
|
||||||
|
|
||||||
|
enum { OuterProduct, InnerProduct, UnrolledProduct, GemvProduct, GemmProduct };
|
||||||
|
|
||||||
#endif // EIGEN_CONSTANTS_H
|
#endif // EIGEN_CONSTANTS_H
|
||||||
|
@ -51,6 +51,7 @@ template<typename ViewOp, typename MatrixType> class CwiseUnaryView;
|
|||||||
template<typename BinaryOp, typename Lhs, typename Rhs> class CwiseBinaryOp;
|
template<typename BinaryOp, typename Lhs, typename Rhs> class CwiseBinaryOp;
|
||||||
template<typename BinOp, typename MatrixType> class SelfCwiseBinaryOp;
|
template<typename BinOp, typename MatrixType> class SelfCwiseBinaryOp;
|
||||||
template<typename Derived, typename Lhs, typename Rhs> class ProductBase;
|
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 Derived> class DiagonalBase;
|
||||||
template<typename _DiagonalVectorType> class DiagonalWrapper;
|
template<typename _DiagonalVectorType> class DiagonalWrapper;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user