fix more variable-set-but-not-used warnings on gcc 4.6

This commit is contained in:
Benoit Jacob 2011-10-31 00:51:36 -04:00
parent 6a1caf0351
commit 0609dbeec6
10 changed files with 18 additions and 44 deletions

View File

@ -43,8 +43,6 @@ template<typename MatrixType> void adjoint(const MatrixType& m)
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
mzero = MatrixType::Zero(rows, cols),
identity = SquareMatrixType::Identity(rows, rows),
square = SquareMatrixType::Random(rows, rows);
VectorType v1 = VectorType::Random(rows),
v2 = VectorType::Random(rows),

View File

@ -42,12 +42,8 @@ template<typename MatrixType> void block(const MatrixType& m)
m1_copy = m1,
m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
mzero = MatrixType::Zero(rows, cols),
ones = MatrixType::Ones(rows, cols);
VectorType v1 = VectorType::Random(rows),
v2 = VectorType::Random(rows),
v3 = VectorType::Random(rows),
vzero = VectorType::Zero(rows);
VectorType v1 = VectorType::Random(rows);
Scalar s1 = internal::random<Scalar>();

View File

@ -325,4 +325,6 @@ void test_cholesky()
// Test problem size constructors
CALL_SUBTEST_9( LLT<MatrixXf>(10) );
CALL_SUBTEST_9( LDLT<MatrixXf>(10) );
EIGEN_UNUSED_VARIABLE(s)
}

View File

@ -78,4 +78,5 @@ void test_determinant()
s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
CALL_SUBTEST_6( determinant(MatrixXd(s, s)) );
}
EIGEN_UNUSED_VARIABLE(s)
}

View File

@ -41,7 +41,6 @@ template<typename MatrixType> void inverse(const MatrixType& m)
MatrixType m1(rows, cols),
m2(rows, cols),
mzero = MatrixType::Zero(rows, cols),
identity = MatrixType::Identity(rows, rows);
createRandomPIMatrixOfRank(rows,rows,rows,m1);
m2 = m1.inverse();
@ -114,4 +113,5 @@ void test_inverse()
CALL_SUBTEST_7( inverse(Matrix4d()) );
CALL_SUBTEST_7( inverse(Matrix<double,4,4,DontAlign>()) );
}
EIGEN_UNUSED_VARIABLE(s)
}

View File

@ -52,15 +52,7 @@ template<typename MatrixType> void nomalloc(const MatrixType& m)
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
mzero = MatrixType::Zero(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Identity(rows, rows),
square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Random(rows, rows);
VectorType v1 = VectorType::Random(rows),
v2 = VectorType::Random(rows),
vzero = VectorType::Zero(rows);
m3(rows, cols);
Scalar s1 = internal::random<Scalar>();

View File

@ -54,8 +54,7 @@ template<typename MatrixType> void product(const MatrixType& m)
// to test it, hence I consider that we will have tested Random.h
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
mzero = MatrixType::Zero(rows, cols);
m3(rows, cols);
RowSquareMatrixType
identity = RowSquareMatrixType::Identity(rows, rows),
square = RowSquareMatrixType::Random(rows, rows),
@ -63,9 +62,7 @@ template<typename MatrixType> void product(const MatrixType& m)
ColSquareMatrixType
square2 = ColSquareMatrixType::Random(cols, cols),
res2 = ColSquareMatrixType::Random(cols, cols);
RowVectorType v1 = RowVectorType::Random(rows),
v2 = RowVectorType::Random(rows),
vzero = RowVectorType::Zero(rows);
RowVectorType v1 = RowVectorType::Random(rows);
ColVectorType vc2 = ColVectorType::Random(cols), vcres(cols);
OtherMajorMatrixType tm1 = m1;

View File

@ -100,4 +100,5 @@ void test_product_trmv()
s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE);
CALL_SUBTEST_6( trmv(Matrix<float,Dynamic,Dynamic,RowMajor>(s, s)) );
}
EIGEN_UNUSED_VARIABLE(s);
}

View File

@ -54,7 +54,8 @@ template<typename MatrixType> void selfadjoint(const MatrixType& m)
void bug_159()
{
Matrix3d m = Matrix3d::Random().selfadjointView<Lower>();
Matrix3d m = Matrix3d::Random().selfadjointView<Lower>();
EIGEN_UNUSED_VARIABLE(m)
}
void test_selfadjoint()
@ -68,6 +69,8 @@ void test_selfadjoint()
CALL_SUBTEST_3( selfadjoint(Matrix3cf()) );
CALL_SUBTEST_4( selfadjoint(MatrixXcd(s,s)) );
CALL_SUBTEST_5( selfadjoint(Matrix<float,Dynamic,Dynamic,RowMajor>(s, s)) );
EIGEN_UNUSED_VARIABLE(s)
}
CALL_SUBTEST_1( bug_159() );

View File

@ -42,16 +42,8 @@ template<typename MatrixType> void triangular_square(const MatrixType& m)
m3(rows, cols),
m4(rows, cols),
r1(rows, cols),
r2(rows, cols),
mzero = MatrixType::Zero(rows, cols),
mones = MatrixType::Ones(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Identity(rows, rows),
square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Random(rows, rows);
VectorType v1 = VectorType::Random(rows),
v2 = VectorType::Random(rows),
vzero = VectorType::Zero(rows);
r2(rows, cols);
VectorType v2 = VectorType::Random(rows);
MatrixType m1up = m1.template triangularView<Upper>();
MatrixType m2up = m2.template triangularView<Upper>();
@ -158,16 +150,7 @@ template<typename MatrixType> void triangular_rect(const MatrixType& m)
m3(rows, cols),
m4(rows, cols),
r1(rows, cols),
r2(rows, cols),
mzero = MatrixType::Zero(rows, cols),
mones = MatrixType::Ones(rows, cols);
RMatrixType identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Identity(rows, rows),
square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Random(rows, rows);
VectorType v1 = VectorType::Random(rows),
v2 = VectorType::Random(rows),
vzero = VectorType::Zero(rows);
r2(rows, cols);
MatrixType m1up = m1.template triangularView<Upper>();
MatrixType m2up = m2.template triangularView<Upper>();
@ -237,7 +220,8 @@ template<typename MatrixType> void triangular_rect(const MatrixType& m)
void bug_159()
{
Matrix3d m = Matrix3d::Random().triangularView<Lower>();
Matrix3d m = Matrix3d::Random().triangularView<Lower>();
EIGEN_UNUSED_VARIABLE(m)
}
void test_triangular()