aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hauke Heibel <hauke.heibel@gmail.com>2009-12-12 11:39:07 +0100
committerGravatar Hauke Heibel <hauke.heibel@gmail.com>2009-12-12 11:39:07 +0100
commitd088ee35f644f9178270f0c3dc8c76011d208099 (patch)
tree47001aacbb83eba02c38d93ec97fbe09e7c8497c
parent494a88685ee995b34da0f3b79a68fa06c0ee63ff (diff)
Added to possibility to compile unit tests at maximum warning level.
Silenced (amongst others) many conversion related warnings.
-rw-r--r--CMakeLists.txt3
-rw-r--r--Eigen/src/Array/Functors.h4
-rw-r--r--Eigen/src/Array/VectorwiseOp.h2
-rw-r--r--Eigen/src/Cholesky/LDLT.h2
-rw-r--r--Eigen/src/Cholesky/LLT.h2
-rw-r--r--Eigen/src/Core/Flagged.h3
-rw-r--r--Eigen/src/Core/SelfAdjointView.h4
-rw-r--r--Eigen/src/Core/util/Memory.h10
-rw-r--r--Eigen/src/Geometry/Homogeneous.h4
-rw-r--r--Eigen/src/LU/FullPivLU.h9
-rw-r--r--Eigen/src/LU/Inverse.h2
-rw-r--r--Eigen/src/QR/HouseholderQR.h2
-rw-r--r--Eigen/src/SVD/SVD.h4
-rw-r--r--Eigen/src/Sparse/CompressedStorage.h4
-rw-r--r--Eigen/src/Sparse/DynamicSparseMatrix.h6
-rw-r--r--Eigen/src/Sparse/RandomSetter.h2
-rw-r--r--Eigen/src/Sparse/SparseBlock.h2
-rw-r--r--Eigen/src/Sparse/SparseCwise.h3
-rw-r--r--Eigen/src/Sparse/SparseCwiseBinaryOp.h7
-rw-r--r--Eigen/src/Sparse/SparseCwiseUnaryOp.h3
-rw-r--r--Eigen/src/Sparse/SparseDiagonalProduct.h4
-rw-r--r--Eigen/src/Sparse/SparseFlagged.h6
-rw-r--r--Eigen/src/Sparse/SparseMatrix.h9
-rw-r--r--Eigen/src/Sparse/SparseTranspose.h6
-rw-r--r--Eigen/src/Sparse/SparseTriangular.h3
-rw-r--r--Eigen/src/Sparse/SparseVector.h6
-rw-r--r--Eigen/src/misc/Image.h9
-rw-r--r--Eigen/src/misc/Kernel.h7
-rw-r--r--Eigen/src/misc/Solve.h7
-rw-r--r--cmake/EigenTesting.cmake12
-rw-r--r--test/sparse_basic.cpp4
-rw-r--r--unsupported/Eigen/FFT4
-rw-r--r--unsupported/Eigen/src/BVH/BVAlgorithms.h4
-rw-r--r--unsupported/Eigen/src/BVH/KdBVH.h4
-rw-r--r--unsupported/Eigen/src/FFT/ei_kissfft_impl.h4
-rw-r--r--unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h2
-rw-r--r--unsupported/test/Complex.cpp2
-rw-r--r--unsupported/test/FFT.cpp8
38 files changed, 135 insertions, 44 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d1d9b12de..a7d4089c0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -124,7 +124,8 @@ endif(EIGEN_TEST_NO_EXPLICIT_VECTORIZATION)
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})
diff --git a/Eigen/src/Array/Functors.h b/Eigen/src/Array/Functors.h
index fd259f7bc..3a7753d04 100644
--- a/Eigen/src/Array/Functors.h
+++ b/Eigen/src/Array/Functors.h
@@ -43,6 +43,8 @@ struct ei_scalar_add_op {
inline const PacketScalar packetOp(const PacketScalar& a) const
{ return ei_padd(a, ei_pset1(m_other)); }
const Scalar m_other;
+private:
+ ei_scalar_add_op& operator=(const ei_scalar_add_op&);
};
template<typename 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 Scalar operator() (const Scalar& a) const { return ei_pow(a, m_exponent); }
const Scalar m_exponent;
+private:
+ ei_scalar_pow_op& operator=(const ei_scalar_pow_op&);
};
template<typename Scalar>
struct ei_functor_traits<ei_scalar_pow_op<Scalar> >
diff --git a/Eigen/src/Array/VectorwiseOp.h b/Eigen/src/Array/VectorwiseOp.h
index 71b83eaad..92e5cc000 100644
--- a/Eigen/src/Array/VectorwiseOp.h
+++ b/Eigen/src/Array/VectorwiseOp.h
@@ -147,6 +147,8 @@ struct ei_member_redux {
inline result_type operator()(const MatrixBase<Derived>& mat) const
{ return mat.redux(m_functor); }
const BinaryOp m_functor;
+private:
+ ei_member_redux& operator=(const ei_member_redux&);
};
/** \array_module \ingroup Array_Module
diff --git a/Eigen/src/Cholesky/LDLT.h b/Eigen/src/Cholesky/LDLT.h
index d0f292634..2898d8747 100644
--- a/Eigen/src/Cholesky/LDLT.h
+++ b/Eigen/src/Cholesky/LDLT.h
@@ -275,6 +275,8 @@ struct ei_solve_retval<LDLT<_MatrixType>, Rhs>
dst = rhs();
dec().solveInPlace(dst);
}
+private:
+ ei_solve_retval& operator=(const ei_solve_retval&);
};
/** This is the \em in-place version of solve().
diff --git a/Eigen/src/Cholesky/LLT.h b/Eigen/src/Cholesky/LLT.h
index ad737aaeb..871530aef 100644
--- a/Eigen/src/Cholesky/LLT.h
+++ b/Eigen/src/Cholesky/LLT.h
@@ -270,6 +270,8 @@ struct ei_solve_retval<LLT<_MatrixType, UpLo>, Rhs>
dst = rhs();
dec().solveInPlace(dst);
}
+private:
+ ei_solve_retval_base& operator=(const ei_solve_retval_base&);
};
/** This is the \em in-place version of solve().
diff --git a/Eigen/src/Core/Flagged.h b/Eigen/src/Core/Flagged.h
index 754eaf6c5..b98861f42 100644
--- a/Eigen/src/Core/Flagged.h
+++ b/Eigen/src/Core/Flagged.h
@@ -111,6 +111,9 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas
protected:
ExpressionTypeNested m_matrix;
+
+ private:
+ Flagged& operator=(const Flagged&);
};
/** \deprecated it is only used by lazy() which is deprecated
diff --git a/Eigen/src/Core/SelfAdjointView.h b/Eigen/src/Core/SelfAdjointView.h
index 95ce666c9..9518a6498 100644
--- a/Eigen/src/Core/SelfAdjointView.h
+++ b/Eigen/src/Core/SelfAdjointView.h
@@ -150,8 +150,10 @@ template<typename MatrixType, unsigned int UpLo> class SelfAdjointView
const LDLT<PlainMatrixType> ldlt() const;
protected:
-
const typename MatrixType::Nested m_matrix;
+
+ private:
+ SelfAdjointView& operator=(const SelfAdjointView&);
};
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h
index bc5235582..1bff682ff 100644
--- a/Eigen/src/Core/util/Memory.h
+++ b/Eigen/src/Core/util/Memory.h
@@ -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 */
-template<typename Scalar>
-inline static int ei_alignmentOffset(const Scalar* ptr, int maxOffset)
+template<typename Scalar, typename Integer>
+inline static Integer ei_alignmentOffset(const Scalar* ptr, Integer maxOffset)
{
typedef typename ei_packet_traits<Scalar>::type Packet;
- const int PacketSize = ei_packet_traits<Scalar>::size;
- const int PacketAlignedMask = PacketSize-1;
+ const Integer PacketSize = ei_packet_traits<Scalar>::size;
+ const Integer PacketAlignedMask = PacketSize-1;
const bool Vectorized = PacketSize>1;
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)
: 0;
}
diff --git a/Eigen/src/Geometry/Homogeneous.h b/Eigen/src/Geometry/Homogeneous.h
index ffa828f71..f2a2fe73e 100644
--- a/Eigen/src/Geometry/Homogeneous.h
+++ b/Eigen/src/Geometry/Homogeneous.h
@@ -241,6 +241,8 @@ struct ei_homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs>
const typename Lhs::Nested m_lhs;
const typename MatrixType::Nested m_rhs;
+private:
+ ei_homogeneous_left_product_impl& operator=(const ei_homogeneous_left_product_impl&);
};
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 Rhs::Nested m_rhs;
+private:
+ ei_homogeneous_right_product_impl& operator=(const ei_homogeneous_right_product_impl&);
};
#endif // EIGEN_HOMOGENEOUS_H
diff --git a/Eigen/src/LU/FullPivLU.h b/Eigen/src/LU/FullPivLU.h
index 1358c9490..5505d3bee 100644
--- a/Eigen/src/LU/FullPivLU.h
+++ b/Eigen/src/LU/FullPivLU.h
@@ -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 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() *****************************************************/
@@ -599,6 +602,9 @@ struct ei_image_retval<FullPivLU<_MatrixType> >
for(int i = 0; i < rank(); ++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() *****************************************************/
@@ -659,6 +665,9 @@ struct ei_solve_retval<FullPivLU<_MatrixType>, Rhs>
for(int i = nonzero_pivots; i < dec().matrixLU().cols(); ++i)
dst.row(dec().permutationQ().indices().coeff(i)).setZero();
}
+
+private:
+ ei_solve_retval& operator=(const ei_solve_retval&);
};
/******* MatrixBase methods *****************************************************************/
diff --git a/Eigen/src/LU/Inverse.h b/Eigen/src/LU/Inverse.h
index 8afbfda96..c31b3502e 100644
--- a/Eigen/src/LU/Inverse.h
+++ b/Eigen/src/LU/Inverse.h
@@ -258,6 +258,8 @@ struct ei_inverse_impl : public ReturnByValue<ei_inverse_impl<MatrixType> >
{
ei_compute_inverse<MatrixTypeNestedCleaned, Dest>::run(m_matrix, dst);
}
+private:
+ ei_inverse_impl& operator=(const ei_inverse_impl&);
};
/** \lu_module
diff --git a/Eigen/src/QR/HouseholderQR.h b/Eigen/src/QR/HouseholderQR.h
index 95496b943..3b174a873 100644
--- a/Eigen/src/QR/HouseholderQR.h
+++ b/Eigen/src/QR/HouseholderQR.h
@@ -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(BottomLeft, cols-rank, c.cols()).setZero();
}
+private:
+ ei_solve_retval& operator=(const ei_solve_retval&);
};
#endif // EIGEN_HIDE_HEAVY_CODE
diff --git a/Eigen/src/SVD/SVD.h b/Eigen/src/SVD/SVD.h
index 3c7aaf322..a90704cb9 100644
--- a/Eigen/src/SVD/SVD.h
+++ b/Eigen/src/SVD/SVD.h
@@ -190,7 +190,7 @@ SVD<MatrixType>& SVD<MatrixType>::compute(const MatrixType& matrix)
SingularValuesType& W = m_sigma;
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;
bool convergence = true;
Scalar eps = dummy_precision<Scalar>();
@@ -456,6 +456,8 @@ struct ei_solve_retval<SVD<_MatrixType>, Rhs>
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.
diff --git a/Eigen/src/Sparse/CompressedStorage.h b/Eigen/src/Sparse/CompressedStorage.h
index fcf5c7bfe..b25b05e91 100644
--- a/Eigen/src/Sparse/CompressedStorage.h
+++ b/Eigen/src/Sparse/CompressedStorage.h
@@ -93,7 +93,7 @@ class CompressedStorage
void append(const Scalar& v, int i)
{
- int id = m_size;
+ int id = static_cast<int>(m_size);
resize(m_size+1, 1);
m_values[id] = v;
m_indices[id] = i;
@@ -135,7 +135,7 @@ class CompressedStorage
else
end = mid;
}
- return start;
+ return static_cast<int>(start);
}
/** \returns the stored value at index \a key
diff --git a/Eigen/src/Sparse/DynamicSparseMatrix.h b/Eigen/src/Sparse/DynamicSparseMatrix.h
index 189a56bd0..f4f83533a 100644
--- a/Eigen/src/Sparse/DynamicSparseMatrix.h
+++ b/Eigen/src/Sparse/DynamicSparseMatrix.h
@@ -88,7 +88,7 @@ class DynamicSparseMatrix
inline int rows() const { return IsRowMajor ? outerSize() : m_innerSize; }
inline int cols() const { return IsRowMajor ? m_innerSize : outerSize(); }
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(); }
std::vector<CompressedStorage<Scalar> >& _data() { return m_data; }
@@ -128,7 +128,7 @@ class DynamicSparseMatrix
{
int res = 0;
for (int j=0; j<outerSize(); ++j)
- res += m_data[j].size();
+ res += static_cast<int>(m_data[j].size());
return res;
}
@@ -195,7 +195,7 @@ class DynamicSparseMatrix
const int inner = IsRowMajor ? col : row;
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);
while ( (id >= startId) && (m_data[outer].index(id) > inner) )
diff --git a/Eigen/src/Sparse/RandomSetter.h b/Eigen/src/Sparse/RandomSetter.h
index 50824eba1..b34ca19a8 100644
--- a/Eigen/src/Sparse/RandomSetter.h
+++ b/Eigen/src/Sparse/RandomSetter.h
@@ -322,7 +322,7 @@ class RandomSetter
{
int nz = 0;
for (int k=0; k<m_outerPackets; ++k)
- nz += m_hashmaps[k].size();
+ nz += static_cast<int>(m_hashmaps[k].size());
return nz;
}
diff --git a/Eigen/src/Sparse/SparseBlock.h b/Eigen/src/Sparse/SparseBlock.h
index 6659a88e2..1fe919736 100644
--- a/Eigen/src/Sparse/SparseBlock.h
+++ b/Eigen/src/Sparse/SparseBlock.h
@@ -220,6 +220,8 @@ class SparseInnerVectorSet<SparseMatrix<_Scalar, _Options>, Size>
inline int col() const { return IsRowMajor ? this->index() : m_outer; }
protected:
int m_outer;
+ private:
+ InnerIterator& operator=(const InnerIterator&);
};
inline SparseInnerVectorSet(const MatrixType& matrix, int outerStart, int outerSize)
diff --git a/Eigen/src/Sparse/SparseCwise.h b/Eigen/src/Sparse/SparseCwise.h
index bf8f2355c..c2e302956 100644
--- a/Eigen/src/Sparse/SparseCwise.h
+++ b/Eigen/src/Sparse/SparseCwise.h
@@ -156,6 +156,9 @@ template<typename ExpressionType> class SparseCwise
protected:
ExpressionTypeNested m_matrix;
+
+ private:
+ SparseCwise& operator=(const SparseCwise&);
};
template<typename Derived>
diff --git a/Eigen/src/Sparse/SparseCwiseBinaryOp.h b/Eigen/src/Sparse/SparseCwiseBinaryOp.h
index 2dcd6b944..bb93b60ef 100644
--- a/Eigen/src/Sparse/SparseCwiseBinaryOp.h
+++ b/Eigen/src/Sparse/SparseCwiseBinaryOp.h
@@ -126,6 +126,9 @@ class SparseCwiseBinaryOp<BinaryOp,Lhs,Rhs>::InnerIterator
EIGEN_STRONG_INLINE InnerIterator(const SparseCwiseBinaryOp& binOp, int 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;
Scalar m_value;
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)
@@ -250,6 +255,8 @@ class ei_sparse_cwise_binary_op_inner_iterator_selector<ei_scalar_product_op<T>,
LhsIterator m_lhsIter;
RhsIterator m_rhsIter;
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)
diff --git a/Eigen/src/Sparse/SparseCwiseUnaryOp.h b/Eigen/src/Sparse/SparseCwiseUnaryOp.h
index 9a73374bd..9c102ed64 100644
--- a/Eigen/src/Sparse/SparseCwiseUnaryOp.h
+++ b/Eigen/src/Sparse/SparseCwiseUnaryOp.h
@@ -90,6 +90,9 @@ class SparseCwiseUnaryOp<UnaryOp,MatrixType>::InnerIterator
protected:
MatrixTypeIterator m_iter;
const UnaryOp m_functor;
+
+ private:
+ InnerIterator& operator=(const InnerIterator&);
};
template<typename Derived>
diff --git a/Eigen/src/Sparse/SparseDiagonalProduct.h b/Eigen/src/Sparse/SparseDiagonalProduct.h
index e9ba47f70..24f724ad1 100644
--- a/Eigen/src/Sparse/SparseDiagonalProduct.h
+++ b/Eigen/src/Sparse/SparseDiagonalProduct.h
@@ -133,6 +133,8 @@ class ei_sparse_diagonal_product_inner_iterator_selector
const SparseDiagonalProductType& expr, int outer)
: 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>
@@ -165,6 +167,8 @@ class ei_sparse_diagonal_product_inner_iterator_selector
const SparseDiagonalProductType& expr, int outer)
: 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
diff --git a/Eigen/src/Sparse/SparseFlagged.h b/Eigen/src/Sparse/SparseFlagged.h
index 386a80abc..34233e5a1 100644
--- a/Eigen/src/Sparse/SparseFlagged.h
+++ b/Eigen/src/Sparse/SparseFlagged.h
@@ -64,6 +64,9 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas
protected:
ExpressionTypeNested m_matrix;
+
+ private:
+ SparseFlagged& operator=(const SparseFlagged&);
};
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)
: ExpressionType::InnerIterator(xpr.m_matrix, outer)
{}
+
+ private:
+ InnerIterator& operator=(const InnerIterator&);
};
template<typename ExpressionType, unsigned int Added, unsigned int Removed>
diff --git a/Eigen/src/Sparse/SparseMatrix.h b/Eigen/src/Sparse/SparseMatrix.h
index 36fa123fb..e1c740cdb 100644
--- a/Eigen/src/Sparse/SparseMatrix.h
+++ b/Eigen/src/Sparse/SparseMatrix.h
@@ -138,7 +138,7 @@ class SparseMatrix
}
/** \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()
* Initializes the filling process of \c *this.
@@ -236,7 +236,7 @@ class SparseMatrix
// we start a new inner vector
while (previousOuter>=0 && m_outerIndex[previousOuter]==0)
{
- m_outerIndex[previousOuter] = m_data.size();
+ m_outerIndex[previousOuter] = static_cast<int>(m_data.size());
--previousOuter;
}
m_outerIndex[outer+1] = m_outerIndex[outer];
@@ -335,7 +335,7 @@ class SparseMatrix
*/
inline void finalize()
{
- int size = m_data.size();
+ int size = static_cast<int>(m_data.size());
int i = m_outerSize;
// find the last filled column
while (i>=0 && m_outerIndex[i]==0)
@@ -557,6 +557,9 @@ class SparseMatrix<Scalar,_Options>::InnerIterator
int m_id;
const int m_start;
const int m_end;
+
+ private:
+ InnerIterator& operator=(const InnerIterator&);
};
#endif // EIGEN_SPARSEMATRIX_H
diff --git a/Eigen/src/Sparse/SparseTranspose.h b/Eigen/src/Sparse/SparseTranspose.h
index 9a702739d..2689caf79 100644
--- a/Eigen/src/Sparse/SparseTranspose.h
+++ b/Eigen/src/Sparse/SparseTranspose.h
@@ -62,6 +62,9 @@ template<typename MatrixType> class SparseTranspose
protected:
const typename MatrixType::Nested m_matrix;
+
+ private:
+ SparseTranspose& operator=(const SparseTranspose&);
};
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 col() const { return Base::row(); }
+
+ private:
+ InnerIterator& operator=(const InnerIterator&);
};
template<typename MatrixType> class SparseTranspose<MatrixType>::ReverseInnerIterator : public MatrixType::ReverseInnerIterator
diff --git a/Eigen/src/Sparse/SparseTriangular.h b/Eigen/src/Sparse/SparseTriangular.h
index 42e7ff02a..c3d3ea48f 100644
--- a/Eigen/src/Sparse/SparseTriangular.h
+++ b/Eigen/src/Sparse/SparseTriangular.h
@@ -47,6 +47,9 @@ template<typename ExpressionType, int Mode> class SparseTriangular
protected:
ExpressionTypeNested m_matrix;
+
+ private:
+ SparseTriangular& operator=(const SparseTriangular&);
};
template<typename Derived>
diff --git a/Eigen/src/Sparse/SparseVector.h b/Eigen/src/Sparse/SparseVector.h
index 1fa1980b2..b87cae856 100644
--- a/Eigen/src/Sparse/SparseVector.h
+++ b/Eigen/src/Sparse/SparseVector.h
@@ -125,7 +125,7 @@ class SparseVector
inline void setZero() { m_data.clear(); }
/** \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)
{
@@ -374,13 +374,13 @@ class SparseVector<Scalar,_Options>::InnerIterator
{
public:
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);
}
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>
diff --git a/Eigen/src/misc/Image.h b/Eigen/src/misc/Image.h
index 9ed5d5f70..05ffa667c 100644
--- a/Eigen/src/misc/Image.h
+++ b/Eigen/src/misc/Image.h
@@ -67,9 +67,12 @@ template<typename _DecompositionType> struct ei_image_retval_base
}
protected:
- const DecompositionType& m_dec;
- int m_rank, m_cols;
- const MatrixType& m_originalMatrix;
+ const DecompositionType& m_dec;
+ int m_rank, m_cols;
+ const MatrixType& m_originalMatrix;
+
+ private:
+ ei_image_retval_base& operator=(const ei_image_retval_base&);
};
#define EIGEN_MAKE_IMAGE_HELPERS(DecompositionType) \
diff --git a/Eigen/src/misc/Kernel.h b/Eigen/src/misc/Kernel.h
index 717eef450..bb8458e11 100644
--- a/Eigen/src/misc/Kernel.h
+++ b/Eigen/src/misc/Kernel.h
@@ -67,8 +67,11 @@ template<typename _DecompositionType> struct ei_kernel_retval_base
}
protected:
- const DecompositionType& m_dec;
- int m_rank, m_cols;
+ const DecompositionType& m_dec;
+ int m_rank, m_cols;
+
+ private:
+ ei_kernel_retval_base& operator=(const ei_kernel_retval_base&);
};
#define EIGEN_MAKE_KERNEL_HELPERS(DecompositionType) \
diff --git a/Eigen/src/misc/Solve.h b/Eigen/src/misc/Solve.h
index d93869121..75597564b 100644
--- a/Eigen/src/misc/Solve.h
+++ b/Eigen/src/misc/Solve.h
@@ -61,8 +61,11 @@ template<typename _DecompositionType, typename Rhs> struct ei_solve_retval_base
}
protected:
- const DecompositionType& m_dec;
- const typename Rhs::Nested m_rhs;
+ const DecompositionType& m_dec;
+ const typename Rhs::Nested m_rhs;
+
+ private:
+ ei_solve_retval_base& operator=(const ei_solve_retval_base&);
};
#define EIGEN_MAKE_SOLVE_HELPERS(DecompositionType,Rhs) \
diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake
index 8e52152e4..bb1da41de 100644
--- a/cmake/EigenTesting.cmake
+++ b/cmake/EigenTesting.cmake
@@ -222,9 +222,12 @@ if(CMAKE_COMPILER_IS_GNUCXX)
else(EIGEN_COVERAGE_TESTING)
set(COVERAGE_FLAGS "")
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")
- 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)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS} -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")
endif(CMAKE_SYSTEM_NAME MATCHES Linux)
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)
diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp
index 050b14995..009cc5ae2 100644
--- a/test/sparse_basic.cpp
+++ b/test/sparse_basic.cpp
@@ -34,7 +34,7 @@ bool test_random_setter(SparseMatrix<Scalar,Options>& sm, const DenseType& ref,
std::vector<Vector2i> remaining = nonzeroCoords;
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());
remaining[i] = remaining.back();
remaining.pop_back();
@@ -50,7 +50,7 @@ bool test_random_setter(DynamicSparseMatrix<T>& sm, const DenseType& ref, const
std::vector<Vector2i> remaining = nonzeroCoords;
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());
remaining[i] = remaining.back();
remaining.pop_back();
diff --git a/unsupported/Eigen/FFT b/unsupported/Eigen/FFT
index fc2efc1d6..a43cd8d97 100644
--- a/unsupported/Eigen/FFT
+++ b/unsupported/Eigen/FFT
@@ -160,7 +160,7 @@ class FFT
dst.resize( (src.size()>>1)+1);
else
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>
@@ -224,7 +224,7 @@ class FFT
dst.resize( 2*(src.size()-1) );
else
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
diff --git a/unsupported/Eigen/src/BVH/BVAlgorithms.h b/unsupported/Eigen/src/BVH/BVAlgorithms.h
index 47c49be7f..63725763a 100644
--- a/unsupported/Eigen/src/BVH/BVAlgorithms.h
+++ b/unsupported/Eigen/src/BVH/BVAlgorithms.h
@@ -74,6 +74,8 @@ struct ei_intersector_helper1
bool intersectObject(const Object1 &obj) { return intersector.intersectObjectObject(obj, stored); }
Object2 stored;
Intersector &intersector;
+private:
+ ei_intersector_helper1& operator=(const ei_intersector_helper1&);
};
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); }
Object1 stored;
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.
diff --git a/unsupported/Eigen/src/BVH/KdBVH.h b/unsupported/Eigen/src/BVH/KdBVH.h
index ec47254af..c4719607f 100644
--- a/unsupported/Eigen/src/BVH/KdBVH.h
+++ b/unsupported/Eigen/src/BVH/KdBVH.h
@@ -107,7 +107,7 @@ public:
children.clear();
objects.insert(objects.end(), begin, end);
- int n = objects.size();
+ int n = static_cast<int>(objects.size());
if(n < 2)
return; //if we have at most one object, we don't need any internal nodes
@@ -149,7 +149,7 @@ public:
return;
}
- int numBoxes = boxes.size();
+ int numBoxes = static_cast<int>(boxes.size());
int idx = index * 2;
if(children[idx + 1] < numBoxes) { //second index is always bigger
diff --git a/unsupported/Eigen/src/FFT/ei_kissfft_impl.h b/unsupported/Eigen/src/FFT/ei_kissfft_impl.h
index 2dff2bd00..dbd92132e 100644
--- a/unsupported/Eigen/src/FFT/ei_kissfft_impl.h
+++ b/unsupported/Eigen/src/FFT/ei_kissfft_impl.h
@@ -247,7 +247,7 @@ struct ei_kiss_cpx_fft
int u,k,q1,q;
Complex * twiddles = &m_twiddles[0];
Complex t;
- int Norig = m_twiddles.size();
+ int Norig = static_cast<int>(m_twiddles.size());
Complex * scratchbuf = &m_scratchBuf[0];
for ( u=0; u<m; ++u ) {
@@ -262,7 +262,7 @@ struct ei_kiss_cpx_fft
int twidx=0;
Fout[ k ] = scratchbuf[0];
for (q=1;q<p;++q ) {
- twidx += fstride * k;
+ twidx += static_cast<int>(fstride) * k;
if (twidx>=Norig) twidx-=Norig;
t=scratchbuf[q] * twiddles[twidx];
Fout[ k ] += t;
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h
index add000c44..9c0d2e53f 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h
@@ -292,7 +292,7 @@ void MatrixExponential<MatrixType>::computeUV(float)
} else {
const float maxnorm = 3.925724783138660f;
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);
}
}
diff --git a/unsupported/test/Complex.cpp b/unsupported/test/Complex.cpp
index 969e3f4f9..9ea91cf42 100644
--- a/unsupported/test/Complex.cpp
+++ b/unsupported/test/Complex.cpp
@@ -40,7 +40,7 @@ template <typename T>
void take_std( std::complex<T> * dst, int n )
{
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;
}
diff --git a/unsupported/test/FFT.cpp b/unsupported/test/FFT.cpp
index b029ba655..056be2ef3 100644
--- a/unsupported/test/FFT.cpp
+++ b/unsupported/test/FFT.cpp
@@ -46,10 +46,10 @@ complex<long double> promote(long double x) { return complex<long double>( x);
long double difpower=0;
cerr <<"idx\ttruth\t\tvalue\t|dif|=\n";
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;
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) );
}
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 difpower=0;
- size_t n = min( buf1.size(),buf2.size() );
- for (size_t k=0;k<n;++k) {
+ int n = min( buf1.size(),buf2.size() );
+ for (int k=0;k<n;++k) {
totalpower += (norm( buf1[k] ) + norm(buf2[k]) )/2.;
difpower += norm(buf1[k] - buf2[k]);
}