10 #ifndef EIGEN_SPARSEPRODUCT_H 11 #define EIGEN_SPARSEPRODUCT_H 15 template<
typename Lhs,
typename Rhs>
23 TransposeRhs = (!LhsRowMajor) && RhsRowMajor,
24 TransposeLhs = LhsRowMajor && (!RhsRowMajor)
32 SparseMatrix<Scalar,0,Index>,
39 template<
typename LhsNested,
typename RhsNested>
51 LhsCoeffReadCost = _LhsNested::CoeffReadCost,
52 RhsCoeffReadCost = _RhsNested::CoeffReadCost,
53 LhsFlags = _LhsNested::Flags,
54 RhsFlags = _RhsNested::Flags,
56 RowsAtCompileTime = _LhsNested::RowsAtCompileTime,
57 ColsAtCompileTime = _RhsNested::ColsAtCompileTime,
58 MaxRowsAtCompileTime = _LhsNested::MaxRowsAtCompileTime,
59 MaxColsAtCompileTime = _RhsNested::MaxColsAtCompileTime,
61 InnerSize = EIGEN_SIZE_MIN_PREFER_FIXED(_LhsNested::ColsAtCompileTime, _RhsNested::RowsAtCompileTime),
63 EvalToRowMajor = (RhsFlags & LhsFlags &
RowMajorBit),
67 Flags = (int(LhsFlags | RhsFlags) & HereditaryBits & RemovedBits)
74 typedef Sparse StorageKind;
79 template<
typename LhsNested,
typename RhsNested>
95 template<
typename Lhs,
typename Rhs>
97 : m_lhs(lhs), m_rhs(rhs), m_tolerance(0), m_conservative(
true)
102 template<
typename Lhs,
typename Rhs>
103 EIGEN_STRONG_INLINE SparseSparseProduct(
const Lhs& lhs,
const Rhs& rhs,
const RealScalar& tolerance)
104 : m_lhs(lhs), m_rhs(rhs), m_tolerance(tolerance), m_conservative(
false)
112 return SparseSparseProduct(m_lhs,m_rhs,abs(reference)*epsilon);
115 template<
typename Dest>
116 void evalTo(Dest& result)
const 124 EIGEN_STRONG_INLINE Index rows()
const {
return m_lhs.rows(); }
125 EIGEN_STRONG_INLINE Index cols()
const {
return m_rhs.cols(); }
127 EIGEN_STRONG_INLINE
const _LhsNested& lhs()
const {
return m_lhs; }
128 EIGEN_STRONG_INLINE
const _RhsNested& rhs()
const {
return m_rhs; }
133 eigen_assert(m_lhs.cols() == m_rhs.rows());
136 ProductIsValid = _LhsNested::ColsAtCompileTime==
Dynamic 137 || _RhsNested::RowsAtCompileTime==
Dynamic 138 || int(_LhsNested::ColsAtCompileTime)==int(_RhsNested::RowsAtCompileTime),
139 AreVectors = _LhsNested::IsVectorAtCompileTime && _RhsNested::IsVectorAtCompileTime,
140 SameSizes = EIGEN_PREDICATE_SAME_MATRIX_SIZE(_LhsNested,_RhsNested)
145 EIGEN_STATIC_ASSERT(ProductIsValid || !(AreVectors && SameSizes),
146 INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS)
147 EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors),
148 INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION)
149 EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT)
159 template<
typename Derived>
160 template<
typename Lhs,
typename Rhs>
163 product.evalTo(derived());
178 template<
typename Derived>
179 template<
typename OtherDerived>
188 #endif // EIGEN_SPARSEPRODUCT_H Definition: SparseProduct.h:80
A versatible sparse matrix representation.
Definition: SparseMatrix.h:85
Definition: SparseSparseProductWithPruning.h:80
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
Holds information about the various numeric (i.e.
Definition: NumTraits.h:88
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:53
Definition: XprHelper.h:32
The type used to identify a matrix expression.
Definition: Constants.h:431
Base class of any sparse matrices or sparse expressions.
Definition: ForwardDeclarations.h:239
Definition: ConservativeSparseSparseProduct.h:127
const unsigned int EvalBeforeAssigningBit
means the expression should be evaluated before any assignment
Definition: Constants.h:63
Definition: BandTriangularSolver.h:13
Definition: SparseProduct.h:16
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is stored in some runtime variable.
Definition: Constants.h:21
const unsigned int EvalBeforeNestingBit
means the expression should be evaluated by the calling expression
Definition: Constants.h:58
NumTraits< Scalar >::Real RealScalar
This is the "real scalar" type; if the Scalar type is already real numbers (e.g.
Definition: SparseMatrixBase.h:124
Definition: ForwardDeclarations.h:17
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48