aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/main.h
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/main.h
parentcb11f2f8a644acbf9a408e8eef737bec122307a0 (diff)
Still fixing warnings.
Diffstat (limited to 'test/main.h')
-rw-r--r--test/main.h5
1 files changed, 3 insertions, 2 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);