10 #ifndef EIGEN_PRODUCT_H
11 #define EIGEN_PRODUCT_H
17 template<
typename Lhs,
typename Rhs,
int Option,
typename StorageKind>
class ProductImpl;
21 template<
typename Lhs,
typename Rhs,
int Option>
22 struct traits<Product<Lhs, Rhs, Option> >
24 typedef remove_all_t<Lhs> LhsCleaned;
25 typedef remove_all_t<Rhs> RhsCleaned;
26 typedef traits<LhsCleaned> LhsTraits;
27 typedef traits<RhsCleaned> RhsTraits;
29 typedef MatrixXpr XprKind;
31 typedef typename ScalarBinaryOpTraits<typename traits<LhsCleaned>::Scalar,
typename traits<RhsCleaned>::Scalar>::ReturnType Scalar;
32 typedef typename product_promote_storage_type<
typename LhsTraits::StorageKind,
33 typename RhsTraits::StorageKind,
34 internal::product_type<Lhs,Rhs>::ret>::ret StorageKind;
35 typedef typename promote_index_type<
typename LhsTraits::StorageIndex,
36 typename RhsTraits::StorageIndex>::type StorageIndex;
39 RowsAtCompileTime = LhsTraits::RowsAtCompileTime,
40 ColsAtCompileTime = RhsTraits::ColsAtCompileTime,
41 MaxRowsAtCompileTime = LhsTraits::MaxRowsAtCompileTime,
42 MaxColsAtCompileTime = RhsTraits::MaxColsAtCompileTime,
48 Flags = (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1) ?
RowMajorBit
49 : (MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1) ? 0
72 template<
typename Lhs_,
typename Rhs_,
int Option>
74 typename internal::product_promote_storage_type<typename internal::traits<Lhs_>::StorageKind,
75 typename internal::traits<Rhs_>::StorageKind,
76 internal::product_type<Lhs_,Rhs_>::ret>::ret>
85 typename internal::product_promote_storage_type<typename internal::traits<Lhs>::StorageKind,
86 typename internal::traits<Rhs>::StorageKind,
99 &&
"invalid matrix product"
100 &&
"if you wanted a coeff-wise or a dot product use the respective explicit functions");
121 template<typename Lhs, typename Rhs, int Option, int ProductTag = internal::product_type<Lhs,Rhs>::ret>
122 class dense_product_base
123 :
public internal::dense_xpr_base<Product<Lhs,Rhs,Option> >::type
127 template<
typename Lhs,
typename Rhs,
int Option>
128 class dense_product_base<Lhs, Rhs, Option,
InnerProduct>
129 :
public internal::dense_xpr_base<Product<Lhs,Rhs,Option> >::type
131 typedef Product<Lhs,Rhs,Option> ProductXpr;
132 typedef typename internal::dense_xpr_base<ProductXpr>::type Base;
135 typedef typename Base::Scalar Scalar;
139 return internal::evaluator<ProductXpr>(derived()).coeff(0,0);
146 template<
typename Lhs,
typename Rhs,
int Option,
typename StorageKind>
147 class ProductImpl :
public internal::generic_xpr_base<Product<Lhs,Rhs,Option>, MatrixXpr, StorageKind>::type
150 typedef typename internal::generic_xpr_base<Product<Lhs,Rhs,Option>,
MatrixXpr, StorageKind>::type
Base;
153 template<
typename Lhs,
typename Rhs,
int Option>
155 :
public internal::dense_product_base<Lhs,Rhs,Option>
161 typedef typename internal::dense_product_base<Lhs, Rhs, Option>
Base;
165 IsOneByOne = (RowsAtCompileTime == 1 || RowsAtCompileTime ==
Dynamic) &&
166 (ColsAtCompileTime == 1 || ColsAtCompileTime ==
Dynamic),
177 return internal::evaluator<Derived>(derived()).coeff(
row,
col);
185 return internal::evaluator<Derived>(derived()).coeff(
i);
RowXpr row(Index i)
This is the const version of row(). */.
ColXpr col(Index i)
This is the const version of col().
#define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
#define EIGEN_DEVICE_FUNC
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
#define EIGEN_STATIC_ASSERT(X, MSG)
internal::dense_product_base< Lhs, Rhs, Option > Base
Scalar coeff(Index row, Index col) const
Scalar coeff(Index i) const
Product< Lhs, Rhs, Option > Derived
internal::generic_xpr_base< Product< Lhs, Rhs, Option >, MatrixXpr, StorageKind >::type Base
Expression of the product of two arbitrary matrices or vectors.
internal::remove_all_t< LhsNested > LhsNestedCleaned
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
const LhsNestedCleaned & lhs() const
internal::remove_all_t< RhsNested > RhsNestedCleaned
ProductImpl< Lhs, Rhs, Option, typename internal::product_promote_storage_type< typename internal::traits< Lhs >::StorageKind, typename internal::traits< Rhs >::StorageKind, internal::product_type< Lhs, Rhs >::ret >::ret >::Base Base
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
const RhsNestedCleaned & rhs() const
internal::ref_selector< Rhs >::type RhsNested
internal::ref_selector< Lhs >::type LhsNested
const unsigned int NoPreferredStorageOrderBit
const unsigned int RowMajorBit
constexpr int min_size_prefer_fixed(A a, B b)
typename remove_all< T >::type remove_all_t
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.