mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
-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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user