mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Complete rework of global math functions and NumTraits.
* Now completely generic so all standard integer types (like char...) are supported. ** add unit test for that (integer_types). * NumTraits does no longer inherit numeric_limits * All math functions are now templated * Better guard (static asserts) against using certain math functions on integer types.
This commit is contained in:
@@ -61,7 +61,7 @@ template<typename MatrixType> void linearStructure(const MatrixType& m)
|
||||
VERIFY_IS_APPROX(m3, m2-m1);
|
||||
m3 = m2; m3 *= s1;
|
||||
VERIFY_IS_APPROX(m3, s1*m2);
|
||||
if(NumTraits<Scalar>::HasFloatingPoint)
|
||||
if(!NumTraits<Scalar>::IsInteger)
|
||||
{
|
||||
m3 = m2; m3 /= s1;
|
||||
VERIFY_IS_APPROX(m3, m2/s1);
|
||||
@@ -73,7 +73,7 @@ template<typename MatrixType> void linearStructure(const MatrixType& m)
|
||||
VERIFY_IS_APPROX((m1+m2)(r,c), (m1(r,c))+(m2(r,c)));
|
||||
VERIFY_IS_APPROX((s1*m1)(r,c), s1*(m1(r,c)));
|
||||
VERIFY_IS_APPROX((m1*s1)(r,c), (m1(r,c))*s1);
|
||||
if(NumTraits<Scalar>::HasFloatingPoint)
|
||||
if(!NumTraits<Scalar>::IsInteger)
|
||||
VERIFY_IS_APPROX((m1/s1)(r,c), (m1(r,c))/s1);
|
||||
|
||||
// use .block to disable vectorization and compare to the vectorized version
|
||||
|
||||
Reference in New Issue
Block a user