[eigen] [PATCH] small patch int Direction -> DirectionType Direction |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] [PATCH] small patch int Direction -> DirectionType Direction
- From: Ricard Marxer Piñón <email@xxxxxxxxxxxxxxxx>
- Date: Tue, 3 Feb 2009 11:29:28 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=2YwltQPwojLTFd1SZjr16J6fwtwMZu7h7x1BW2a6ijY=; b=jXYM67NJUlRYdCQzz13IhHyjGuYcy4EhdHXg4HYYZztFcHXLNU1/62vFLQzr3TQm/W CKsgQ3pnnl1qAz+pl7qB/CltGT0D/xGXoYnj/IspVYapeQOrKyki+ObLlmQ/LnubjpzL aapPY2Kqkq/bUZ5nOwqD0sCoNJojsYx0EGl0g=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=FfNAM8AcRvxLErsCnmGXVzDycztDYX/vDEQ9cKEFL46DhgSe709GUPcpBokviELyrc HViL1jiH7BNJ/8FMeTneXyBjkPI40P7oti1IXlBezRajILRZwNLzCQvMLczF//BbEHit hK3n/1iTsAyujefGX5vaiRzZwcZRHgxEEIIeY=
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