File indexing completed on 2025-01-18 09:57:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef EIGEN_SKYLINEUTIL_H
0011 #define EIGEN_SKYLINEUTIL_H
0012
0013 namespace Eigen {
0014
0015 #ifdef NDEBUG
0016 #define EIGEN_DBG_SKYLINE(X)
0017 #else
0018 #define EIGEN_DBG_SKYLINE(X) X
0019 #endif
0020
0021 const unsigned int SkylineBit = 0x1200;
0022 template<typename Lhs, typename Rhs, int ProductMode> class SkylineProduct;
0023 enum AdditionalProductEvaluationMode {SkylineTimeDenseProduct, SkylineTimeSkylineProduct, DenseTimeSkylineProduct};
0024 enum {IsSkyline = SkylineBit};
0025
0026
0027 #define EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(Derived, Op) \
0028 template<typename OtherDerived> \
0029 EIGEN_STRONG_INLINE Derived& operator Op(const Eigen::SkylineMatrixBase<OtherDerived>& other) \
0030 { \
0031 return Base::operator Op(other.derived()); \
0032 } \
0033 EIGEN_STRONG_INLINE Derived& operator Op(const Derived& other) \
0034 { \
0035 return Base::operator Op(other); \
0036 }
0037
0038 #define EIGEN_SKYLINE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, Op) \
0039 template<typename Other> \
0040 EIGEN_STRONG_INLINE Derived& operator Op(const Other& scalar) \
0041 { \
0042 return Base::operator Op(scalar); \
0043 }
0044
0045 #define EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATORS(Derived) \
0046 EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(Derived, =) \
0047 EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(Derived, +=) \
0048 EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(Derived, -=) \
0049 EIGEN_SKYLINE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, *=) \
0050 EIGEN_SKYLINE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, /=)
0051
0052 #define _EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(Derived, BaseClass) \
0053 typedef BaseClass Base; \
0054 typedef typename Eigen::internal::traits<Derived>::Scalar Scalar; \
0055 typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \
0056 typedef typename Eigen::internal::traits<Derived>::StorageKind StorageKind; \
0057 typedef typename Eigen::internal::index<StorageKind>::type Index; \
0058 enum { Flags = Eigen::internal::traits<Derived>::Flags, };
0059
0060 #define EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(Derived) \
0061 _EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(Derived, Eigen::SkylineMatrixBase<Derived>)
0062
0063 template<typename Derived> class SkylineMatrixBase;
0064 template<typename _Scalar, int _Flags = 0> class SkylineMatrix;
0065 template<typename _Scalar, int _Flags = 0> class DynamicSkylineMatrix;
0066 template<typename _Scalar, int _Flags = 0> class SkylineVector;
0067 template<typename _Scalar, int _Flags = 0> class MappedSkylineMatrix;
0068
0069 namespace internal {
0070
0071 template<typename Lhs, typename Rhs> struct skyline_product_mode;
0072 template<typename Lhs, typename Rhs, int ProductMode = skyline_product_mode<Lhs,Rhs>::value> struct SkylineProductReturnType;
0073
0074 template<typename T> class eval<T,IsSkyline>
0075 {
0076 typedef typename traits<T>::Scalar _Scalar;
0077 enum {
0078 _Flags = traits<T>::Flags
0079 };
0080
0081 public:
0082 typedef SkylineMatrix<_Scalar, _Flags> type;
0083 };
0084
0085 }
0086
0087 }
0088
0089 #endif