mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user