25 #ifndef EIGEN_PRODUCT_H
26 #define EIGEN_PRODUCT_H
28 template<
typename Lhs,
typename Rhs>
class Product;
29 template<
typename Lhs,
typename Rhs,
typename StorageKind>
class ProductImpl;
44 template<
typename Lhs,
typename Rhs>
45 struct traits<Product<Lhs, Rhs> >
47 typedef MatrixXpr XprKind;
48 typedef typename remove_all<Lhs>::type LhsCleaned;
49 typedef typename remove_all<Rhs>::type RhsCleaned;
50 typedef typename scalar_product_traits<typename traits<LhsCleaned>::Scalar,
typename traits<RhsCleaned>::Scalar>::ReturnType Scalar;
51 typedef typename promote_storage_type<typename traits<LhsCleaned>::StorageKind,
53 typedef typename promote_index_type<typename traits<LhsCleaned>::Index,
56 RowsAtCompileTime = LhsCleaned::RowsAtCompileTime,
57 ColsAtCompileTime = RhsCleaned::ColsAtCompileTime,
58 MaxRowsAtCompileTime = LhsCleaned::MaxRowsAtCompileTime,
59 MaxColsAtCompileTime = RhsCleaned::MaxColsAtCompileTime,
60 Flags = (MaxRowsAtCompileTime==1 ?
RowMajorBit : 0),
67 template<
typename Lhs,
typename Rhs>
68 class Product :
public ProductImpl<Lhs,Rhs,typename internal::promote_storage_type<typename internal::traits<Lhs>::StorageKind,
69 typename internal::traits<Rhs>::StorageKind>::ret>
75 typename internal::promote_storage_type<
typename Lhs::StorageKind,
84 Product(const Lhs& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs)
87 &&
"invalid matrix product"
88 &&
"if you wanted a coeff-wise or a dot product use the respective explicit functions");
91 inline Index
rows()
const {
return m_lhs.rows(); }
92 inline Index
cols()
const {
return m_rhs.cols(); }
103 template<
typename Lhs,
typename Rhs>
104 class ProductImpl<Lhs,Rhs,Dense> :
public internal::dense_xpr_base<Product<Lhs,Rhs> >::type
109 typedef typename internal::dense_xpr_base<Product<Lhs, Rhs> >::type
Base;
113 #endif // EIGEN_PRODUCT_H