10#ifndef EIGEN_SPARSE_DIAGONAL_PRODUCT_H
11#define EIGEN_SPARSE_DIAGONAL_PRODUCT_H
34template<
typename SparseXprType,
typename DiagonalCoeffType,
int SDP_Tag>
37template<
typename Lhs,
typename Rhs,
int ProductTag>
42 enum { CoeffReadCost = HugeCost, Flags = Rhs::Flags&
RowMajorBit, Alignment = 0 };
48template<
typename Lhs,
typename Rhs,
int ProductTag>
53 enum { CoeffReadCost = HugeCost, Flags = Lhs::Flags&
RowMajorBit, Alignment = 0 };
59template<
typename SparseXprType,
typename DiagonalCoeffType>
64 typedef typename SparseXprType::Scalar Scalar;
71 : SparseXprInnerIterator(
xprEval.m_sparseXprImpl, outer),
72 m_coeff(
xprEval.m_diagCoeffImpl.coeff(outer))
75 EIGEN_STRONG_INLINE Scalar value()
const {
return m_coeff * SparseXprInnerIterator::value(); }
77 typename DiagonalCoeffType::Scalar m_coeff;
90template<
typename SparseXprType,
typename DiagCoeffType>
93 typedef typename SparseXprType::Scalar Scalar;
94 typedef typename SparseXprType::StorageIndex StorageIndex;
104 : m_sparseIter(
xprEval.m_sparseXprEval, outer), m_diagCoeffNested(
xprEval.m_diagCoeffNested)
107 inline Scalar value()
const {
return m_sparseIter.value() * m_diagCoeffNested.coeff(index()); }
108 inline StorageIndex index()
const {
return m_sparseIter.index(); }
109 inline Index outer()
const {
return m_sparseIter.outer(); }
110 inline Index col()
const {
return SparseXprType::IsRowMajor ? m_sparseIter.index() : m_sparseIter.outer(); }
111 inline Index row()
const {
return SparseXprType::IsRowMajor ? m_sparseIter.outer() : m_sparseIter.index(); }
113 EIGEN_STRONG_INLINE
InnerIterator& operator++() { ++m_sparseIter;
return *
this; }
114 inline operator bool()
const {
return m_sparseIter; }
127 DiagCoeffNested m_diagCoeffNested;
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:111
Pseudo expression representing a solving operation.
Definition Solve.h:63
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:61
Definition Constants.h:514
Definition Constants.h:520
Definition CoreEvaluators.h:82
Definition XprHelper.h:398
Definition ForwardDeclarations.h:165
Definition SparseDiagonalProduct.h:35