adapted pactch from Nick Lewycky fixing a couple of issue with CLang

This commit is contained in:
Gael Guennebaud 2010-07-15 22:48:44 +02:00
parent c0a0d2d181
commit 5ac00624ed
4 changed files with 13 additions and 13 deletions

View File

@ -139,7 +139,7 @@ inline bool MatrixBase<Derived>::any() const
template<typename Derived> template<typename Derived>
inline int MatrixBase<Derived>::count() const inline int MatrixBase<Derived>::count() const
{ {
return this->cast<bool>().cast<int>().sum(); return this->cast<bool>().template cast<int>().sum();
} }
#endif // EIGEN_ALLANDANY_H #endif // EIGEN_ALLANDANY_H

View File

@ -32,7 +32,7 @@ namespace Eigen
{ {
#define EIGEN_INSTANTIATE_PRODUCT(TYPE) \ #define EIGEN_INSTANTIATE_PRODUCT(TYPE) \
template static void ei_cache_friendly_product<TYPE>( \ template void ei_cache_friendly_product<TYPE>( \
int _rows, int _cols, int depth, \ int _rows, int _cols, int depth, \
bool _lhsRowMajor, const TYPE* _lhs, int _lhsStride, \ bool _lhsRowMajor, const TYPE* _lhs, int _lhsStride, \
bool _rhsRowMajor, const TYPE* _rhs, int _rhsStride, \ bool _rhsRowMajor, const TYPE* _rhs, int _rhsStride, \

View File

@ -35,16 +35,6 @@ template<typename T> inline T ei_random_amplitude()
else return static_cast<T>(10); else return static_cast<T>(10);
} }
template<typename T> inline T ei_hypot(T x, T y)
{
T _x = ei_abs(x);
T _y = ei_abs(y);
T p = std::max(_x, _y);
T q = std::min(_x, _y);
T qp = q/p;
return p * ei_sqrt(T(1) + qp*qp);
}
/************** /**************
*** int *** *** int ***
**************/ **************/
@ -292,4 +282,14 @@ inline bool ei_isApproxOrLessThan(long double a, long double b, long double prec
return a <= b || ei_isApprox(a, b, prec); return a <= b || ei_isApprox(a, b, prec);
} }
template<typename T> inline T ei_hypot(T x, T y)
{
T _x = ei_abs(x);
T _y = ei_abs(y);
T p = std::max(_x, _y);
T q = std::min(_x, _y);
T qp = q/p;
return p * ei_sqrt(T(1) + qp*qp);
}
#endif // EIGEN_MATHFUNCTIONS_H #endif // EIGEN_MATHFUNCTIONS_H

View File

@ -35,7 +35,7 @@ template<typename Lhs, typename Rhs,
? UpperTriangular ? UpperTriangular
: -1, : -1,
int StorageOrder = ei_is_part<Lhs>::value ? -1 // this is to solve ambiguous specializations int StorageOrder = ei_is_part<Lhs>::value ? -1 // this is to solve ambiguous specializations
: int(Lhs::Flags) & (RowMajorBit|SparseBit) : int(Lhs::Flags) & int(RowMajorBit|SparseBit)
> >
struct ei_solve_triangular_selector; struct ei_solve_triangular_selector;