improve/fix stable_norm unit test

This commit is contained in:
Gael Guennebaud
2010-06-08 13:29:27 +02:00
parent 626afe8b62
commit 4b5d359c3a
2 changed files with 36 additions and 17 deletions

View File

@@ -51,8 +51,8 @@ void testVectorType(const VectorType& base)
{
typedef typename ei_traits<VectorType>::Scalar Scalar;
Scalar low = ei_random<Scalar>(-500,500);
Scalar high = ei_random<Scalar>(-500,500);
if (low>high) std::swap(low,high);
Scalar high = ei_random<Scalar>(-500,500);
if (low>high) std::swap(low,high);
const int size = base.size();
const Scalar step = (high-low)/(size-1);
@@ -91,7 +91,7 @@ void testVectorType(const VectorType& base)
Matrix<Scalar,Dynamic,1> size_changer(size+50);
size_changer.setLinSpaced(low,high,size);
VERIFY( size_changer.size() == size );
VERIFY( size_changer.size() == size );
}
template<typename MatrixType>