10 #ifndef EIGEN_SPARSE_DIAGONAL_PRODUCT_H
11 #define EIGEN_SPARSE_DIAGONAL_PRODUCT_H
34 template<
typename SparseXprType,
typename DiagonalCoeffType,
int SDP_Tag>
37 template<
typename Lhs,
typename Rhs,
int ProductTag>
48 template<
typename Lhs,
typename Rhs,
int ProductTag>
59 template<
typename SparseXprType,
typename DiagonalCoeffType>
64 typedef typename SparseXprType::Scalar
Scalar;
72 m_coeff(xprEval.m_diagCoeffImpl.coeff(outer))
77 typename DiagonalCoeffType::Scalar
m_coeff;
81 : m_sparseXprImpl(sparseXpr), m_diagCoeffImpl(diagCoeff)
92 template<
typename SparseXprType,
typename DiagCoeffType>
95 typedef typename SparseXprType::Scalar
Scalar;
98 typedef typename nested_eval<DiagCoeffType,SparseXprType::IsRowMajor ? SparseXprType::RowsAtCompileTime
106 : m_sparseIter(xprEval.m_sparseXprEval, outer), m_diagCoeffNested(xprEval.m_diagCoeffNested)
109 inline Scalar value()
const {
return m_sparseIter.value() * m_diagCoeffNested.coeff(index()); }
112 inline Index col()
const {
return SparseXprType::IsRowMajor ? m_sparseIter.index() : m_sparseIter.outer(); }
113 inline Index row()
const {
return SparseXprType::IsRowMajor ? m_sparseIter.outer() : m_sparseIter.index(); }
116 inline operator bool()
const {
return m_sparseIter; }
124 : m_sparseXprEval(sparseXpr), m_diagCoeffNested(diagCoeff)
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
An InnerIterator allows to loop over the element of any matrix expression.
Definition: CoreIterators.h:34
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:75
StorageIndex index() const
Definition: SparseDiagonalProduct.h:110
Index outer() const
Definition: SparseDiagonalProduct.h:111
EIGEN_STRONG_INLINE InnerIterator & operator++()
Definition: SparseDiagonalProduct.h:115
Scalar value() const
Definition: SparseDiagonalProduct.h:109
DiagCoeffNested m_diagCoeffNested
Definition: SparseDiagonalProduct.h:120
SparseXprIter m_sparseIter
Definition: SparseDiagonalProduct.h:119
evaluator< SparseXprType >::InnerIterator SparseXprIter
Definition: SparseDiagonalProduct.h:103
Index row() const
Definition: SparseDiagonalProduct.h:113
Index col() const
Definition: SparseDiagonalProduct.h:112
InnerIterator(const sparse_diagonal_product_evaluator &xprEval, Index outer)
Definition: SparseDiagonalProduct.h:105
InnerIterator(const sparse_diagonal_product_evaluator &xprEval, Index outer)
Definition: SparseDiagonalProduct.h:70
EIGEN_STRONG_INLINE Scalar value() const
Definition: SparseDiagonalProduct.h:75
DiagonalCoeffType::Scalar m_coeff
Definition: SparseDiagonalProduct.h:77
const unsigned int RowMajorBit
Definition: Constants.h:66
@ SDP_AsScalarProduct
Definition: SparseDiagonalProduct.h:30
@ SDP_AsCwiseProduct
Definition: SparseDiagonalProduct.h:31
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
@ DefaultProduct
Definition: Constants.h:500
const int HugeCost
Definition: Constants.h:44
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
type
The type the bitset is encoded with.
Definition: bitset.hpp:44
Flags
Special flags for archives.
Definition: cereal.hpp:185
Definition: document.h:416
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1282
Definition: Constants.h:531
Definition: Constants.h:537
Definition: CoreEvaluators.h:91
Definition: XprHelper.h:458
Product< Lhs, Rhs, DefaultProduct > XprType
Definition: SparseDiagonalProduct.h:41
product_evaluator(const XprType &xpr)
Definition: SparseDiagonalProduct.h:45
sparse_diagonal_product_evaluator< Rhs, typename Lhs::DiagonalVectorType, Rhs::Flags &RowMajorBit?SDP_AsScalarProduct:SDP_AsCwiseProduct > Base
Definition: SparseDiagonalProduct.h:44
product_evaluator(const XprType &xpr)
Definition: SparseDiagonalProduct.h:56
sparse_diagonal_product_evaluator< Lhs, Transpose< const typename Rhs::DiagonalVectorType >, Lhs::Flags &RowMajorBit?SDP_AsCwiseProduct:SDP_AsScalarProduct > Base
Definition: SparseDiagonalProduct.h:55
Product< Lhs, Rhs, DefaultProduct > XprType
Definition: SparseDiagonalProduct.h:52
Definition: ForwardDeclarations.h:164
SparseXprType::Scalar Scalar
Definition: SparseDiagonalProduct.h:95
evaluator< SparseXprType > m_sparseXprEval
Definition: SparseDiagonalProduct.h:130
Index nonZerosEstimate() const
Definition: SparseDiagonalProduct.h:127
nested_eval< DiagCoeffType, SparseXprType::IsRowMajor ? SparseXprType::RowsAtCompileTime :SparseXprType::ColsAtCompileTime >::type DiagCoeffNested
Definition: SparseDiagonalProduct.h:99
DiagCoeffNested m_diagCoeffNested
Definition: SparseDiagonalProduct.h:131
SparseXprType::StorageIndex StorageIndex
Definition: SparseDiagonalProduct.h:96
sparse_diagonal_product_evaluator(const SparseXprType &sparseXpr, const DiagCoeffType &diagCoeff)
Definition: SparseDiagonalProduct.h:123
evaluator< SparseXprType > m_sparseXprImpl
Definition: SparseDiagonalProduct.h:87
Index nonZerosEstimate() const
Definition: SparseDiagonalProduct.h:84
sparse_diagonal_product_evaluator(const SparseXprType &sparseXpr, const DiagonalCoeffType &diagCoeff)
Definition: SparseDiagonalProduct.h:80
SparseXprType::Scalar Scalar
Definition: SparseDiagonalProduct.h:64
evaluator< DiagonalCoeffType > m_diagCoeffImpl
Definition: SparseDiagonalProduct.h:88
evaluator< SparseXprType >::InnerIterator SparseXprInnerIterator
Definition: SparseDiagonalProduct.h:63
Definition: SparseDiagonalProduct.h:35