diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-02-29 13:20:44 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-02-29 13:20:44 +0000 |
commit | b3268a6e2fd985bd1abfda0f19f266eaed1c018a (patch) | |
tree | 82443dbc189ebec31d455383efdb13014ed94956 /Eigen/src/Core/NumTraits.h | |
parent | aa8e2bcbde59b3a25de2e735a926667931f4b0e5 (diff) |
-merge patch from Gael Guennebaud adding NumTraits for long long
and long double.
-define scalar-multiple operators only for the current Scalar type;
thanks to Gael for expaining how to make the compiler understand
when automatic casting is needed.
-take ScalarMultiple take only 1 template param, again.
We lose some flexibility especially when dealing with complex numbers,
but we gain a lot of extensibility to new scalar types.
Diffstat (limited to 'Eigen/src/Core/NumTraits.h')
-rw-r--r-- | Eigen/src/Core/NumTraits.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Eigen/src/Core/NumTraits.h b/Eigen/src/Core/NumTraits.h index 10a378d83..cc541af8f 100644 --- a/Eigen/src/Core/NumTraits.h +++ b/Eigen/src/Core/NumTraits.h @@ -87,4 +87,24 @@ template<typename _Real> struct NumTraits<std::complex<_Real> > }; }; +template<> struct NumTraits<long long int> +{ + typedef long long int Real; + typedef long double FloatingPoint; + enum { + IsComplex = 0, + HasFloatingPoint = 0 + }; +}; + +template<> struct NumTraits<long double> +{ + typedef long double Real; + typedef long double FloatingPoint; + enum { + IsComplex = 0, + HasFloatingPoint = 1 + }; +}; + #endif // EIGEN_NUMTRAITS_H |