SkylineUtil.h
Go to the documentation of this file.
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2009 Guillaume Saupin <guillaume.saupin@cea.fr>
00005 //
00006 // Eigen is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 3 of the License, or (at your option) any later version.
00010 //
00011 // Alternatively, you can redistribute it and/or
00012 // modify it under the terms of the GNU General Public License as
00013 // published by the Free Software Foundation; either version 2 of
00014 // the License, or (at your option) any later version.
00015 //
00016 // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
00017 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00018 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
00019 // GNU General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License and a copy of the GNU General Public License along with
00023 // Eigen. If not, see <http://www.gnu.org/licenses/>.
00024 
00025 #ifndef EIGEN_SKYLINEUTIL_H
00026 #define EIGEN_SKYLINEUTIL_H
00027 
00028 #ifdef NDEBUG
00029 #define EIGEN_DBG_SKYLINE(X)
00030 #else
00031 #define EIGEN_DBG_SKYLINE(X) X
00032 #endif
00033 
00034 const unsigned int SkylineBit = 0x1200;
00035 template<typename Lhs, typename Rhs, int ProductMode> class SkylineProduct;
00036 enum AdditionalProductEvaluationMode {SkylineTimeDenseProduct, SkylineTimeSkylineProduct, DenseTimeSkylineProduct};
00037 enum {IsSkyline = SkylineBit};
00038 
00039 
00040 #define EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(Derived, Op) \
00041 template<typename OtherDerived> \
00042 EIGEN_STRONG_INLINE Derived& operator Op(const Eigen::SkylineMatrixBase<OtherDerived>& other) \
00043 { \
00044   return Base::operator Op(other.derived()); \
00045 } \
00046 EIGEN_STRONG_INLINE Derived& operator Op(const Derived& other) \
00047 { \
00048   return Base::operator Op(other); \
00049 }
00050 
00051 #define EIGEN_SKYLINE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, Op) \
00052 template<typename Other> \
00053 EIGEN_STRONG_INLINE Derived& operator Op(const Other& scalar) \
00054 { \
00055   return Base::operator Op(scalar); \
00056 }
00057 
00058 #define EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATORS(Derived) \
00059   EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(Derived, =) \
00060   EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(Derived, +=) \
00061   EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(Derived, -=) \
00062   EIGEN_SKYLINE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, *=) \
00063   EIGEN_SKYLINE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, /=)
00064 
00065 #define _EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(Derived, BaseClass) \
00066   typedef BaseClass Base; \
00067   typedef typename Eigen::internal::traits<Derived>::Scalar Scalar; \
00068   typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \
00069   typedef typename Eigen::internal::traits<Derived>::StorageKind StorageKind; \
00070   typedef typename Eigen::internal::index<StorageKind>::type Index; \
00071   enum {  Flags = Eigen::internal::traits<Derived>::Flags, };
00072 
00073 #define EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(Derived) \
00074   _EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(Derived, Eigen::SkylineMatrixBase<Derived>)
00075 
00076 template<typename Derived> class SkylineMatrixBase;
00077 template<typename _Scalar, int _Flags = 0> class SkylineMatrix;
00078 template<typename _Scalar, int _Flags = 0> class DynamicSkylineMatrix;
00079 template<typename _Scalar, int _Flags = 0> class SkylineVector;
00080 template<typename _Scalar, int _Flags = 0> class MappedSkylineMatrix;
00081 
00082 namespace internal {
00083 
00084 template<typename Lhs, typename Rhs> struct skyline_product_mode;
00085 template<typename Lhs, typename Rhs, int ProductMode = skyline_product_mode<Lhs,Rhs>::value> struct SkylineProductReturnType;
00086 
00087 template<typename T> class eval<T,IsSkyline>
00088 {
00089     typedef typename traits<T>::Scalar _Scalar;
00090     enum {
00091           _Flags = traits<T>::Flags
00092     };
00093 
00094   public:
00095     typedef SkylineMatrix<_Scalar, _Flags> type;
00096 };
00097 
00098 } // end namespace internal
00099 
00100 
00101 #endif // EIGEN_SKYLINEUTIL_H


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:32:32