make some changes to please clang, fix some warnings too.

This commit is contained in:
Thomas Capricelli 2010-01-04 23:21:04 +01:00
parent 95d9cb77f8
commit 57275b2b8c
9 changed files with 15 additions and 11 deletions

View File

@ -55,6 +55,10 @@
#define EIGEN_DONT_VECTORIZE #define EIGEN_DONT_VECTORIZE
#endif #endif
#ifdef __clang__
#define EIGEN_DONT_VECTORIZE
#endif
#ifndef EIGEN_DONT_VECTORIZE #ifndef EIGEN_DONT_VECTORIZE
#if defined (EIGEN_SSE2_BUT_NOT_OLD_GCC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER) #if defined (EIGEN_SSE2_BUT_NOT_OLD_GCC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER)
#define EIGEN_VECTORIZE #define EIGEN_VECTORIZE

View File

@ -381,7 +381,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
const Reverse<ExpressionType, Direction> reverse() const const Reverse<ExpressionType, Direction> reverse() const
{ return Reverse<ExpressionType, Direction>( _expression() ); } { return Reverse<ExpressionType, Direction>( _expression() ); }
const Replicate<ExpressionType,Direction==Vertical?Dynamic:1,Direction==Horizontal?Dynamic:1> const Replicate<ExpressionType,(Direction==Vertical?Dynamic:1),(Direction==Horizontal?Dynamic:1)>
replicate(int factor) const; replicate(int factor) const;
/** \nonstableyet /** \nonstableyet

View File

@ -218,7 +218,7 @@ inline float ei_norm1(const std::complex<float> &x) { return(ei_abs(x.real()) +
inline std::complex<float> ei_exp(std::complex<float> x) { return std::exp(x); } inline std::complex<float> ei_exp(std::complex<float> x) { return std::exp(x); }
inline std::complex<float> ei_sin(std::complex<float> x) { return std::sin(x); } inline std::complex<float> ei_sin(std::complex<float> x) { return std::sin(x); }
inline std::complex<float> ei_cos(std::complex<float> x) { return std::cos(x); } inline std::complex<float> ei_cos(std::complex<float> x) { return std::cos(x); }
inline std::complex<float> ei_atan2(std::complex<float>, std::complex<float> ) { ei_assert(false); return 0; } inline std::complex<float> ei_atan2(std::complex<float>, std::complex<float> ) { ei_assert(false); return 0.f; }
template<> inline std::complex<float> ei_random() template<> inline std::complex<float> ei_random()
{ {
@ -255,7 +255,7 @@ inline double ei_norm1(const std::complex<double> &x) { return(ei_abs(x.real())
inline std::complex<double> ei_exp(std::complex<double> x) { return std::exp(x); } inline std::complex<double> ei_exp(std::complex<double> x) { return std::exp(x); }
inline std::complex<double> ei_sin(std::complex<double> x) { return std::sin(x); } inline std::complex<double> ei_sin(std::complex<double> x) { return std::sin(x); }
inline std::complex<double> ei_cos(std::complex<double> x) { return std::cos(x); } inline std::complex<double> ei_cos(std::complex<double> x) { return std::cos(x); }
inline std::complex<double> ei_atan2(std::complex<double>, std::complex<double>) { ei_assert(false); return 0; } inline std::complex<double> ei_atan2(std::complex<double>, std::complex<double>) { ei_assert(false); return 0.; }
template<> inline std::complex<double> ei_random() template<> inline std::complex<double> ei_random()
{ {

View File

@ -98,7 +98,7 @@ template<typename T, int _Rows, int _Cols, int _Options> class ei_matrix_storage
inline explicit ei_matrix_storage() {} inline explicit ei_matrix_storage() {}
inline ei_matrix_storage(ei_constructor_without_unaligned_array_assert) {} inline ei_matrix_storage(ei_constructor_without_unaligned_array_assert) {}
inline ei_matrix_storage(int,int,int) {} inline ei_matrix_storage(int,int,int) {}
inline void swap(ei_matrix_storage& other) {} inline void swap(ei_matrix_storage& ) {}
inline static int rows(void) {return _Rows;} inline static int rows(void) {return _Rows;}
inline static int cols(void) {return _Cols;} inline static int cols(void) {return _Cols;}
inline void resize(int,int,int) {} inline void resize(int,int,int) {}

View File

@ -95,12 +95,14 @@ template<typename Derived> class TriangularBase : public AnyMatrixBase<Derived>
|| ((Mode==StrictlyLowerTriangular || Mode==UnitLowerTriangular) && col<row)); || ((Mode==StrictlyLowerTriangular || Mode==UnitLowerTriangular) && col<row));
} }
#ifdef EIGEN_INTERNAL_DEBUGGING
void check_coordinates_internal(int row, int col) void check_coordinates_internal(int row, int col)
{ {
#ifdef EIGEN_INTERNAL_DEBUGGING
check_coordinates(row, col); check_coordinates(row, col);
#endif
} }
#else
void check_coordinates_internal(int , int ) {}
#endif
}; };

View File

@ -313,7 +313,6 @@ struct ei_product_selfadjoint_matrix<Scalar,LhsStorageOrder,false,ConjugateLhs,
int size = cols; int size = cols;
ei_const_blas_data_mapper<Scalar, LhsStorageOrder> lhs(_lhs,lhsStride); ei_const_blas_data_mapper<Scalar, LhsStorageOrder> lhs(_lhs,lhsStride);
ei_const_blas_data_mapper<Scalar, RhsStorageOrder> rhs(_rhs,rhsStride);
if (ConjugateRhs) if (ConjugateRhs)
alpha = ei_conj(alpha); alpha = ei_conj(alpha);

View File

@ -407,10 +407,10 @@ public:
ei_aligned_free( p ); ei_aligned_free( p );
} }
bool operator!=(const aligned_allocator<T>& other) const bool operator!=(const aligned_allocator<T>& ) const
{ return false; } { return false; }
bool operator==(const aligned_allocator<T>& other) const bool operator==(const aligned_allocator<T>& ) const
{ return true; } { return true; }
}; };

View File

@ -109,7 +109,7 @@ template<int _Rows, int _Cols> struct ei_size_at_compile_time
* in order to avoid a useless copy * in order to avoid a useless copy
*/ */
template<typename T, int Sparseness = ei_traits<T>::Flags&SparseBit> class ei_eval; template<typename T, int Sparseness = ei_traits<T>::Flags&SparseBit> struct ei_eval;
template<typename T> struct ei_eval<T,IsDense> template<typename T> struct ei_eval<T,IsDense>
{ {

View File

@ -197,7 +197,6 @@ void Tridiagonalization<MatrixType>::_compute(MatrixType& matA, CoeffVectorType&
{ {
assert(matA.rows()==matA.cols()); assert(matA.rows()==matA.cols());
int n = matA.rows(); int n = matA.rows();
Matrix<Scalar,1,Dynamic> aux(n);
for (int i = 0; i<n-1; ++i) for (int i = 0; i<n-1; ++i)
{ {
int remainingSize = n-i-1; int remainingSize = n-i-1;