Fix compilation of some tests as well as more warnings.

This commit is contained in:
Hauke Heibel
2010-06-20 18:59:15 +02:00
parent f1679c7185
commit cb11f2f8a6
6 changed files with 24 additions and 22 deletions

View File

@@ -62,8 +62,8 @@ template<typename MatrixType> void bandmatrix(const MatrixType& _m)
dm1.col(i).setConstant(static_cast<RealScalar>(i+1));
}
Index d = std::min(rows,cols);
Index a = std::max(0,cols-d-supers);
Index b = std::max(0,rows-d-subs);
Index a = std::max<Index>(0,cols-d-supers);
Index b = std::max<Index>(0,rows-d-subs);
if(a>0) dm1.block(0,d+supers,rows,a).setZero();
dm1.block(0,supers+1,cols-supers-1-a,cols-supers-1-a).template triangularView<Upper>().setZero();
dm1.block(subs+1,0,rows-subs-1-b,rows-subs-1-b).template triangularView<Lower>().setZero();
@@ -78,10 +78,10 @@ void test_bandmatrix()
typedef BandMatrix<float>::Index Index;
for(int i = 0; i < 10*g_repeat ; i++) {
Index rows = ei_random<int(1,10);
Index cols = ei_random<int>(1,10);
Index sups = ei_random<int>(0,cols-1);
Index subs = ei_random<int>(0,rows-1);
Index rows = ei_random<Index>(1,10);
Index cols = ei_random<Index>(1,10);
Index sups = ei_random<Index>(0,cols-1);
Index subs = ei_random<Index>(0,rows-1);
CALL_SUBTEST(bandmatrix(BandMatrix<float>(rows,cols,sups,subs)) );
}
}