10#ifndef EIGEN_PRODUCT_H
11#define EIGEN_PRODUCT_H
15template<
typename Lhs,
typename Rhs,
int Option,
typename StorageKind>
class ProductImpl;
19template<
typename Lhs,
typename Rhs,
int Option>
22 typedef typename remove_all<Lhs>::type LhsCleaned;
23 typedef typename remove_all<Rhs>::type RhsCleaned;
31 typename RhsTraits::StorageKind,
37 RowsAtCompileTime = LhsTraits::RowsAtCompileTime,
38 ColsAtCompileTime = RhsTraits::ColsAtCompileTime,
39 MaxRowsAtCompileTime = LhsTraits::MaxRowsAtCompileTime,
40 MaxColsAtCompileTime = RhsTraits::MaxColsAtCompileTime,
43 InnerSize = EIGEN_SIZE_MIN_PREFER_FIXED(LhsTraits::ColsAtCompileTime, RhsTraits::RowsAtCompileTime),
46 Flags = (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1) ?
RowMajorBit
47 : (MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1) ? 0
70template<
typename _Lhs,
typename _Rhs,
int Option>
72 typename internal::product_promote_storage_type<typename internal::traits<_Lhs>::StorageKind,
73 typename internal::traits<_Rhs>::StorageKind,
74 internal::product_type<_Lhs,_Rhs>::ret>::ret>
86 EIGEN_GENERIC_PUBLIC_INTERFACE(
Product)
90 typedef typename internal::remove_all<LhsNested>::type LhsNestedCleaned;
91 typedef typename internal::remove_all<RhsNested>::type RhsNestedCleaned;
93 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
94 Product(
const Lhs& lhs,
const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs)
96 eigen_assert(lhs.cols() == rhs.rows()
97 &&
"invalid matrix product"
98 &&
"if you wanted a coeff-wise or a dot product use the respective explicit functions");
101 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
102 Index rows()
const EIGEN_NOEXCEPT {
return m_lhs.rows(); }
103 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
104 Index cols()
const EIGEN_NOEXCEPT {
return m_rhs.cols(); }
106 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
107 const LhsNestedCleaned& lhs()
const {
return m_lhs; }
108 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
109 const RhsNestedCleaned& rhs()
const {
return m_rhs; }
125template<
typename Lhs,
typename Rhs,
int Option>
133 typedef typename Base::Scalar Scalar;
135 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
operator const Scalar()
const
144template<
typename Lhs,
typename Rhs,
int Option,
typename StorageKind>
151template<
typename Lhs,
typename Rhs,
int Option>
160 EIGEN_DENSE_PUBLIC_INTERFACE(
Derived)
163 IsOneByOne = (RowsAtCompileTime == 1 || RowsAtCompileTime ==
Dynamic) &&
164 (ColsAtCompileTime == 1 || ColsAtCompileTime ==
Dynamic),
165 EnableCoeff = IsOneByOne || Option==LazyProduct
170 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar coeff(
Index row,
Index col)
const
172 EIGEN_STATIC_ASSERT(EnableCoeff, THIS_METHOD_IS_ONLY_FOR_INNER_OR_LAZY_PRODUCTS);
173 eigen_assert( (Option==LazyProduct) || (this->rows() == 1 && this->cols() == 1) );
178 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar coeff(
Index i)
const
180 EIGEN_STATIC_ASSERT(EnableCoeff, THIS_METHOD_IS_ONLY_FOR_INNER_OR_LAZY_PRODUCTS);
181 eigen_assert( (Option==LazyProduct) || (this->rows() == 1 && this->cols() == 1) );
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Expression of the product of two arbitrary matrices or vectors.
Definition Product.h:75
const unsigned int NoPreferredStorageOrderBit
for an expression, this means that the storage order can be either row-major or column-major.
Definition Constants.h:178
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:66
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time,...
Definition Constants.h:22
The type used to identify a dense storage.
Definition Constants.h:507
The type used to identify a matrix expression.
Definition Constants.h:522
Definition XprHelper.h:484
Definition CoreEvaluators.h:91
Definition XprHelper.h:501
Definition GeneralProduct.h:52
Definition ForwardDeclarations.h:17