mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 19:59:05 +08:00
Added to possibility to compile unit tests at maximum warning level.
Silenced (amongst others) many conversion related warnings.
This commit is contained in:
parent
494a88685e
commit
d088ee35f6
@ -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})
|
||||
|
||||
|
@ -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> >
|
||||
|
@ -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
|
||||
|
@ -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().
|
||||
|
@ -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().
|
||||
|
@ -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
|
||||
|
@ -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&);
|
||||
};
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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 *****************************************************************/
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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) )
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -156,6 +156,9 @@ template<typename ExpressionType> class SparseCwise
|
||||
|
||||
protected:
|
||||
ExpressionTypeNested m_matrix;
|
||||
|
||||
private:
|
||||
SparseCwise& operator=(const SparseCwise&);
|
||||
};
|
||||
|
||||
template<typename Derived>
|
||||
|
@ -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)
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -47,6 +47,9 @@ template<typename ExpressionType, int Mode> class SparseTriangular
|
||||
|
||||
protected:
|
||||
ExpressionTypeNested m_matrix;
|
||||
|
||||
private:
|
||||
SparseTriangular& operator=(const SparseTriangular&);
|
||||
};
|
||||
|
||||
template<typename Derived>
|
||||
|
@ -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>
|
||||
|
@ -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) \
|
||||
|
@ -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) \
|
||||
|
@ -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) \
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user