[eigen] [PATCH] small patch int Direction -> DirectionType Direction

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Isn't it more strict and rigurous to use the enum type instead of int?

Here is a small patch to do this.

--
ricard
http://www.ricardmarxer.com
http://www.caligraft.com
Index: Eigen/src/Core/util/ForwardDeclarations.h
===================================================================
--- Eigen/src/Core/util/ForwardDeclarations.h	(revision 920585)
+++ Eigen/src/Core/util/ForwardDeclarations.h	(working copy)
@@ -100,8 +100,8 @@
 
 // Array module
 template<typename ConditionMatrixType, typename ThenMatrixType, typename ElseMatrixType> class Select;
-template<typename MatrixType, typename BinaryOp, int Direction> class PartialReduxExpr;
-template<typename ExpressionType, int Direction> class PartialRedux;
+template<typename MatrixType, typename BinaryOp, DirectionType Direction> class PartialReduxExpr;
+template<typename ExpressionType, DirectionType Direction> class PartialRedux;
 
 template<typename MatrixType> class LU;
 template<typename MatrixType> class QR;
Index: Eigen/src/Array/PartialRedux.h
===================================================================
--- Eigen/src/Array/PartialRedux.h	(revision 920585)
+++ Eigen/src/Array/PartialRedux.h	(working copy)
@@ -43,10 +43,10 @@
   * \sa class PartialRedux
   */
 
-template< typename MatrixType, typename MemberOp, int Direction>
+template< typename MatrixType, typename MemberOp, DirectionType Direction>
 class PartialReduxExpr;
 
-template<typename MatrixType, typename MemberOp, int Direction>
+template<typename MatrixType, typename MemberOp, DirectionType Direction>
 struct ei_traits<PartialReduxExpr<MatrixType, MemberOp, Direction> >
 {
   typedef typename MemberOp::result_type Scalar;
@@ -67,7 +67,7 @@
   };
 };
 
-template< typename MatrixType, typename MemberOp, int Direction>
+template< typename MatrixType, typename MemberOp, DirectionType Direction>
 class PartialReduxExpr : ei_no_assignment_operator,
   public MatrixBase<PartialReduxExpr<MatrixType, MemberOp, Direction> >
 {
@@ -149,7 +149,7 @@
   *
   * \sa MatrixBase::colwise(), MatrixBase::rowwise(), class PartialReduxExpr
   */
-template<typename ExpressionType, int Direction> class PartialRedux
+template<typename ExpressionType, DirectionType Direction> class PartialRedux
 {
   public:
 
@@ -327,7 +327,7 @@
   *
   * \sa class PartialRedux, MatrixBase::colwise(), MatrixBase::rowwise()
   */
-template<typename ExpressionType, int Direction>
+template<typename ExpressionType, DirectionType Direction>
 template<typename BinaryOp>
 const typename PartialRedux<ExpressionType,Direction>::template ReduxReturnType<BinaryOp>::Type
 PartialRedux<ExpressionType,Direction>::redux(const BinaryOp& func) const


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/