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>
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>
129 LhsIsSelfAdjoint = (_Lhs::Flags & SelfAdjointBit) == SelfAdjointBit,
130 ProcessFirstHalf = LhsIsSelfAdjoint
131 && (((_Lhs::Flags & (UpperTriangularBit | LowerTriangularBit)) == 0)
132 || ((_Lhs::Flags & UpperTriangularBit) && !LhsIsRowMajor)
133 || ((_Lhs::Flags & LowerTriangularBit) && LhsIsRowMajor)),
134 ProcessSecondHalf = LhsIsSelfAdjoint && (!ProcessFirstHalf)
145 typename _Lhs::InnerLowerIterator lIt(lhs,
row);
146 const Index stop = lIt.col() + lIt.size();
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>
192 LhsIsSelfAdjoint = (_Lhs::Flags & SelfAdjointBit) == SelfAdjointBit,
193 ProcessFirstHalf = LhsIsSelfAdjoint
194 && (((_Lhs::Flags & (UpperTriangularBit | LowerTriangularBit)) == 0)
195 || ((_Lhs::Flags & UpperTriangularBit) && !LhsIsRowMajor)
196 || ((_Lhs::Flags & LowerTriangularBit) && LhsIsRowMajor)),
197 ProcessSecondHalf = LhsIsSelfAdjoint && (!ProcessFirstHalf)
209 typename _Lhs::InnerUpperIterator uIt(lhs,
row);
210 const Index stop = uIt.col() + uIt.size();
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 SkylineProduct< LhsNested, RhsNested, ProductMode > Type
#define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
#define EIGEN_STRONG_INLINE
internal::remove_all< RhsNested >::type _RhsNested
EIGEN_DEPRECATED const unsigned int EvalBeforeAssigningBit
const internal::nested_eval< Lhs, Rhs::RowsAtCompileTime >::type LhsNested
traits< SkylineProduct >::_LhsNested _LhsNested
Namespace containing all symbols from the Eigen library.
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
const unsigned int RowMajorBit
#define EIGEN_SIZE_MIN_PREFER_FIXED(a, b)
EIGEN_STRONG_INLINE Index cols() const
#define EIGEN_DONT_INLINE
static void run(const Lhs &lhs, const Rhs &rhs, ResultType &res)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
const unsigned int HereditaryBits
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
internal::conditional< ResultIsSkyline, SkylineMatrixBase< SkylineProduct< LhsNested, RhsNested, ProductMode > >, MatrixBase< SkylineProduct< LhsNested, RhsNested, ProductMode > > >::type Base
traits< typename remove_all< Lhs >::type >::Scalar Scalar
EIGEN_DONT_INLINE void skyline_row_major_time_dense_product(const Lhs &lhs, const Rhs &rhs, Dest &dst)
const SkylineProductReturnType< Derived, OtherDerived >::Type operator*(const MatrixBase< OtherDerived > &other) const
EIGEN_STRONG_INLINE Index rows() const
internal::remove_all< LhsNested >::type _LhsNested
EIGEN_STRONG_INLINE const _RhsNested & rhs() const
_LhsNested::Scalar Scalar
const internal::nested_eval< Rhs, Lhs::RowsAtCompileTime >::type RhsNested
#define EIGEN_PREDICATE_SAME_MATRIX_SIZE(TYPE0, TYPE1)
const unsigned int SkylineBit
Base class of any skyline matrices or skyline expressions.
static void run(const Lhs &lhs, const Rhs &rhs, ResultType &res)
EIGEN_STRONG_INLINE SkylineProduct(const Lhs &lhs, const Rhs &rhs)
const unsigned int EvalBeforeNestingBit
Generic expression where a coefficient-wise unary operator is applied to an expression.
traits< typename remove_all< Lhs >::type >::Scalar Scalar
Base class for all dense matrices, vectors, and expressions.
EIGEN_STRONG_INLINE const _LhsNested & lhs() const
traits< SkylineProduct >::_RhsNested _RhsNested
EIGEN_DONT_INLINE void skyline_col_major_time_dense_product(const Lhs &lhs, const Rhs &rhs, Dest &dst)