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>
48template<
typename Lhs,
typename Rhs,
int ProductTag>
59template<
typename SparseXprType,
typename DiagonalCoeffType>
64 typedef typename SparseXprType::Scalar Scalar;
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;
84 Index nonZerosEstimate()
const {
return m_sparseXprImpl.nonZerosEstimate(); }
92template<
typename SparseXprType,
typename DiagCoeffType>
95 typedef typename SparseXprType::Scalar Scalar;
96 typedef typename SparseXprType::StorageIndex StorageIndex;
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()); }
110 inline StorageIndex index()
const {
return m_sparseIter.index(); }
111 inline Index outer()
const {
return m_sparseIter.outer(); }
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(); }
115 EIGEN_STRONG_INLINE
InnerIterator& operator++() { ++m_sparseIter;
return *
this; }
116 inline operator bool()
const {
return m_sparseIter; }
127 Index nonZerosEstimate()
const {
return m_sparseXprEval.nonZerosEstimate(); }
131 DiagCoeffNested m_diagCoeffNested;
EIGEN_DEVICE_FUNC TransposeReturnType transpose()
Definition Transpose.h:182
An InnerIterator allows to loop over the element of any matrix expression.
Definition CoreIterators.h:34
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal()
Definition Diagonal.h:187
Expression of the product of two arbitrary matrices or vectors.
Definition Product.h:75
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
const int HugeCost
This value means that the cost to evaluate an expression coefficient is either very expensive or cann...
Definition Constants.h:44
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
Definition Constants.h:531
Definition Constants.h:537
Definition CoreEvaluators.h:91
Definition XprHelper.h:458
Definition ForwardDeclarations.h:164
Definition SparseDiagonalProduct.h:35