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:
Benoit Jacob
2010-04-28 18:51:38 -04:00
parent 4f83d6ad19
commit e277586958
26 changed files with 900 additions and 498 deletions

View File

@@ -149,7 +149,6 @@ namespace Eigen
#define EIGEN_INTERNAL_DEBUGGING
#define EIGEN_NICE_RANDOM
#include <Eigen/QR> // required for createRandomPIMatrixOfRank
@@ -273,8 +272,7 @@ namespace Eigen
namespace Eigen {
template<typename T> inline typename NumTraits<T>::Real test_precision();
template<> inline int test_precision<int>() { return 0; }
template<typename T> inline typename NumTraits<T>::Real test_precision() { return T(0); }
template<> inline float test_precision<float>() { return 1e-3f; }
template<> inline double test_precision<double>() { return 1e-6; }
template<> inline float test_precision<std::complex<float> >() { return test_precision<float>(); }