10 #ifndef EIGEN_SKYLINEPRODUCT_H 11 #define EIGEN_SKYLINEPRODUCT_H 15 template<
typename Lhs,
typename Rhs,
int ProductMode>
23 template<
typename LhsNested,
typename RhsNested,
int ProductMode>
28 typedef typename _LhsNested::Scalar
Scalar;
31 LhsCoeffReadCost = _LhsNested::CoeffReadCost,
32 RhsCoeffReadCost = _RhsNested::CoeffReadCost,
33 LhsFlags = _LhsNested::Flags,
34 RhsFlags = _RhsNested::Flags,
36 RowsAtCompileTime = _LhsNested::RowsAtCompileTime,
37 ColsAtCompileTime = _RhsNested::ColsAtCompileTime,
40 MaxRowsAtCompileTime = _LhsNested::MaxRowsAtCompileTime,
41 MaxColsAtCompileTime = _RhsNested::MaxColsAtCompileTime,
61 template<
typename LhsNested,
typename RhsNested,
int ProductMode>
63 public traits<SkylineProduct<LhsNested, RhsNested, ProductMode> >::Base {
75 template<
typename Lhs,
typename Rhs>
77 : m_lhs(lhs), m_rhs(rhs) {
81 ProductIsValid = _LhsNested::ColsAtCompileTime ==
Dynamic 82 || _RhsNested::RowsAtCompileTime ==
Dynamic 83 || int(_LhsNested::ColsAtCompileTime) == int(_RhsNested::RowsAtCompileTime),
84 AreVectors = _LhsNested::IsVectorAtCompileTime && _RhsNested::IsVectorAtCompileTime,
91 INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS)
93 INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION)
121 template<
typename Lhs,
typename Rhs,
typename Dest>
130 ProcessFirstHalf = LhsIsSelfAdjoint
134 ProcessSecondHalf = LhsIsSelfAdjoint && (!ProcessFirstHalf)
138 for (Index
col = 0;
col < rhs.cols();
col++) {
139 for (Index
row = 0;
row < lhs.rows();
row++) {
144 for (Index
row = 0;
row < lhs.rows();
row++) {
145 typename _Lhs::InnerLowerIterator lIt(lhs,
row);
146 const Index stop = lIt.col() + lIt.size();
147 for (Index
col = 0;
col < rhs.cols();
col++) {
164 for (Index lhscol = 0; lhscol < lhs.cols(); lhscol++) {
165 typename _Lhs::InnerUpperIterator uIt(lhs, lhscol);
166 const Index stop = uIt.size() + uIt.row();
167 for (Index rhscol = 0; rhscol < rhs.cols(); rhscol++) {
170 const Scalar rhsCoeff = rhs.coeff(lhscol, rhscol);
184 template<
typename Lhs,
typename Rhs,
typename Dest>
193 ProcessFirstHalf = LhsIsSelfAdjoint
197 ProcessSecondHalf = LhsIsSelfAdjoint && (!ProcessFirstHalf)
201 for (Index
col = 0;
col < rhs.cols();
col++) {
202 for (Index
row = 0;
row < lhs.rows();
row++) {
208 for (Index
row = 0;
row < lhs.rows();
row++) {
209 typename _Lhs::InnerUpperIterator uIt(lhs,
row);
210 const Index stop = uIt.col() + uIt.size();
211 for (Index
col = 0;
col < rhs.cols();
col++) {
229 for (Index lhscol = 0; lhscol < lhs.cols(); lhscol++) {
230 typename _Lhs::InnerLowerIterator lIt(lhs, lhscol);
231 const Index stop = lIt.size() + lIt.row();
232 for (Index rhscol = 0; rhscol < rhs.cols(); rhscol++) {
234 const Scalar rhsCoeff = rhs.coeff(lhscol, rhscol);
248 template<
typename Lhs,
typename Rhs,
typename ResultType,
252 template<
typename Lhs,
typename Rhs,
typename ResultType>
256 static void run(
const Lhs& lhs,
const Rhs&
rhs, ResultType & res) {
257 skyline_row_major_time_dense_product<Lhs, Rhs, ResultType > (lhs,
rhs, res);
261 template<
typename Lhs,
typename Rhs,
typename ResultType>
265 static void run(
const Lhs& lhs,
const Rhs&
rhs, ResultType & res) {
266 skyline_col_major_time_dense_product<Lhs, Rhs, ResultType > (lhs,
rhs, res);
285 template<
typename Derived>
286 template<
typename OtherDerived >
295 #endif // EIGEN_SKYLINEPRODUCT_H #define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
EIGEN_STRONG_INLINE Index cols() const
SkylineProduct< LhsNested, RhsNested, ProductMode > Type
internal::remove_all< RhsNested >::type _RhsNested
#define EIGEN_STRONG_INLINE
traits< SkylineProduct >::_LhsNested _LhsNested
const unsigned int UpperTriangularBit
iterative scaling algorithm to equilibrate rows and column norms in matrices
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
#define EIGEN_SIZE_MIN_PREFER_FIXED(a, b)
const unsigned int RowMajorBit
static void run(const Lhs &lhs, const Rhs &rhs, ResultType &res)
const unsigned int HereditaryBits
EIGEN_STRONG_INLINE Index rows() const
const unsigned int SelfAdjointBit
EIGEN_STRONG_INLINE const _RhsNested & rhs() const
EIGEN_STRONG_INLINE const _LhsNested & lhs() const
internal::conditional< ResultIsSkyline, SkylineMatrixBase< SkylineProduct< LhsNested, RhsNested, ProductMode > >, MatrixBase< SkylineProduct< LhsNested, RhsNested, ProductMode > > >::type Base
traits< typename remove_all< Lhs >::type >::Scalar Scalar
const unsigned int EvalBeforeAssigningBit
EIGEN_DONT_INLINE void skyline_row_major_time_dense_product(const Lhs &lhs, const Rhs &rhs, Dest &dst)
const unsigned int LowerTriangularBit
internal::remove_all< LhsNested >::type _LhsNested
void rhs(const real_t *x, real_t *f)
_LhsNested::Scalar Scalar
#define EIGEN_PREDICATE_SAME_MATRIX_SIZE(TYPE0, TYPE1)
const internal::nested< Lhs, Rhs::RowsAtCompileTime >::type LhsNested
const unsigned int SkylineBit
Base class of any skyline matrices or skyline expressions.
static void run(const Lhs &lhs, const Rhs &rhs, ResultType &res)
const SkylineProductReturnType< Derived, OtherDerived >::Type operator*(const MatrixBase< OtherDerived > &other) const
EIGEN_STRONG_INLINE SkylineProduct(const Lhs &lhs, const Rhs &rhs)
#define EIGEN_DONT_INLINE
const unsigned int EvalBeforeNestingBit
const internal::nested< Rhs, Lhs::RowsAtCompileTime >::type RhsNested
traits< typename remove_all< Lhs >::type >::Scalar Scalar
Base class for all dense matrices, vectors, and expressions.
traits< SkylineProduct >::_RhsNested _RhsNested
EIGEN_DONT_INLINE void skyline_col_major_time_dense_product(const Lhs &lhs, const Rhs &rhs, Dest &dst)