Advertisement
Guest User

Aron Ahmadia

a guest
Jan 22nd, 2010
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.92 KB | None | 0 0
  1. # HG changeset patch
  2. # User Aron Ahmadia <aron.ahmadia@kaust.edu.sa>
  3. # Date 1264189993 -10800
  4. # Node ID 0f1f2b9c85e201b1cef8867ccb30f5510cd551e9
  5. # Parent  2f0c3dd8b98818a5dec9b37d251614217142aedb
  6. Just touching a few files in the Eigen repository to show how adding compatibility
  7. with the IBM XLC compilers would affect the source code
  8.  
  9. diff -r 2f0c3dd8b988 -r 0f1f2b9c85e2 Eigen/src/Core/AnyMatrixBase.h
  10. --- a/Eigen/src/Core/AnyMatrixBase.h    Fri Jan 22 10:17:43 2010 +0100
  11. +++ b/Eigen/src/Core/AnyMatrixBase.h    Fri Jan 22 22:53:13 2010 +0300
  12. @@ -35,7 +35,8 @@
  13.    *
  14.    * Notice that this class is trivial, it is only used to disambiguate overloaded functions.
  15.    */
  16. -template<typename Derived> struct AnyMatrixBase
  17. +//template<typename Derived> struct AnyMatrixBase
  18. +template<template <typename, typename> class Derived> struct AnyMatrixBase
  19.  {
  20.  //   typedef typename ei_plain_matrix_type<Derived>::type PlainMatrixType;
  21.  
  22. diff -r 2f0c3dd8b988 -r 0f1f2b9c85e2 Eigen/src/Core/CwiseUnaryOp.h
  23. --- a/Eigen/src/Core/CwiseUnaryOp.h Fri Jan 22 10:17:43 2010 +0100
  24. +++ b/Eigen/src/Core/CwiseUnaryOp.h Fri Jan 22 22:53:13 2010 +0300
  25. @@ -39,7 +39,7 @@
  26.    *
  27.    * \sa MatrixBase::unaryExpr(const CustomUnaryOp &) const, class CwiseBinaryOp, class CwiseNullaryOp
  28.    */
  29. -template<typename UnaryOp, typename MatrixType>
  30. +template<typename UnaryOp, template <typename, typename> class Derived>
  31.  struct ei_traits<CwiseUnaryOp<UnaryOp, MatrixType> >
  32.   : ei_traits<MatrixType>
  33.  {
  34. @@ -59,7 +59,7 @@
  35.  template<typename UnaryOp, typename MatrixType, typename StorageType>
  36.  class CwiseUnaryOpImpl;
  37.  
  38. -template<typename UnaryOp, typename MatrixType>
  39. +template<typename UnaryOp, template <typename, typename> class MatrixType>
  40.  class CwiseUnaryOp : ei_no_assignment_operator,
  41.    public CwiseUnaryOpImpl<UnaryOp, MatrixType, typename ei_traits<MatrixType>::StorageType>
  42.  {
  43. diff -r 2f0c3dd8b988 -r 0f1f2b9c85e2 Eigen/src/Core/SelfAdjointView.h
  44. --- a/Eigen/src/Core/SelfAdjointView.h  Fri Jan 22 10:17:43 2010 +0100
  45. +++ b/Eigen/src/Core/SelfAdjointView.h  Fri Jan 22 22:53:13 2010 +0300
  46. @@ -141,7 +141,7 @@
  47.        *
  48.        * \sa rankUpdate(const MatrixBase<DerivedU>&, const MatrixBase<DerivedV>&, Scalar)
  49.        */
  50. -    template<typename DerivedU>
  51. +    template< typename DerivedU >
  52.      SelfAdjointView& rankUpdate(const MatrixBase<DerivedU>& u, Scalar alpha = Scalar(1));
  53.  
  54.  /////////// Cholesky module ///////////
  55. diff -r 2f0c3dd8b988 -r 0f1f2b9c85e2 Eigen/src/Core/TriangularMatrix.h
  56. --- a/Eigen/src/Core/TriangularMatrix.h Fri Jan 22 10:17:43 2010 +0100
  57. +++ b/Eigen/src/Core/TriangularMatrix.h Fri Jan 22 22:53:13 2010 +0300
  58. @@ -32,7 +32,7 @@
  59.    *
  60.    * \brief Base class for triangular part in a matrix
  61.    */
  62. -template<typename Derived> class TriangularBase : public AnyMatrixBase<Derived>
  63. +template<template <typename, typename> class Derived> class TriangularBase: public AnyMatrixBase<Derived>;
  64.  {
  65.    public:
  66.  
  67. diff -r 2f0c3dd8b988 -r 0f1f2b9c85e2 Eigen/src/Core/util/ForwardDeclarations.h
  68. --- a/Eigen/src/Core/util/ForwardDeclarations.h Fri Jan 22 10:17:43 2010 +0100
  69. +++ b/Eigen/src/Core/util/ForwardDeclarations.h Fri Jan 22 22:53:13 2010 +0300
  70. @@ -28,7 +28,7 @@
  71.  template<typename T> struct ei_traits;
  72.  template<typename T> struct NumTraits;
  73.  
  74. -template<typename Derived> struct AnyMatrixBase;
  75. +template<template <typename, typename> class Derived> struct AnyMatrixBase;
  76.  
  77.  template<typename _Scalar, int _Rows, int _Cols,
  78.           int _Options = EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION | AutoAlign,
  79. @@ -46,7 +46,7 @@
  80.  template<typename MatrixType> class Transpose;
  81.  template<typename MatrixType> class Conjugate;
  82.  template<typename NullaryOp, typename MatrixType>         class CwiseNullaryOp;
  83. -template<typename UnaryOp,   typename MatrixType>         class CwiseUnaryOp;
  84. +template<typename UnaryOp,   template <typename, typename> class Derived>         class CwiseUnaryOp;
  85.  template<typename ViewOp,    typename MatrixType>         class CwiseUnaryView;
  86.  template<typename BinaryOp,  typename Lhs, typename Rhs>  class CwiseBinaryOp;
  87.  template<typename BinOp, typename MatrixType>             class SelfCwiseBinaryOp;
  88. @@ -59,7 +59,7 @@
  89.  template<typename MatrixType, int Index> class Diagonal;
  90.  
  91.  template<typename MatrixType, int Options=Unaligned> class Map;
  92. -template<typename Derived> class TriangularBase;
  93. +template<template <typename, typename> class Derived> class TriangularBase;
  94.  template<typename MatrixType, unsigned int Mode> class TriangularView;
  95.  template<typename MatrixType, unsigned int Mode> class SelfAdjointView;
  96.  template<typename ExpressionType> class WithFormat;
  97. diff -r 2f0c3dd8b988 -r 0f1f2b9c85e2 Eigen/src/Core/util/Macros.h
  98. --- a/Eigen/src/Core/util/Macros.h  Fri Jan 22 10:17:43 2010 +0100
  99. +++ b/Eigen/src/Core/util/Macros.h  Fri Jan 22 22:53:13 2010 +0300
  100. @@ -218,6 +218,8 @@
  101.  #elif (defined __SUNPRO_CC)
  102.    // FIXME not sure about this one:
  103.    #define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
  104. +#elif (defined __IBMCPP__)
  105. +  #define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
  106.  #else
  107.    #error Please tell me what is the equivalent of __attribute__((aligned(n))) for your compiler
  108.  #endif
  109. diff -r 2f0c3dd8b988 -r 0f1f2b9c85e2 Eigen/src/Core/util/XprHelper.h
  110. --- a/Eigen/src/Core/util/XprHelper.h   Fri Jan 22 10:17:43 2010 +0100
  111. +++ b/Eigen/src/Core/util/XprHelper.h   Fri Jan 22 22:53:13 2010 +0300
  112. @@ -268,7 +268,7 @@
  113.  
  114.  /** \internal Helper base class to add a scalar multiple operator
  115.    * overloads for complex types */
  116. -template<typename Derived,typename Scalar,typename OtherScalar,
  117. +template<template <typename, typename> class Derived,typename Scalar,typename OtherScalar,
  118.           bool EnableIt = !ei_is_same_type<Scalar,OtherScalar>::ret >
  119.  struct ei_special_scalar_op_base : public AnyMatrixBase<Derived>
  120.  {
  121. @@ -277,7 +277,7 @@
  122.    void operator*() const;
  123.  };
  124.  
  125. -template<typename Derived,typename Scalar,typename OtherScalar>
  126. +template<template <typename, typename> class Derived,typename Scalar,typename OtherScalar>
  127.  struct ei_special_scalar_op_base<Derived,Scalar,OtherScalar,true>  : public AnyMatrixBase<Derived>
  128.  {
  129.    const CwiseUnaryOp<ei_scalar_multiple2_op<Scalar,OtherScalar>, Derived>
  130. @@ -287,9 +287,9 @@
  131.        (*static_cast<const Derived*>(this), ei_scalar_multiple2_op<Scalar,OtherScalar>(scalar));
  132.    }
  133.  
  134. -  inline friend const CwiseUnaryOp<ei_scalar_multiple2_op<Scalar,OtherScalar>, Derived>
  135. -  operator*(const OtherScalar& scalar, const Derived& matrix)
  136. -  { return static_cast<const ei_special_scalar_op_base&>(matrix).operator*(scalar); }
  137. +    inline friend const CwiseUnaryOp<ei_scalar_multiple2_op<Scalar,OtherScalar>, Derived>
  138. +      operator*(const OtherScalar& scalar, typename Eigen::ei_special_scalar_op_base<Derived,Scalar,OtherScalar,true>::Derived & matrix)
  139. +    { return static_cast<const ei_special_scalar_op_base&>(matrix).operator*(scalar); }
  140.  };
  141.  
  142.  /** \internal Gives the type of a sub-matrix or sub-vector of a matrix of type \a ExpressionType and size \a Size
  143.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement