From 8350ab9fb85d278cf2687efc86d211b25741c657 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 3 Jun 2010 08:41:11 +0200 Subject: * remove ei_index, and let ei_traits propagate the index types * add an Index type template parapeter to sparse objects --- Eigen/src/Core/CwiseBinaryOp.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Eigen/src/Core/CwiseBinaryOp.h') diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h index 530777577..6e158fdf1 100644 --- a/Eigen/src/Core/CwiseBinaryOp.h +++ b/Eigen/src/Core/CwiseBinaryOp.h @@ -57,6 +57,8 @@ struct ei_traits > : ei_traits >::type Scalar; typedef typename ei_promote_storage_type::StorageKind, typename ei_traits::StorageKind>::ret StorageKind; + typedef typename ei_promote_index_type::Index, + typename ei_traits::Index>::type Index; typedef typename Lhs::Nested LhsNested; typedef typename Rhs::Nested RhsNested; typedef typename ei_unref::type _LhsNested; @@ -97,7 +99,7 @@ class CwiseBinaryOp : ei_no_assignment_operator, BinaryOp, Lhs, Rhs, typename ei_promote_storage_type::StorageKind, typename ei_traits::StorageKind>::ret>::Base Base; - EIGEN_GENERIC_PUBLIC_INTERFACE_NEW(CwiseBinaryOp) + EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseBinaryOp) typedef typename ei_nested::type LhsNested; typedef typename ei_nested::type RhsNested; @@ -125,14 +127,14 @@ class CwiseBinaryOp : ei_no_assignment_operator, EIGEN_STRONG_INLINE Index rows() const { // return the fixed size type if available to enable compile time optimizations - if (ei_traits::type>::RowsAtCompileTime==Dynamic) + if (ei_traits::type>::RowsAtCompileTime==Dynamic) return m_rhs.rows(); else return m_lhs.rows(); } EIGEN_STRONG_INLINE Index cols() const { // return the fixed size type if available to enable compile time optimizations - if (ei_traits::type>::ColsAtCompileTime==Dynamic) + if (ei_traits::type>::ColsAtCompileTime==Dynamic) return m_rhs.cols(); else return m_lhs.cols(); -- cgit v1.2.3