Added to possibility to compile unit tests at maximum warning level.

Silenced (amongst others) many conversion related warnings.
This commit is contained in:
Hauke Heibel 2009-12-12 11:39:07 +01:00
parent 494a88685e
commit d088ee35f6
38 changed files with 135 additions and 44 deletions

View File

@ -124,7 +124,8 @@ endif(EIGEN_TEST_NO_EXPLICIT_VECTORIZATION)
option(EIGEN_TEST_C++0x "Enables all C++0x features." OFF) option(EIGEN_TEST_C++0x "Enables all C++0x features." OFF)
option(EIGEN_TEST_RVALUE_REF_SUPPORT "Enable rvalue references for unit tests." OFF) option(EIGEN_TEST_MAX_WARNING_LEVEL "Sets the warning level to /Wall while building the unit tests." OFF)
mark_as_advanced(EIGEN_TEST_MAX_WARNING_LEVEL)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})

View File

@ -43,6 +43,8 @@ struct ei_scalar_add_op {
inline const PacketScalar packetOp(const PacketScalar& a) const inline const PacketScalar packetOp(const PacketScalar& a) const
{ return ei_padd(a, ei_pset1(m_other)); } { return ei_padd(a, ei_pset1(m_other)); }
const Scalar m_other; const Scalar m_other;
private:
ei_scalar_add_op& operator=(const ei_scalar_add_op&);
}; };
template<typename Scalar> template<typename Scalar>
struct ei_functor_traits<ei_scalar_add_op<Scalar> > struct ei_functor_traits<ei_scalar_add_op<Scalar> >
@ -128,6 +130,8 @@ struct ei_scalar_pow_op {
inline ei_scalar_pow_op(const Scalar& exponent) : m_exponent(exponent) {} inline ei_scalar_pow_op(const Scalar& exponent) : m_exponent(exponent) {}
inline Scalar operator() (const Scalar& a) const { return ei_pow(a, m_exponent); } inline Scalar operator() (const Scalar& a) const { return ei_pow(a, m_exponent); }
const Scalar m_exponent; const Scalar m_exponent;
private:
ei_scalar_pow_op& operator=(const ei_scalar_pow_op&);
}; };
template<typename Scalar> template<typename Scalar>
struct ei_functor_traits<ei_scalar_pow_op<Scalar> > struct ei_functor_traits<ei_scalar_pow_op<Scalar> >

View File

@ -147,6 +147,8 @@ struct ei_member_redux {
inline result_type operator()(const MatrixBase<Derived>& mat) const inline result_type operator()(const MatrixBase<Derived>& mat) const
{ return mat.redux(m_functor); } { return mat.redux(m_functor); }
const BinaryOp m_functor; const BinaryOp m_functor;
private:
ei_member_redux& operator=(const ei_member_redux&);
}; };
/** \array_module \ingroup Array_Module /** \array_module \ingroup Array_Module

View File

@ -275,6 +275,8 @@ struct ei_solve_retval<LDLT<_MatrixType>, Rhs>
dst = rhs(); dst = rhs();
dec().solveInPlace(dst); dec().solveInPlace(dst);
} }
private:
ei_solve_retval& operator=(const ei_solve_retval&);
}; };
/** This is the \em in-place version of solve(). /** This is the \em in-place version of solve().

View File

@ -270,6 +270,8 @@ struct ei_solve_retval<LLT<_MatrixType, UpLo>, Rhs>
dst = rhs(); dst = rhs();
dec().solveInPlace(dst); dec().solveInPlace(dst);
} }
private:
ei_solve_retval_base& operator=(const ei_solve_retval_base&);
}; };
/** This is the \em in-place version of solve(). /** This is the \em in-place version of solve().

View File

@ -111,6 +111,9 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas
protected: protected:
ExpressionTypeNested m_matrix; ExpressionTypeNested m_matrix;
private:
Flagged& operator=(const Flagged&);
}; };
/** \deprecated it is only used by lazy() which is deprecated /** \deprecated it is only used by lazy() which is deprecated

View File

@ -150,8 +150,10 @@ template<typename MatrixType, unsigned int UpLo> class SelfAdjointView
const LDLT<PlainMatrixType> ldlt() const; const LDLT<PlainMatrixType> ldlt() const;
protected: protected:
const typename MatrixType::Nested m_matrix; const typename MatrixType::Nested m_matrix;
private:
SelfAdjointView& operator=(const SelfAdjointView&);
}; };

View File

@ -210,15 +210,15 @@ template<typename T, bool Align> inline void ei_conditional_aligned_delete(T *pt
} }
/** \internal \returns the number of elements which have to be skipped such that data are 16 bytes aligned */ /** \internal \returns the number of elements which have to be skipped such that data are 16 bytes aligned */
template<typename Scalar> template<typename Scalar, typename Integer>
inline static int ei_alignmentOffset(const Scalar* ptr, int maxOffset) inline static Integer ei_alignmentOffset(const Scalar* ptr, Integer maxOffset)
{ {
typedef typename ei_packet_traits<Scalar>::type Packet; typedef typename ei_packet_traits<Scalar>::type Packet;
const int PacketSize = ei_packet_traits<Scalar>::size; const Integer PacketSize = ei_packet_traits<Scalar>::size;
const int PacketAlignedMask = PacketSize-1; const Integer PacketAlignedMask = PacketSize-1;
const bool Vectorized = PacketSize>1; const bool Vectorized = PacketSize>1;
return Vectorized return Vectorized
? std::min<int>( (PacketSize - (int((size_t(ptr)/sizeof(Scalar))) & PacketAlignedMask)) ? std::min<Integer>( (PacketSize - (Integer((Integer(ptr)/sizeof(Scalar))) & PacketAlignedMask))
& PacketAlignedMask, maxOffset) & PacketAlignedMask, maxOffset)
: 0; : 0;
} }

View File

@ -241,6 +241,8 @@ struct ei_homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs>
const typename Lhs::Nested m_lhs; const typename Lhs::Nested m_lhs;
const typename MatrixType::Nested m_rhs; const typename MatrixType::Nested m_rhs;
private:
ei_homogeneous_left_product_impl& operator=(const ei_homogeneous_left_product_impl&);
}; };
template<typename MatrixType,typename Rhs> template<typename MatrixType,typename Rhs>
@ -280,6 +282,8 @@ struct ei_homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs>
const typename MatrixType::Nested m_lhs; const typename MatrixType::Nested m_lhs;
const typename Rhs::Nested m_rhs; const typename Rhs::Nested m_rhs;
private:
ei_homogeneous_right_product_impl& operator=(const ei_homogeneous_right_product_impl&);
}; };
#endif // EIGEN_HOMOGENEOUS_H #endif // EIGEN_HOMOGENEOUS_H

View File

@ -562,6 +562,9 @@ struct ei_kernel_retval<FullPivLU<_MatrixType> >
for(int i = rank(); i < cols; ++i) dst.row(dec().permutationQ().indices().coeff(i)).setZero(); for(int i = rank(); i < cols; ++i) dst.row(dec().permutationQ().indices().coeff(i)).setZero();
for(int k = 0; k < dimker; ++k) dst.coeffRef(dec().permutationQ().indices().coeff(rank()+k), k) = Scalar(1); for(int k = 0; k < dimker; ++k) dst.coeffRef(dec().permutationQ().indices().coeff(rank()+k), k) = Scalar(1);
} }
private:
ei_kernel_retval& operator=(const ei_kernel_retval&);
}; };
/***** Implementation of image() *****************************************************/ /***** Implementation of image() *****************************************************/
@ -599,6 +602,9 @@ struct ei_image_retval<FullPivLU<_MatrixType> >
for(int i = 0; i < rank(); ++i) for(int i = 0; i < rank(); ++i)
dst.col(i) = originalMatrix().col(dec().permutationQ().indices().coeff(pivots.coeff(i))); dst.col(i) = originalMatrix().col(dec().permutationQ().indices().coeff(pivots.coeff(i)));
} }
private:
ei_image_retval& operator=(const ei_image_retval&);
}; };
/***** Implementation of solve() *****************************************************/ /***** Implementation of solve() *****************************************************/
@ -659,6 +665,9 @@ struct ei_solve_retval<FullPivLU<_MatrixType>, Rhs>
for(int i = nonzero_pivots; i < dec().matrixLU().cols(); ++i) for(int i = nonzero_pivots; i < dec().matrixLU().cols(); ++i)
dst.row(dec().permutationQ().indices().coeff(i)).setZero(); dst.row(dec().permutationQ().indices().coeff(i)).setZero();
} }
private:
ei_solve_retval& operator=(const ei_solve_retval&);
}; };
/******* MatrixBase methods *****************************************************************/ /******* MatrixBase methods *****************************************************************/

View File

@ -258,6 +258,8 @@ struct ei_inverse_impl : public ReturnByValue<ei_inverse_impl<MatrixType> >
{ {
ei_compute_inverse<MatrixTypeNestedCleaned, Dest>::run(m_matrix, dst); ei_compute_inverse<MatrixTypeNestedCleaned, Dest>::run(m_matrix, dst);
} }
private:
ei_inverse_impl& operator=(const ei_inverse_impl&);
}; };
/** \lu_module /** \lu_module

View File

@ -237,6 +237,8 @@ struct ei_solve_retval<HouseholderQR<_MatrixType>, Rhs>
dst.corner(TopLeft, rank, c.cols()) = c.corner(TopLeft, rank, c.cols()); dst.corner(TopLeft, rank, c.cols()) = c.corner(TopLeft, rank, c.cols());
dst.corner(BottomLeft, cols-rank, c.cols()).setZero(); dst.corner(BottomLeft, cols-rank, c.cols()).setZero();
} }
private:
ei_solve_retval& operator=(const ei_solve_retval&);
}; };
#endif // EIGEN_HIDE_HEAVY_CODE #endif // EIGEN_HIDE_HEAVY_CODE

View File

@ -190,7 +190,7 @@ SVD<MatrixType>& SVD<MatrixType>::compute(const MatrixType& matrix)
SingularValuesType& W = m_sigma; SingularValuesType& W = m_sigma;
bool flag; bool flag;
int i,its,j,k,l,nm; int i=0,its=0,j=0,k=0,l=0,nm=0;
Scalar anorm, c, f, g, h, s, scale, x, y, z; Scalar anorm, c, f, g, h, s, scale, x, y, z;
bool convergence = true; bool convergence = true;
Scalar eps = dummy_precision<Scalar>(); Scalar eps = dummy_precision<Scalar>();
@ -456,6 +456,8 @@ struct ei_solve_retval<SVD<_MatrixType>, Rhs>
dst.col(j) = dec().matrixV() * dst.col(j); dst.col(j) = dec().matrixV() * dst.col(j);
} }
} }
private:
ei_solve_retval& operator=(const ei_solve_retval&);
}; };
/** Computes the polar decomposition of the matrix, as a product unitary x positive. /** Computes the polar decomposition of the matrix, as a product unitary x positive.

View File

@ -93,7 +93,7 @@ class CompressedStorage
void append(const Scalar& v, int i) void append(const Scalar& v, int i)
{ {
int id = m_size; int id = static_cast<int>(m_size);
resize(m_size+1, 1); resize(m_size+1, 1);
m_values[id] = v; m_values[id] = v;
m_indices[id] = i; m_indices[id] = i;
@ -135,7 +135,7 @@ class CompressedStorage
else else
end = mid; end = mid;
} }
return start; return static_cast<int>(start);
} }
/** \returns the stored value at index \a key /** \returns the stored value at index \a key

View File

@ -88,7 +88,7 @@ class DynamicSparseMatrix
inline int rows() const { return IsRowMajor ? outerSize() : m_innerSize; } inline int rows() const { return IsRowMajor ? outerSize() : m_innerSize; }
inline int cols() const { return IsRowMajor ? m_innerSize : outerSize(); } inline int cols() const { return IsRowMajor ? m_innerSize : outerSize(); }
inline int innerSize() const { return m_innerSize; } inline int innerSize() const { return m_innerSize; }
inline int outerSize() const { return m_data.size(); } inline int outerSize() const { return static_cast<int>(m_data.size()); }
inline int innerNonZeros(int j) const { return m_data[j].size(); } inline int innerNonZeros(int j) const { return m_data[j].size(); }
std::vector<CompressedStorage<Scalar> >& _data() { return m_data; } std::vector<CompressedStorage<Scalar> >& _data() { return m_data; }
@ -128,7 +128,7 @@ class DynamicSparseMatrix
{ {
int res = 0; int res = 0;
for (int j=0; j<outerSize(); ++j) for (int j=0; j<outerSize(); ++j)
res += m_data[j].size(); res += static_cast<int>(m_data[j].size());
return res; return res;
} }
@ -195,7 +195,7 @@ class DynamicSparseMatrix
const int inner = IsRowMajor ? col : row; const int inner = IsRowMajor ? col : row;
int startId = 0; int startId = 0;
int id = m_data[outer].size() - 1; int id = static_cast<int>(m_data[outer].size()) - 1;
m_data[outer].resize(id+2,1); m_data[outer].resize(id+2,1);
while ( (id >= startId) && (m_data[outer].index(id) > inner) ) while ( (id >= startId) && (m_data[outer].index(id) > inner) )

View File

@ -322,7 +322,7 @@ class RandomSetter
{ {
int nz = 0; int nz = 0;
for (int k=0; k<m_outerPackets; ++k) for (int k=0; k<m_outerPackets; ++k)
nz += m_hashmaps[k].size(); nz += static_cast<int>(m_hashmaps[k].size());
return nz; return nz;
} }

View File

@ -220,6 +220,8 @@ class SparseInnerVectorSet<SparseMatrix<_Scalar, _Options>, Size>
inline int col() const { return IsRowMajor ? this->index() : m_outer; } inline int col() const { return IsRowMajor ? this->index() : m_outer; }
protected: protected:
int m_outer; int m_outer;
private:
InnerIterator& operator=(const InnerIterator&);
}; };
inline SparseInnerVectorSet(const MatrixType& matrix, int outerStart, int outerSize) inline SparseInnerVectorSet(const MatrixType& matrix, int outerStart, int outerSize)

View File

@ -156,6 +156,9 @@ template<typename ExpressionType> class SparseCwise
protected: protected:
ExpressionTypeNested m_matrix; ExpressionTypeNested m_matrix;
private:
SparseCwise& operator=(const SparseCwise&);
}; };
template<typename Derived> template<typename Derived>

View File

@ -126,6 +126,9 @@ class SparseCwiseBinaryOp<BinaryOp,Lhs,Rhs>::InnerIterator
EIGEN_STRONG_INLINE InnerIterator(const SparseCwiseBinaryOp& binOp, int outer) EIGEN_STRONG_INLINE InnerIterator(const SparseCwiseBinaryOp& binOp, int outer)
: Base(binOp,outer) : Base(binOp,outer)
{} {}
private:
InnerIterator& operator=(const InnerIterator&);
}; };
/*************************************************************************** /***************************************************************************
@ -197,6 +200,8 @@ class ei_sparse_cwise_binary_op_inner_iterator_selector<BinaryOp, Lhs, Rhs, Deri
const BinaryOp& m_functor; const BinaryOp& m_functor;
Scalar m_value; Scalar m_value;
int m_id; int m_id;
private:
ei_sparse_cwise_binary_op_inner_iterator_selector& operator=(const ei_sparse_cwise_binary_op_inner_iterator_selector&);
}; };
// sparse - sparse (product) // sparse - sparse (product)
@ -250,6 +255,8 @@ class ei_sparse_cwise_binary_op_inner_iterator_selector<ei_scalar_product_op<T>,
LhsIterator m_lhsIter; LhsIterator m_lhsIter;
RhsIterator m_rhsIter; RhsIterator m_rhsIter;
const BinaryFunc& m_functor; const BinaryFunc& m_functor;
private:
ei_sparse_cwise_binary_op_inner_iterator_selector& operator=(const ei_sparse_cwise_binary_op_inner_iterator_selector&);
}; };
// sparse - dense (product) // sparse - dense (product)

View File

@ -90,6 +90,9 @@ class SparseCwiseUnaryOp<UnaryOp,MatrixType>::InnerIterator
protected: protected:
MatrixTypeIterator m_iter; MatrixTypeIterator m_iter;
const UnaryOp m_functor; const UnaryOp m_functor;
private:
InnerIterator& operator=(const InnerIterator&);
}; };
template<typename Derived> template<typename Derived>

View File

@ -133,6 +133,8 @@ class ei_sparse_diagonal_product_inner_iterator_selector
const SparseDiagonalProductType& expr, int outer) const SparseDiagonalProductType& expr, int outer)
: Base(expr.rhs().innerVector(outer) .cwise()* expr.lhs().diagonal(), 0) : Base(expr.rhs().innerVector(outer) .cwise()* expr.lhs().diagonal(), 0)
{} {}
private:
ei_sparse_diagonal_product_inner_iterator_selector& operator=(const ei_sparse_diagonal_product_inner_iterator_selector&);
}; };
template<typename Lhs, typename Rhs, typename SparseDiagonalProductType> template<typename Lhs, typename Rhs, typename SparseDiagonalProductType>
@ -165,6 +167,8 @@ class ei_sparse_diagonal_product_inner_iterator_selector
const SparseDiagonalProductType& expr, int outer) const SparseDiagonalProductType& expr, int outer)
: Base(expr.lhs().innerVector(outer) .cwise()* expr.rhs().diagonal().transpose(), 0) : Base(expr.lhs().innerVector(outer) .cwise()* expr.rhs().diagonal().transpose(), 0)
{} {}
private:
ei_sparse_diagonal_product_inner_iterator_selector& operator=(const ei_sparse_diagonal_product_inner_iterator_selector&);
}; };
// SparseMatrixBase functions // SparseMatrixBase functions

View File

@ -64,6 +64,9 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas
protected: protected:
ExpressionTypeNested m_matrix; ExpressionTypeNested m_matrix;
private:
SparseFlagged& operator=(const SparseFlagged&);
}; };
template<typename ExpressionType, unsigned int Added, unsigned int Removed> template<typename ExpressionType, unsigned int Added, unsigned int Removed>
@ -74,6 +77,9 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed>
EIGEN_STRONG_INLINE InnerIterator(const SparseFlagged& xpr, int outer) EIGEN_STRONG_INLINE InnerIterator(const SparseFlagged& xpr, int outer)
: ExpressionType::InnerIterator(xpr.m_matrix, outer) : ExpressionType::InnerIterator(xpr.m_matrix, outer)
{} {}
private:
InnerIterator& operator=(const InnerIterator&);
}; };
template<typename ExpressionType, unsigned int Added, unsigned int Removed> template<typename ExpressionType, unsigned int Added, unsigned int Removed>

View File

@ -138,7 +138,7 @@ class SparseMatrix
} }
/** \returns the number of non zero coefficients */ /** \returns the number of non zero coefficients */
inline int nonZeros() const { return m_data.size(); } inline int nonZeros() const { return static_cast<int>(m_data.size()); }
/** \deprecated use setZero() and reserve() /** \deprecated use setZero() and reserve()
* Initializes the filling process of \c *this. * Initializes the filling process of \c *this.
@ -236,7 +236,7 @@ class SparseMatrix
// we start a new inner vector // we start a new inner vector
while (previousOuter>=0 && m_outerIndex[previousOuter]==0) while (previousOuter>=0 && m_outerIndex[previousOuter]==0)
{ {
m_outerIndex[previousOuter] = m_data.size(); m_outerIndex[previousOuter] = static_cast<int>(m_data.size());
--previousOuter; --previousOuter;
} }
m_outerIndex[outer+1] = m_outerIndex[outer]; m_outerIndex[outer+1] = m_outerIndex[outer];
@ -335,7 +335,7 @@ class SparseMatrix
*/ */
inline void finalize() inline void finalize()
{ {
int size = m_data.size(); int size = static_cast<int>(m_data.size());
int i = m_outerSize; int i = m_outerSize;
// find the last filled column // find the last filled column
while (i>=0 && m_outerIndex[i]==0) while (i>=0 && m_outerIndex[i]==0)
@ -557,6 +557,9 @@ class SparseMatrix<Scalar,_Options>::InnerIterator
int m_id; int m_id;
const int m_start; const int m_start;
const int m_end; const int m_end;
private:
InnerIterator& operator=(const InnerIterator&);
}; };
#endif // EIGEN_SPARSEMATRIX_H #endif // EIGEN_SPARSEMATRIX_H

View File

@ -62,6 +62,9 @@ template<typename MatrixType> class SparseTranspose
protected: protected:
const typename MatrixType::Nested m_matrix; const typename MatrixType::Nested m_matrix;
private:
SparseTranspose& operator=(const SparseTranspose&);
}; };
template<typename MatrixType> class SparseTranspose<MatrixType>::InnerIterator : public MatrixType::InnerIterator template<typename MatrixType> class SparseTranspose<MatrixType>::InnerIterator : public MatrixType::InnerIterator
@ -74,6 +77,9 @@ template<typename MatrixType> class SparseTranspose<MatrixType>::InnerIterator :
{} {}
inline int row() const { return Base::col(); } inline int row() const { return Base::col(); }
inline int col() const { return Base::row(); } inline int col() const { return Base::row(); }
private:
InnerIterator& operator=(const InnerIterator&);
}; };
template<typename MatrixType> class SparseTranspose<MatrixType>::ReverseInnerIterator : public MatrixType::ReverseInnerIterator template<typename MatrixType> class SparseTranspose<MatrixType>::ReverseInnerIterator : public MatrixType::ReverseInnerIterator

View File

@ -47,6 +47,9 @@ template<typename ExpressionType, int Mode> class SparseTriangular
protected: protected:
ExpressionTypeNested m_matrix; ExpressionTypeNested m_matrix;
private:
SparseTriangular& operator=(const SparseTriangular&);
}; };
template<typename Derived> template<typename Derived>

View File

@ -125,7 +125,7 @@ class SparseVector
inline void setZero() { m_data.clear(); } inline void setZero() { m_data.clear(); }
/** \returns the number of non zero coefficients */ /** \returns the number of non zero coefficients */
inline int nonZeros() const { return m_data.size(); } inline int nonZeros() const { return static_cast<int>(m_data.size()); }
inline void startVec(int outer) inline void startVec(int outer)
{ {
@ -374,13 +374,13 @@ class SparseVector<Scalar,_Options>::InnerIterator
{ {
public: public:
InnerIterator(const SparseVector& vec, int outer=0) InnerIterator(const SparseVector& vec, int outer=0)
: m_data(vec.m_data), m_id(0), m_end(m_data.size()) : m_data(vec.m_data), m_id(0), m_end(static_cast<int>(m_data.size()))
{ {
ei_assert(outer==0); ei_assert(outer==0);
} }
InnerIterator(const CompressedStorage<Scalar>& data) InnerIterator(const CompressedStorage<Scalar>& data)
: m_data(data), m_id(0), m_end(m_data.size()) : m_data(data), m_id(0), m_end(static_cast<int>(m_data.size()))
{} {}
template<unsigned int Added, unsigned int Removed> template<unsigned int Added, unsigned int Removed>

View File

@ -67,9 +67,12 @@ template<typename _DecompositionType> struct ei_image_retval_base
} }
protected: protected:
const DecompositionType& m_dec; const DecompositionType& m_dec;
int m_rank, m_cols; int m_rank, m_cols;
const MatrixType& m_originalMatrix; const MatrixType& m_originalMatrix;
private:
ei_image_retval_base& operator=(const ei_image_retval_base&);
}; };
#define EIGEN_MAKE_IMAGE_HELPERS(DecompositionType) \ #define EIGEN_MAKE_IMAGE_HELPERS(DecompositionType) \

View File

@ -67,8 +67,11 @@ template<typename _DecompositionType> struct ei_kernel_retval_base
} }
protected: protected:
const DecompositionType& m_dec; const DecompositionType& m_dec;
int m_rank, m_cols; int m_rank, m_cols;
private:
ei_kernel_retval_base& operator=(const ei_kernel_retval_base&);
}; };
#define EIGEN_MAKE_KERNEL_HELPERS(DecompositionType) \ #define EIGEN_MAKE_KERNEL_HELPERS(DecompositionType) \

View File

@ -61,8 +61,11 @@ template<typename _DecompositionType, typename Rhs> struct ei_solve_retval_base
} }
protected: protected:
const DecompositionType& m_dec; const DecompositionType& m_dec;
const typename Rhs::Nested m_rhs; const typename Rhs::Nested m_rhs;
private:
ei_solve_retval_base& operator=(const ei_solve_retval_base&);
}; };
#define EIGEN_MAKE_SOLVE_HELPERS(DecompositionType,Rhs) \ #define EIGEN_MAKE_SOLVE_HELPERS(DecompositionType,Rhs) \

View File

@ -222,9 +222,12 @@ if(CMAKE_COMPILER_IS_GNUCXX)
else(EIGEN_COVERAGE_TESTING) else(EIGEN_COVERAGE_TESTING)
set(COVERAGE_FLAGS "") set(COVERAGE_FLAGS "")
endif(EIGEN_COVERAGE_TESTING) endif(EIGEN_COVERAGE_TESTING)
if(EIGEN_TEST_RVALUE_REF_SUPPORT OR EIGEN_TEST_C++0x) if(EIGEN_TEST_C++0x)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
endif(EIGEN_TEST_RVALUE_REF_SUPPORT OR EIGEN_TEST_C++0x) endif(EIGEN_TEST_C++0x)
if(EIGEN_TEST_MAX_WARNING_LEVEL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wconversion")
endif(EIGEN_TEST_MAX_WARNING_LEVEL)
if(CMAKE_SYSTEM_NAME MATCHES Linux) if(CMAKE_SYSTEM_NAME MATCHES Linux)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS} -g2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS} -g2")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COVERAGE_FLAGS} -O2 -g2") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COVERAGE_FLAGS} -O2 -g2")
@ -232,5 +235,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COVERAGE_FLAGS} -O0 -g3") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COVERAGE_FLAGS} -O0 -g3")
endif(CMAKE_SYSTEM_NAME MATCHES Linux) endif(CMAKE_SYSTEM_NAME MATCHES Linux)
elseif(MSVC) elseif(MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Zi /Ob0 /Od" CACHE STRING "Flags used by the compiler during debug builds." FORCE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS")
if(EIGEN_TEST_MAX_WARNING_LEVEL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif(EIGEN_TEST_MAX_WARNING_LEVEL)
endif(CMAKE_COMPILER_IS_GNUCXX) endif(CMAKE_COMPILER_IS_GNUCXX)

View File

@ -34,7 +34,7 @@ bool test_random_setter(SparseMatrix<Scalar,Options>& sm, const DenseType& ref,
std::vector<Vector2i> remaining = nonzeroCoords; std::vector<Vector2i> remaining = nonzeroCoords;
while(!remaining.empty()) while(!remaining.empty())
{ {
int i = ei_random<int>(0,remaining.size()-1); int i = ei_random<int>(0,static_cast<int>(remaining.size())-1);
w(remaining[i].x(),remaining[i].y()) = ref.coeff(remaining[i].x(),remaining[i].y()); w(remaining[i].x(),remaining[i].y()) = ref.coeff(remaining[i].x(),remaining[i].y());
remaining[i] = remaining.back(); remaining[i] = remaining.back();
remaining.pop_back(); remaining.pop_back();
@ -50,7 +50,7 @@ bool test_random_setter(DynamicSparseMatrix<T>& sm, const DenseType& ref, const
std::vector<Vector2i> remaining = nonzeroCoords; std::vector<Vector2i> remaining = nonzeroCoords;
while(!remaining.empty()) while(!remaining.empty())
{ {
int i = ei_random<int>(0,remaining.size()-1); int i = ei_random<int>(0,static_cast<int>(remaining.size())-1);
sm.coeffRef(remaining[i].x(),remaining[i].y()) = ref.coeff(remaining[i].x(),remaining[i].y()); sm.coeffRef(remaining[i].x(),remaining[i].y()) = ref.coeff(remaining[i].x(),remaining[i].y());
remaining[i] = remaining.back(); remaining[i] = remaining.back();
remaining.pop_back(); remaining.pop_back();

View File

@ -160,7 +160,7 @@ class FFT
dst.resize( (src.size()>>1)+1); dst.resize( (src.size()>>1)+1);
else else
dst.resize(src.size()); dst.resize(src.size());
fwd(&dst[0],&src[0],src.size()); fwd(&dst[0],&src[0],static_cast<int>(src.size()));
} }
template<typename InputDerived, typename ComplexDerived> template<typename InputDerived, typename ComplexDerived>
@ -224,7 +224,7 @@ class FFT
dst.resize( 2*(src.size()-1) ); dst.resize( 2*(src.size()-1) );
else else
dst.resize( src.size() ); dst.resize( src.size() );
inv( &dst[0],&src[0],dst.size() ); inv( &dst[0],&src[0],static_cast<int>(dst.size()) );
} }
// TODO: multi-dimensional FFTs // TODO: multi-dimensional FFTs

View File

@ -74,6 +74,8 @@ struct ei_intersector_helper1
bool intersectObject(const Object1 &obj) { return intersector.intersectObjectObject(obj, stored); } bool intersectObject(const Object1 &obj) { return intersector.intersectObjectObject(obj, stored); }
Object2 stored; Object2 stored;
Intersector &intersector; Intersector &intersector;
private:
ei_intersector_helper1& operator=(const ei_intersector_helper1&);
}; };
template<typename Volume2, typename Object2, typename Object1, typename Intersector> template<typename Volume2, typename Object2, typename Object1, typename Intersector>
@ -216,6 +218,8 @@ struct ei_minimizer_helper2
Scalar minimumOnObject(const Object2 &obj) { return minimizer.minimumOnObjectObject(stored, obj); } Scalar minimumOnObject(const Object2 &obj) { return minimizer.minimumOnObjectObject(stored, obj); }
Object1 stored; Object1 stored;
Minimizer &minimizer; Minimizer &minimizer;
private:
ei_minimizer_helper2& operator=(const ei_minimizer_helper2&);
}; };
/** Given two BVH's, runs the query on their cartesian product encapsulated by \a minimizer. /** Given two BVH's, runs the query on their cartesian product encapsulated by \a minimizer.

View File

@ -107,7 +107,7 @@ public:
children.clear(); children.clear();
objects.insert(objects.end(), begin, end); objects.insert(objects.end(), begin, end);
int n = objects.size(); int n = static_cast<int>(objects.size());
if(n < 2) if(n < 2)
return; //if we have at most one object, we don't need any internal nodes return; //if we have at most one object, we don't need any internal nodes
@ -149,7 +149,7 @@ public:
return; return;
} }
int numBoxes = boxes.size(); int numBoxes = static_cast<int>(boxes.size());
int idx = index * 2; int idx = index * 2;
if(children[idx + 1] < numBoxes) { //second index is always bigger if(children[idx + 1] < numBoxes) { //second index is always bigger

View File

@ -247,7 +247,7 @@ struct ei_kiss_cpx_fft
int u,k,q1,q; int u,k,q1,q;
Complex * twiddles = &m_twiddles[0]; Complex * twiddles = &m_twiddles[0];
Complex t; Complex t;
int Norig = m_twiddles.size(); int Norig = static_cast<int>(m_twiddles.size());
Complex * scratchbuf = &m_scratchBuf[0]; Complex * scratchbuf = &m_scratchBuf[0];
for ( u=0; u<m; ++u ) { for ( u=0; u<m; ++u ) {
@ -262,7 +262,7 @@ struct ei_kiss_cpx_fft
int twidx=0; int twidx=0;
Fout[ k ] = scratchbuf[0]; Fout[ k ] = scratchbuf[0];
for (q=1;q<p;++q ) { for (q=1;q<p;++q ) {
twidx += fstride * k; twidx += static_cast<int>(fstride) * k;
if (twidx>=Norig) twidx-=Norig; if (twidx>=Norig) twidx-=Norig;
t=scratchbuf[q] * twiddles[twidx]; t=scratchbuf[q] * twiddles[twidx];
Fout[ k ] += t; Fout[ k ] += t;

View File

@ -292,7 +292,7 @@ void MatrixExponential<MatrixType>::computeUV(float)
} else { } else {
const float maxnorm = 3.925724783138660f; const float maxnorm = 3.925724783138660f;
m_squarings = std::max(0, (int)ceil(log2(m_l1norm / maxnorm))); m_squarings = std::max(0, (int)ceil(log2(m_l1norm / maxnorm)));
MatrixType A = *m_M / std::pow(Scalar(2), Scalar(m_squarings)); MatrixType A = *m_M / std::pow(Scalar(2), Scalar(static_cast<RealScalar>(m_squarings)));
pade7(A); pade7(A);
} }
} }

View File

@ -40,7 +40,7 @@ template <typename T>
void take_std( std::complex<T> * dst, int n ) void take_std( std::complex<T> * dst, int n )
{ {
for (int i=0;i<n;++i) for (int i=0;i<n;++i)
dst[i] = std::complex<T>(i,i); dst[i] = std::complex<T>(static_cast<float>(i),static_cast<float>(i));
cout << dst[n-1] << endl; cout << dst[n-1] << endl;
} }

View File

@ -46,10 +46,10 @@ complex<long double> promote(long double x) { return complex<long double>( x);
long double difpower=0; long double difpower=0;
cerr <<"idx\ttruth\t\tvalue\t|dif|=\n"; cerr <<"idx\ttruth\t\tvalue\t|dif|=\n";
long double pi = acos((long double)-1); long double pi = acos((long double)-1);
for (size_t k0=0;k0<size_t(fftbuf.size());++k0) { for (int k0=0;k0<fftbuf.size();++k0) {
complex<long double> acc = 0; complex<long double> acc = 0;
long double phinc = -2.*k0* pi / timebuf.size(); long double phinc = -2.*k0* pi / timebuf.size();
for (size_t k1=0;k1<size_t(timebuf.size());++k1) { for (int k1=0;k1<timebuf.size();++k1) {
acc += promote( timebuf[k1] ) * exp( complex<long double>(0,k1*phinc) ); acc += promote( timebuf[k1] ) * exp( complex<long double>(0,k1*phinc) );
} }
totalpower += norm(acc); totalpower += norm(acc);
@ -67,8 +67,8 @@ complex<long double> promote(long double x) { return complex<long double>( x);
{ {
long double totalpower=0; long double totalpower=0;
long double difpower=0; long double difpower=0;
size_t n = min( buf1.size(),buf2.size() ); int n = min( buf1.size(),buf2.size() );
for (size_t k=0;k<n;++k) { for (int k=0;k<n;++k) {
totalpower += (norm( buf1[k] ) + norm(buf2[k]) )/2.; totalpower += (norm( buf1[k] ) + norm(buf2[k]) )/2.;
difpower += norm(buf1[k] - buf2[k]); difpower += norm(buf1[k] - buf2[k]);
} }