From ab17f9272898390efff279c864a40f928752be43 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 10 Jul 2009 16:27:01 +0200 Subject: [PATCH] more sun studio fixes --- Eigen/src/Core/CwiseUnaryView.h | 2 +- Eigen/src/Core/Product.h | 6 ++++-- Eigen/src/Core/util/Constants.h | 7 ------- Eigen/src/Core/util/XprHelper.h | 11 +++++++++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Eigen/src/Core/CwiseUnaryView.h b/Eigen/src/Core/CwiseUnaryView.h index 8d8b51b4c..4785f01f4 100644 --- a/Eigen/src/Core/CwiseUnaryView.h +++ b/Eigen/src/Core/CwiseUnaryView.h @@ -45,7 +45,7 @@ struct ei_traits > ViewOp(typename ei_traits::Scalar) >::type Scalar; typedef typename MatrixType::Nested MatrixTypeNested; - typedef typename ei_unref::type _MatrixTypeNested; + typedef typename ei_cleantype::type _MatrixTypeNested; enum { Flags = (ei_traits<_MatrixTypeNested>::Flags & (HereditaryBits | LinearAccessBit | AlignedBit)), CoeffReadCost = ei_traits<_MatrixTypeNested>::CoeffReadCost + ei_functor_traits::Cost diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index 2589d548e..c2317e425 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -83,13 +83,15 @@ struct ProductReturnType template struct ei_product_mode { enum{ + // workaround sun studio: + LhsIsVectorAtCompileTime = ei_traits::ColsAtCompileTime==1 || ei_traits::ColsAtCompileTime==1, value = ei_is_diagonal::ret || ei_is_diagonal::ret ? DiagonalProduct : ei_traits::MaxColsAtCompileTime == Dynamic && ( ei_traits::MaxRowsAtCompileTime == Dynamic || ei_traits::MaxColsAtCompileTime == Dynamic ) - && (!(ei_traits::IsVectorAtCompileTime && (ei_traits::Flags&RowMajorBit) && (!(ei_traits::Flags&DirectAccessBit)))) - && (!(ei_traits::IsVectorAtCompileTime && (!(ei_traits::Flags&RowMajorBit)) && (!(ei_traits::Flags&DirectAccessBit)))) + && (!(Rhs::IsVectorAtCompileTime && (ei_traits::Flags&RowMajorBit) && (!(ei_traits::Flags&DirectAccessBit)))) + && (!(LhsIsVectorAtCompileTime && (!(ei_traits::Flags&RowMajorBit)) && (!(ei_traits::Flags&DirectAccessBit)))) && (ei_is_same_type::Scalar, typename ei_traits::Scalar>::ret) ? CacheFriendlyProduct : NormalProduct }; diff --git a/Eigen/src/Core/util/Constants.h b/Eigen/src/Core/util/Constants.h index 572cf7caf..585415662 100644 --- a/Eigen/src/Core/util/Constants.h +++ b/Eigen/src/Core/util/Constants.h @@ -198,13 +198,6 @@ const unsigned int SelfAdjoint = SelfAdjointBit; const unsigned int UnitUpperTriangular = UpperTriangularBit | UnitDiagBit; const unsigned int UnitLowerTriangular = LowerTriangularBit | UnitDiagBit; -template struct ei_is_diagonal -{ - enum { - ret = ( int(ei_traits::Flags) & DiagonalBits ) == DiagonalBits - }; -}; - enum { Aligned, Unaligned }; enum { ForceAligned, AsRequested }; enum { ConditionalJumpCost = 5 }; diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h index b8d6aeb35..d8bbe11d5 100644 --- a/Eigen/src/Core/util/XprHelper.h +++ b/Eigen/src/Core/util/XprHelper.h @@ -217,7 +217,7 @@ template::ret > struct ei_special_scalar_op_base { - // dummy operator* so that the + // dummy operator* so that the // "using ei_special_scalar_op_base::operator*" compiles void operator*() const; }; @@ -249,7 +249,7 @@ template struct HNormalizedReturnType { typedef Block::ColsAtCompileTime==1 ? SizeMinusOne : 1, ei_traits::ColsAtCompileTime==1 ? 1 : SizeMinusOne> StartMinusOne; - typedef CwiseUnaryOp::Scalar>, + typedef CwiseUnaryOp::Scalar>, NestByValue > Type; }; @@ -262,4 +262,11 @@ template struct ei_cast_return_type const XprType&,CastType>::ret type; }; +template struct ei_is_diagonal +{ + enum { + ret = ( int(ei_traits::Flags) & DiagonalBits ) == DiagonalBits + }; +}; + #endif // EIGEN_XPRHELPER_H