Fixed uninitialized variables in unit tests.

Fixed /W4 warning C4512 (LU was left out on purpose).
This commit is contained in:
Hauke Heibel 2009-10-14 08:33:36 +02:00
parent 5e24fbbead
commit ffee27bf72
21 changed files with 87 additions and 6 deletions

View File

@ -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> >
@ -138,6 +140,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> >

View File

@ -133,6 +133,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
@ -290,6 +292,9 @@ template<typename ExpressionType, int Direction> class PartialRedux
protected:
ExpressionTypeNested m_matrix;
private:
PartialRedux& operator=(const PartialRedux&);
};
/** \array_module

View File

@ -116,6 +116,9 @@ struct CommaInitializer
int m_row; // current row id
int m_col; // current col id
int m_currentBlockRows; // current block height
private:
CommaInitializer& operator=(const CommaInitializer&);
};
/** \anchor MatrixBaseCommaInitRef

View File

@ -178,6 +178,9 @@ template<typename ExpressionType> class Cwise
protected:
ExpressionTypeNested m_matrix;
private:
Cwise& operator=(const Cwise&);
};
/** \returns a Cwise wrapper of *this providing additional coefficient-wise operations

View File

@ -109,6 +109,9 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas
protected:
ExpressionTypeNested m_matrix;
private:
Flagged& operator=(const Flagged&);
};
/** \returns an expression of *this with added flags

View File

@ -279,6 +279,8 @@ struct ei_scalar_multiple_op {
EIGEN_STRONG_INLINE const PacketScalar packetOp(const PacketScalar& a) const
{ return ei_pmul(a, ei_pset1(m_other)); }
const Scalar m_other;
private:
ei_scalar_multiple_op& operator=(const ei_scalar_multiple_op&);
};
template<typename Scalar>
struct ei_functor_traits<ei_scalar_multiple_op<Scalar> >
@ -294,6 +296,8 @@ struct ei_scalar_quotient1_impl {
EIGEN_STRONG_INLINE const PacketScalar packetOp(const PacketScalar& a) const
{ return ei_pmul(a, ei_pset1(m_other)); }
const Scalar m_other;
private:
ei_scalar_quotient1_impl& operator=(const ei_scalar_quotient1_impl&);
};
template<typename Scalar>
struct ei_functor_traits<ei_scalar_quotient1_impl<Scalar,true> >
@ -306,6 +310,8 @@ struct ei_scalar_quotient1_impl<Scalar,false> {
EIGEN_STRONG_INLINE ei_scalar_quotient1_impl(const Scalar& other) : m_other(other) {}
EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a / m_other; }
const Scalar m_other;
private:
ei_scalar_quotient1_impl& operator=(const ei_scalar_quotient1_impl&);
};
template<typename Scalar>
struct ei_functor_traits<ei_scalar_quotient1_impl<Scalar,false> >
@ -323,6 +329,8 @@ template<typename Scalar>
struct ei_scalar_quotient1_op : ei_scalar_quotient1_impl<Scalar, NumTraits<Scalar>::HasFloatingPoint > {
EIGEN_STRONG_INLINE ei_scalar_quotient1_op(const Scalar& other)
: ei_scalar_quotient1_impl<Scalar, NumTraits<Scalar>::HasFloatingPoint >(other) {}
private:
ei_scalar_quotient1_op& operator=(const ei_scalar_quotient1_op&);
};
// nullary functors
@ -335,6 +343,8 @@ struct ei_scalar_constant_op {
EIGEN_STRONG_INLINE const Scalar operator() (int, int = 0) const { return m_other; }
EIGEN_STRONG_INLINE const PacketScalar packetOp() const { return ei_pset1(m_other); }
const Scalar m_other;
private:
ei_scalar_constant_op& operator=(const ei_scalar_constant_op&);
};
template<typename Scalar>
struct ei_functor_traits<ei_scalar_constant_op<Scalar> >

View File

@ -100,6 +100,9 @@ template<typename ExpressionType> class NestByValue
protected:
const ExpressionType m_expression;
private:
NestByValue& operator=(const NestByValue&);
};
/** \returns an expression of the temporary version of *this.

View File

@ -124,8 +124,10 @@ template<typename MatrixType, unsigned int Mode> class Part
}
protected:
const typename MatrixType::Nested m_matrix;
private:
Part& operator=(const Part&);
};
/** \nonstableyet

View File

@ -117,6 +117,9 @@ template<typename ExpressionType> class SwapWrapper
protected:
ExpressionType& m_expression;
private:
SwapWrapper& operator=(const SwapWrapper&);
};
/** swaps *this with the expression \a other.

View File

@ -370,6 +370,9 @@ class AmbiVector<_Scalar>::Iterator
int m_cachedIndex; // current coordinate
Scalar m_cachedValue; // current value
bool m_isDense; // mode of the vector
private:
Iterator& operator=(const Iterator&);
};

View File

@ -289,9 +289,11 @@ class DynamicSparseMatrix<Scalar,_Flags>::InnerIterator : public SparseVector<Sc
inline int row() const { return IsRowMajor ? m_outer : Base::index(); }
inline int col() const { return IsRowMajor ? Base::index() : m_outer; }
protected:
const int m_outer;
private:
InnerIterator& operator=(const InnerIterator&);
};
#endif // EIGEN_DYNAMIC_SPARSEMATRIX_H

View File

@ -53,6 +53,9 @@ class SparseInnerVectorSet : ei_no_assignment_operator,
inline InnerIterator(const SparseInnerVectorSet& xpr, int outer)
: MatrixType::InnerIterator(xpr.m_matrix, xpr.m_outerStart + outer)
{}
private:
InnerIterator& operator=(const InnerIterator&);
};
inline SparseInnerVectorSet(const MatrixType& matrix, int outerStart, int outerSize)
@ -110,6 +113,8 @@ class SparseInnerVectorSet<DynamicSparseMatrix<_Scalar, _Options>, Size>
inline InnerIterator(const SparseInnerVectorSet& xpr, int outer)
: MatrixType::InnerIterator(xpr.m_matrix, xpr.m_outerStart + outer)
{}
private:
InnerIterator& operator=(const InnerIterator&);
};
inline SparseInnerVectorSet(const MatrixType& matrix, int outerStart, int outerSize)

View File

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

View File

@ -126,6 +126,8 @@ 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 +199,9 @@ 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,9 @@ 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)
@ -290,6 +298,9 @@ class ei_sparse_cwise_binary_op_inner_iterator_selector<ei_scalar_product_op<T>,
LhsIterator m_lhsIter;
const BinaryFunc m_functor;
const int m_outer;
private:
ei_sparse_cwise_binary_op_inner_iterator_selector& operator=(const ei_sparse_cwise_binary_op_inner_iterator_selector&);
};
// sparse - dense (product)

View File

@ -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>

View File

@ -120,6 +120,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>

View File

@ -64,16 +64,21 @@ 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>
class SparseFlagged<ExpressionType,Added,Removed>::InnerIterator : public ExpressionType::InnerIterator
{
public:
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>

View File

@ -444,6 +444,9 @@ class SparseMatrix<Scalar,_Flags>::InnerIterator
int m_id;
const int m_start;
const int m_end;
private:
InnerIterator& operator=(const InnerIterator&);
};
#endif // EIGEN_SPARSEMATRIX_H

View File

@ -62,15 +62,20 @@ 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
{
public:
EIGEN_STRONG_INLINE InnerIterator(const SparseTranspose& trans, int outer)
: MatrixType::InnerIterator(trans.m_matrix, outer)
{}
private:
InnerIterator& operator=(const InnerIterator&);
};
template<typename MatrixType> class SparseTranspose<MatrixType>::ReverseInnerIterator : public MatrixType::ReverseInnerIterator

View File

@ -360,6 +360,9 @@ class SparseVector<Scalar,_Flags>::InnerIterator
const CompressedStorage<Scalar>& m_data;
int m_id;
const int m_end;
private:
InnerIterator& operator=(const InnerIterator&);
};
#endif // EIGEN_SPARSEVECTOR_H

View File

@ -40,7 +40,7 @@ template<typename MatrixType> void matrixVisitor(const MatrixType& p)
m(i) = ei_random<Scalar>();
Scalar minc = Scalar(1000), maxc = Scalar(-1000);
int minrow,mincol,maxrow,maxcol;
int minrow=0,mincol=0,maxrow=0,maxcol=0;
for(int j = 0; j < cols; j++)
for(int i = 0; i < rows; i++)
{
@ -86,7 +86,7 @@ template<typename VectorType> void vectorVisitor(const VectorType& w)
v(i) = ei_random<Scalar>();
Scalar minc = Scalar(1000), maxc = Scalar(-1000);
int minidx,maxidx;
int minidx=0,maxidx=0;
for(int i = 0; i < size; i++)
{
if(v(i) < minc)