aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Hauke Heibel <hauke.heibel@gmail.com>2010-06-20 20:16:45 +0200
committerGravatar Hauke Heibel <hauke.heibel@gmail.com>2010-06-20 20:16:45 +0200
commit546b802b77817dd7f5cd3b6781ce1a1ac0f728b5 (patch)
tree24a2df8a9afc6163563cae1b0c3dd828b1165dc4 /test
parentcb11f2f8a644acbf9a408e8eef737bec122307a0 (diff)
Still fixing warnings.
Diffstat (limited to 'test')
-rw-r--r--test/main.h5
-rw-r--r--test/product.h6
-rw-r--r--test/product_notemporary.cpp8
-rw-r--r--test/qr_fullpivoting.cpp4
-rw-r--r--test/redux.cpp3
5 files changed, 14 insertions, 12 deletions
diff --git a/test/main.h b/test/main.h
index 0f63a2435..426dbcc1f 100644
--- a/test/main.h
+++ b/test/main.h
@@ -385,8 +385,9 @@ bool test_is_equal(const T& actual, const U& expected)
* This is very useful to test rank-revealing algorithms.
*/
template<typename MatrixType>
-void createRandomPIMatrixOfRank(typename MatrixType::Index desired_rank, typename MatrixType::Index rows, int cols, MatrixType& m)
+void createRandomPIMatrixOfRank(typename MatrixType::Index desired_rank, typename MatrixType::Index rows, typename MatrixType::Index cols, MatrixType& m)
{
+ typedef typename ei_traits<MatrixType>::Index Index;
typedef typename ei_traits<MatrixType>::Scalar Scalar;
enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
@@ -412,7 +413,7 @@ void createRandomPIMatrixOfRank(typename MatrixType::Index desired_rank, typenam
MatrixBType b = MatrixBType::Random(cols,cols);
// set the diagonal such that only desired_rank non-zero entries reamain
- const int diag_size = std::min(d.rows(),d.cols());
+ const Index diag_size = std::min(d.rows(),d.cols());
if(diag_size != desired_rank)
d.diagonal().segment(desired_rank, diag_size-desired_rank) = VectorType::Zero(diag_size-desired_rank);
diff --git a/test/product.h b/test/product.h
index d004a4ec4..5365a7dc6 100644
--- a/test/product.h
+++ b/test/product.h
@@ -71,9 +71,9 @@ template<typename MatrixType> void product(const MatrixType& m)
Scalar s1 = ei_random<Scalar>();
- int r = ei_random<int>(0, rows-1),
- c = ei_random<int>(0, cols-1),
- c2 = ei_random<int>(0, cols-1);
+ Index r = ei_random<Index>(0, rows-1),
+ c = ei_random<Index>(0, cols-1),
+ c2 = ei_random<Index>(0, cols-1);
// begin testing Product.h: only associativity for now
// (we use Transpose.h but this doesn't count as a test for it)
diff --git a/test/product_notemporary.cpp b/test/product_notemporary.cpp
index 84d73ff47..ef1dfdc48 100644
--- a/test/product_notemporary.cpp
+++ b/test/product_notemporary.cpp
@@ -60,10 +60,10 @@ template<typename MatrixType> void product_notemporary(const MatrixType& m)
s2 = ei_random<Scalar>(),
s3 = ei_random<Scalar>();
- int c0 = ei_random<int>(4,cols-8),
- c1 = ei_random<int>(8,cols-c0),
- r0 = ei_random<int>(4,cols-8),
- r1 = ei_random<int>(8,rows-r0);
+ Index c0 = ei_random<Index>(4,cols-8),
+ c1 = ei_random<Index>(8,cols-c0),
+ r0 = ei_random<Index>(4,cols-8),
+ r1 = ei_random<Index>(8,rows-r0);
VERIFY_EVALUATION_COUNT( m3 = (m1 * m2.adjoint()), 1);
VERIFY_EVALUATION_COUNT( m3.noalias() = m1 * m2.adjoint(), 0);
diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp
index 6f7831c33..490da0d29 100644
--- a/test/qr_fullpivoting.cpp
+++ b/test/qr_fullpivoting.cpp
@@ -30,8 +30,8 @@ template<typename MatrixType> void qr()
{
typedef typename MatrixType::Index Index;
- Index rows = ei_random<int>(20,200), cols = ei_random<int>(20,200), cols2 = ei_random<int>(20,200);
- Index rank = ei_random<int>(1, std::min(rows, cols)-1);
+ Index rows = ei_random<Index>(20,200), cols = ei_random<int>(20,200), cols2 = ei_random<int>(20,200);
+ Index rank = ei_random<Index>(1, std::min(rows, cols)-1);
typedef typename MatrixType::Scalar Scalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> MatrixQType;
diff --git a/test/redux.cpp b/test/redux.cpp
index 385174831..bcc435d0e 100644
--- a/test/redux.cpp
+++ b/test/redux.cpp
@@ -68,9 +68,10 @@ template<typename MatrixType> void matrixRedux(const MatrixType& m)
template<typename VectorType> void vectorRedux(const VectorType& w)
{
+ typedef typename VectorType::Index Index;
typedef typename VectorType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
- int size = w.size();
+ Index size = w.size();
VectorType v = VectorType::Random(size);
for(int i = 1; i < size; i++)