mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-11-21 03:11:25 +08:00
fix unit tests for integer types in preparation for next changeset making random<int> span over a much bigger range
This commit is contained in:
parent
68a2e04a96
commit
3386a946f8
@ -71,7 +71,7 @@ template<typename MatrixType> void adjoint(const MatrixType& m)
|
||||
VERIFY(internal::isApprox((s1 * v1 + s2 * v2).dot(v3), internal::conj(s1) * v1.dot(v3) + internal::conj(s2) * v2.dot(v3), largerEps));
|
||||
VERIFY(internal::isApprox(v3.dot(s1 * v1 + s2 * v2), s1*v3.dot(v1)+s2*v3.dot(v2), largerEps));
|
||||
VERIFY_IS_APPROX(internal::conj(v1.dot(v2)), v2.dot(v1));
|
||||
VERIFY_IS_APPROX(internal::abs(v1.dot(v1)), v1.squaredNorm());
|
||||
VERIFY_IS_APPROX(internal::real(v1.dot(v1)), v1.squaredNorm());
|
||||
if(!NumTraits<Scalar>::IsInteger)
|
||||
VERIFY_IS_APPROX(v1.squaredNorm(), v1.norm() * v1.norm());
|
||||
VERIFY_IS_MUCH_SMALLER_THAN(internal::abs(vzero.dot(v1)), static_cast<RealScalar>(1));
|
||||
|
@ -50,7 +50,8 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
|
||||
vzero = VectorType::Zero(rows);
|
||||
SquareMatrixType sm1 = SquareMatrixType::Random(rows,rows), sm2(rows,rows);
|
||||
|
||||
Scalar x = internal::random<Scalar>();
|
||||
Scalar x = 0;
|
||||
while(x == Scalar(0)) x = internal::random<Scalar>();
|
||||
|
||||
Index r = internal::random<Index>(0, rows-1),
|
||||
c = internal::random<Index>(0, cols-1);
|
||||
|
Loading…
Reference in New Issue
Block a user