diff --git a/Eigen/src/QR/ColPivHouseholderQR.h b/Eigen/src/QR/ColPivHouseholderQR.h index 8a7c9b9e2..8b01f8179 100644 --- a/Eigen/src/QR/ColPivHouseholderQR.h +++ b/Eigen/src/QR/ColPivHouseholderQR.h @@ -525,8 +525,8 @@ struct solve_retval, Rhs> { eigen_assert(rhs().rows() == dec().rows()); - const int cols = dec().cols(), - nonzero_pivots = dec().nonzeroPivots(); + const Index cols = dec().cols(), + nonzero_pivots = dec().nonzeroPivots(); if(nonzero_pivots == 0) { diff --git a/Eigen/src/SparseLU/SparseLU_pruneL.h b/Eigen/src/SparseLU/SparseLU_pruneL.h index 5a855f82f..66460d168 100644 --- a/Eigen/src/SparseLU/SparseLU_pruneL.h +++ b/Eigen/src/SparseLU/SparseLU_pruneL.h @@ -56,7 +56,7 @@ void SparseLUImpl::pruneL(const Index jcol, const IndexVector& per Index jsupno = glu.supno(jcol); Index i,irep,irep1; bool movnum, do_prune = false; - Index kmin, kmax, minloc, maxloc,krow; + Index kmin = 0, kmax = 0, minloc, maxloc,krow; for (i = 0; i < nseg; i++) { irep = segrep(i); diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp index e011879a5..1694b32c7 100644 --- a/test/geo_quaternion.cpp +++ b/test/geo_quaternion.cpp @@ -32,7 +32,7 @@ template void check_slerp(const QuatType& q0, const QuatType& Scalar theta_tot = AA(q1*q0.inverse()).angle(); if(theta_tot>M_PI) theta_tot = Scalar(2.*M_PI)-theta_tot; - for(Scalar t=0; t<=1.001; t+=0.1) + for(Scalar t=0; t<=Scalar(1.001); t+=Scalar(0.1)) { QuatType q = q0.slerp(t,q1); Scalar theta = AA(q*q0.inverse()).angle(); @@ -156,7 +156,7 @@ template void quaternion(void) check_slerp(q1,q2); q1 = AngleAxisx(b, v1.normalized()); - q2 = AngleAxisx(b+M_PI, v1.normalized()); + q2 = AngleAxisx(b+Scalar(M_PI), v1.normalized()); check_slerp(q1,q2); q1 = AngleAxisx(b, v1.normalized()); diff --git a/test/sizeof.cpp b/test/sizeof.cpp index c454780a6..d9ad35620 100644 --- a/test/sizeof.cpp +++ b/test/sizeof.cpp @@ -13,7 +13,7 @@ template void verifySizeOf(const MatrixType&) { typedef typename MatrixType::Scalar Scalar; if (MatrixType::RowsAtCompileTime!=Dynamic && MatrixType::ColsAtCompileTime!=Dynamic) - VERIFY(sizeof(MatrixType)==sizeof(Scalar)*std::ptrdiff_t(MatrixType::SizeAtCompileTime)); + VERIFY(std::ptrdiff_t(sizeof(MatrixType))==std::ptrdiff_t(sizeof(Scalar))*std::ptrdiff_t(MatrixType::SizeAtCompileTime)); else VERIFY(sizeof(MatrixType)==sizeof(Scalar*) + 2 * sizeof(typename MatrixType::Index)); } diff --git a/test/sparse.h b/test/sparse.h index 1a5ceb38d..a09c65e5f 100644 --- a/test/sparse.h +++ b/test/sparse.h @@ -66,10 +66,10 @@ initSparse(double density, //sparseMat.reserve(int(refMat.rows()*refMat.cols()*density)); sparseMat.reserve(VectorXi::Constant(IsRowMajor ? refMat.rows() : refMat.cols(), int((1.5*density)*(IsRowMajor?refMat.cols():refMat.rows())))); - for(int j=0; j void sparse_basic(const SparseMatrixType& re // test conservative resize { - std::vector< std::pair > inc; - inc.push_back(std::pair(-3,-2)); - inc.push_back(std::pair(0,0)); - inc.push_back(std::pair(3,2)); - inc.push_back(std::pair(3,0)); - inc.push_back(std::pair(0,3)); + std::vector< std::pair > inc; + inc.push_back(std::pair(-3,-2)); + inc.push_back(std::pair(0,0)); + inc.push_back(std::pair(3,2)); + inc.push_back(std::pair(3,0)); + inc.push_back(std::pair(0,3)); for(size_t i = 0; i< inc.size(); i++) { Index incRows = inc[i].first; @@ -472,9 +472,9 @@ template void sparse_basic(const SparseMatrixType& re // Insert new values if (incRows > 0) - m1.insert(refMat1.rows()-1, 0) = refMat1(refMat1.rows()-1, 0) = 1; + m1.insert(m1.rows()-1, 0) = refMat1(refMat1.rows()-1, 0) = 1; if (incCols > 0) - m1.insert(0, refMat1.cols()-1) = refMat1(0, refMat1.cols()-1) = 1; + m1.insert(0, m1.cols()-1) = refMat1(0, refMat1.cols()-1) = 1; VERIFY_IS_APPROX(m1, refMat1);