10#ifndef EIGEN_PRODUCT_H
11#define EIGEN_PRODUCT_H
15template<
typename Lhs,
typename Rhs,
int Option,
typename StorageKind>
class ProductImpl;
37template<typename Lhs, typename Rhs, typename LhsShape = typename evaluator_traits<Lhs>::Shape,
38 typename RhsShape =
typename evaluator_traits<Rhs>::Shape >
44template<
typename Lhs,
typename Rhs,
typename RhsShape>
47 typedef typename Rhs::Scalar Scalar;
50template<
typename Lhs,
typename Rhs,
typename LhsShape>
53 typedef typename Lhs::Scalar Scalar;
56template<
typename Lhs,
typename Rhs,
typename RhsShape>
59 typedef typename Rhs::Scalar Scalar;
62template<
typename Lhs,
typename Rhs,
typename LhsShape>
65 typedef typename Lhs::Scalar Scalar;
68template<
typename Lhs,
typename Rhs,
int Option>
78 typedef typename product_result_scalar<LhsCleaned,RhsCleaned>::Scalar Scalar;
80 typename RhsTraits::StorageKind,
86 RowsAtCompileTime = LhsTraits::RowsAtCompileTime,
87 ColsAtCompileTime = RhsTraits::ColsAtCompileTime,
88 MaxRowsAtCompileTime = LhsTraits::MaxRowsAtCompileTime,
89 MaxColsAtCompileTime = RhsTraits::MaxColsAtCompileTime,
92 InnerSize = EIGEN_SIZE_MIN_PREFER_FIXED(LhsTraits::ColsAtCompileTime, RhsTraits::RowsAtCompileTime),
95 Flags = (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1) ?
RowMajorBit
96 : (MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1) ? 0
106template<
typename _Lhs,
typename _Rhs,
int Option>
108 typename internal::product_promote_storage_type<typename internal::traits<_Lhs>::StorageKind,
109 typename internal::traits<_Rhs>::StorageKind,
110 internal::product_type<_Lhs,_Rhs>::ret>::ret>
122 EIGEN_GENERIC_PUBLIC_INTERFACE(
Product)
131 eigen_assert(lhs.cols() == rhs.rows()
132 &&
"invalid matrix product"
133 &&
"if you wanted a coeff-wise or a dot product use the respective explicit functions");
156template<
typename Lhs,
typename Rhs,
int Option>
164 typedef typename Base::Scalar Scalar;
166 operator const Scalar()
const
175template<
typename Lhs,
typename Rhs,
int Option,
typename StorageKind>
182template<
typename Lhs,
typename Rhs,
int Option>
191 EIGEN_DENSE_PUBLIC_INTERFACE(
Derived)
194 IsOneByOne = (RowsAtCompileTime == 1 || RowsAtCompileTime == Dynamic) &&
195 (ColsAtCompileTime == 1 || ColsAtCompileTime == Dynamic),
196 EnableCoeff = IsOneByOne || Option==LazyProduct
203 EIGEN_STATIC_ASSERT(EnableCoeff, THIS_METHOD_IS_ONLY_FOR_INNER_OR_LAZY_PRODUCTS);
204 eigen_assert( (Option==LazyProduct) || (this->rows() == 1 && this->cols() == 1) );
211 EIGEN_STATIC_ASSERT(EnableCoeff, THIS_METHOD_IS_ONLY_FOR_INNER_OR_LAZY_PRODUCTS);
212 eigen_assert( (Option==LazyProduct) || (this->rows() == 1 && this->cols() == 1) );
Expression of the product of two arbitrary matrices or vectors.
Definition Product.h:111
Pseudo expression representing a solving operation.
Definition Solve.h:63
const unsigned int NoPreferredStorageOrderBit
for an expression, this means that the storage order can be either row-major or column-major.
Definition Constants.h:172
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:61
The type used to identify a dense storage.
Definition Constants.h:490
The type used to identify a matrix expression.
Definition Constants.h:505
Definition Constants.h:518
Definition Constants.h:519
Definition XprHelper.h:428
Definition CoreEvaluators.h:82
Definition XprHelper.h:445
Definition GeneralProduct.h:36
Definition ForwardDeclarations.h:17