00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef EIGEN_SKYLINEUTIL_H
00026 #define EIGEN_SKYLINEUTIL_H
00027
00028 namespace Eigen {
00029
00030 #ifdef NDEBUG
00031 #define EIGEN_DBG_SKYLINE(X)
00032 #else
00033 #define EIGEN_DBG_SKYLINE(X) X
00034 #endif
00035
00036 const unsigned int SkylineBit = 0x1200;
00037 template<typename Lhs, typename Rhs, int ProductMode> class SkylineProduct;
00038 enum AdditionalProductEvaluationMode {SkylineTimeDenseProduct, SkylineTimeSkylineProduct, DenseTimeSkylineProduct};
00039 enum {IsSkyline = SkylineBit};
00040
00041
00042 #define EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(Derived, Op) \
00043 template<typename OtherDerived> \
00044 EIGEN_STRONG_INLINE Derived& operator Op(const Eigen::SkylineMatrixBase<OtherDerived>& other) \
00045 { \
00046 return Base::operator Op(other.derived()); \
00047 } \
00048 EIGEN_STRONG_INLINE Derived& operator Op(const Derived& other) \
00049 { \
00050 return Base::operator Op(other); \
00051 }
00052
00053 #define EIGEN_SKYLINE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, Op) \
00054 template<typename Other> \
00055 EIGEN_STRONG_INLINE Derived& operator Op(const Other& scalar) \
00056 { \
00057 return Base::operator Op(scalar); \
00058 }
00059
00060 #define EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATORS(Derived) \
00061 EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(Derived, =) \
00062 EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(Derived, +=) \
00063 EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(Derived, -=) \
00064 EIGEN_SKYLINE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, *=) \
00065 EIGEN_SKYLINE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, /=)
00066
00067 #define _EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(Derived, BaseClass) \
00068 typedef BaseClass Base; \
00069 typedef typename Eigen::internal::traits<Derived>::Scalar Scalar; \
00070 typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \
00071 typedef typename Eigen::internal::traits<Derived>::StorageKind StorageKind; \
00072 typedef typename Eigen::internal::index<StorageKind>::type Index; \
00073 enum { Flags = Eigen::internal::traits<Derived>::Flags, };
00074
00075 #define EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(Derived) \
00076 _EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(Derived, Eigen::SkylineMatrixBase<Derived>)
00077
00078 template<typename Derived> class SkylineMatrixBase;
00079 template<typename _Scalar, int _Flags = 0> class SkylineMatrix;
00080 template<typename _Scalar, int _Flags = 0> class DynamicSkylineMatrix;
00081 template<typename _Scalar, int _Flags = 0> class SkylineVector;
00082 template<typename _Scalar, int _Flags = 0> class MappedSkylineMatrix;
00083
00084 namespace internal {
00085
00086 template<typename Lhs, typename Rhs> struct skyline_product_mode;
00087 template<typename Lhs, typename Rhs, int ProductMode = skyline_product_mode<Lhs,Rhs>::value> struct SkylineProductReturnType;
00088
00089 template<typename T> class eval<T,IsSkyline>
00090 {
00091 typedef typename traits<T>::Scalar _Scalar;
00092 enum {
00093 _Flags = traits<T>::Flags
00094 };
00095
00096 public:
00097 typedef SkylineMatrix<_Scalar, _Flags> type;
00098 };
00099
00100 }
00101
00102 }
00103
00104 #endif // EIGEN_SKYLINEUTIL_H