Added ArrayBit to get the ability to manipulate a Matrix like a simple scalar.

In particular this flag changes the behavior of operator* to a coeff wise product.
This commit is contained in:
Gael Guennebaud
2008-05-29 22:33:07 +00:00
parent b501e08d81
commit e2ac5d244e
7 changed files with 78 additions and 20 deletions

View File

@@ -320,10 +320,11 @@ template<typename Lhs, typename Rhs, int EvalMode> class Product : ei_no_assignm
*/
template<typename Derived>
template<typename OtherDerived>
inline const Product<Derived,OtherDerived>
inline const typename MatrixBase<Derived>::template ProductReturnType<OtherDerived>::Type
MatrixBase<Derived>::operator*(const MatrixBase<OtherDerived> &other) const
{
return Product<Derived,OtherDerived>(derived(), other.derived());
assert( (Derived::Flags&ArrayBit) == (OtherDerived::Flags) );
return typename ProductReturnType<OtherDerived>::Type(derived(), other.derived());
}
/** replaces \c *this by \c *this * \a other.