14 #if defined(__CUDA_ARCH__) 16 #include <math_constants.h> 19 #if EIGEN_COMP_ICC>=1600 && __cplusplus >= 201103L 46 #if EIGEN_COMP_ICC>=1600 && __cplusplus >= 201103L 47 typedef std::intptr_t
IntPtr;
57 template<
bool Condition,
typename Then,
typename Else>
60 template<
typename Then,
typename Else>
63 template<
typename T,
typename U>
struct is_same {
enum {
value = 0 }; };
75 template <
class T>
struct remove_const<const T[]> {
typedef T type[]; };
76 template <
class T,
unsigned int Size>
struct remove_const<const T[Size]> {
typedef T type[Size]; };
113 using std::make_unsigned;
129 template<>
struct make_unsigned<signed __int64> {
typedef unsigned __int64
type; };
130 template<>
struct make_unsigned<unsigned __int64> {
typedef unsigned __int64
type; };
147 template<
typename From,
typename To>
159 static yes test(
const To&,
int);
164 #ifdef __INTEL_COMPILER 166 #pragma warning ( disable : 2259 ) 168 enum {
value =
sizeof(test(ms_from, 0))==
sizeof(
yes) };
169 #ifdef __INTEL_COMPILER 174 template<
typename From,
typename To>
184 template<
bool Condition,
typename T=
void>
struct enable_if;
189 #if defined(__CUDA_ARCH__) 190 #if !defined(__FLT_EPSILON__) 191 #define __FLT_EPSILON__ FLT_EPSILON 192 #define __DBL_EPSILON__ DBL_EPSILON 197 template<
typename T>
struct numeric_limits
200 static T epsilon() {
return 0; }
201 static T (
max)() { assert(
false &&
"Highest not supported for this type"); }
202 static T (
min)() { assert(
false &&
"Lowest not supported for this type"); }
203 static T infinity() { assert(
false &&
"Infinity not supported for this type"); }
204 static T quiet_NaN() { assert(
false &&
"quiet_NaN not supported for this type"); }
206 template<>
struct numeric_limits<float>
209 static float epsilon() {
return __FLT_EPSILON__; }
211 static float (
max)() {
return CUDART_MAX_NORMAL_F; }
213 static float (
min)() {
return FLT_MIN; }
215 static float infinity() {
return CUDART_INF_F; }
217 static float quiet_NaN() {
return CUDART_NAN_F; }
219 template<>
struct numeric_limits<double>
222 static double epsilon() {
return __DBL_EPSILON__; }
224 static double (
max)() {
return DBL_MAX; }
226 static double (
min)() {
return DBL_MIN; }
228 static double infinity() {
return CUDART_INF; }
230 static double quiet_NaN() {
return CUDART_NAN; }
232 template<>
struct numeric_limits<int>
235 static int epsilon() {
return 0; }
237 static int (
max)() {
return INT_MAX; }
239 static int (
min)() {
return INT_MIN; }
241 template<>
struct numeric_limits<unsigned int>
244 static unsigned int epsilon() {
return 0; }
246 static unsigned int (
max)() {
return UINT_MAX; }
248 static unsigned int (
min)() {
return 0; }
250 template<>
struct numeric_limits<long>
253 static long epsilon() {
return 0; }
255 static long (
max)() {
return LONG_MAX; }
257 static long (
min)() {
return LONG_MIN; }
259 template<>
struct numeric_limits<unsigned long>
262 static unsigned long epsilon() {
return 0; }
264 static unsigned long (
max)() {
return ULONG_MAX; }
266 static unsigned long (
min)() {
return 0; }
268 template<>
struct numeric_limits<long long>
271 static long long epsilon() {
return 0; }
273 static long long (
max)() {
return LLONG_MAX; }
275 static long long (
min)() {
return LLONG_MIN; }
277 template<>
struct numeric_limits<unsigned long long>
280 static unsigned long long epsilon() {
return 0; }
282 static unsigned long long (
max)() {
return ULLONG_MAX; }
284 static unsigned long long (
min)() {
return 0; }
297 EIGEN_DEVICE_FUNC
const noncopyable& operator=(
const noncopyable&);
310 #if EIGEN_HAS_STD_RESULT_OF 312 typedef typename std::result_of<T>::type type1;
322 template<
typename Func,
typename ArgType,
int SizeOf=sizeof(has_none)>
325 template<
typename Func,
typename ArgType>
328 template<
typename Func,
typename ArgType>
331 template<
typename Func,
typename ArgType>
336 static has_tr1_result testFunctor(T
const *,
typename T::template result<T(ArgType)>::
type const * = 0);
340 enum {FunctorType =
sizeof(testFunctor(static_cast<Func*>(0)))};
344 template<
typename Func,
typename ArgType0,
typename ArgType1,
int SizeOf=sizeof(has_none)>
347 template<
typename Func,
typename ArgType0,
typename ArgType1>
349 {
typedef typename Func::result_type
type;};
351 template<
typename Func,
typename ArgType0,
typename ArgType1>
353 {
typedef typename Func::template result<Func(ArgType0,ArgType1)>::type
type;};
355 template<
typename Func,
typename ArgType0,
typename ArgType1>
360 static has_tr1_result testFunctor(T
const *,
typename T::template result<T(ArgType0,ArgType1)>::
type const * = 0);
364 enum {FunctorType =
sizeof(testFunctor(static_cast<Func*>(0)))};
368 template<
typename Func,
typename ArgType0,
typename ArgType1,
typename ArgType2,
int SizeOf=sizeof(has_none)>
371 template<
typename Func,
typename ArgType0,
typename ArgType1,
typename ArgType2>
373 {
typedef typename Func::result_type
type;};
375 template<
typename Func,
typename ArgType0,
typename ArgType1,
typename ArgType2>
377 {
typedef typename Func::template result<Func(ArgType0,ArgType1,ArgType2)>::type
type;};
379 template<
typename Func,
typename ArgType0,
typename ArgType1,
typename ArgType2>
384 static has_tr1_result testFunctor(T
const *,
typename T::template result<T(ArgType0,ArgType1,ArgType2)>::
type const * = 0);
388 enum {FunctorType =
sizeof(testFunctor(static_cast<Func*>(0)))};
397 template <
typename T>
400 template <
typename C>
static meta_yes testFunctor(
typename C::ReturnType
const *);
401 template <
typename C>
static meta_no testFunctor(...);
408 template <
typename T,
typename IndexType=Index>
411 template <
typename C>
static meta_yes testFunctor(C
const *,
typename enable_if<(
sizeof(return_ptr<C>()->
operator()())>0)>::type * = 0);
412 static meta_no testFunctor(...);
414 enum {
value =
sizeof(testFunctor(static_cast<T*>(0))) ==
sizeof(
meta_yes) };
417 template <
typename T,
typename IndexType=Index>
420 template <
typename C>
static meta_yes testFunctor(C
const *,
typename enable_if<(
sizeof(return_ptr<C>()->
operator()(IndexType(0)))>0)>::type * = 0);
421 static meta_no testFunctor(...);
423 enum {
value =
sizeof(testFunctor(static_cast<T*>(0))) ==
sizeof(
meta_yes) };
426 template <
typename T,
typename IndexType=Index>
429 template <
typename C>
static meta_yes testFunctor(C
const *,
typename enable_if<(
sizeof(return_ptr<C>()->
operator()(IndexType(0),IndexType(0)))>0)>::type * = 0);
430 static meta_no testFunctor(...);
432 enum {
value =
sizeof(testFunctor(static_cast<T*>(0))) ==
sizeof(
meta_yes) };
440 int SupX = ((Y==1) ? 1 : Y/2),
441 bool Done = ((SupX-InfX)<=1 ?
true : ((SupX*SupX <= Y) && ((SupX+1)*(SupX+1) > Y))) >
446 MidX = (InfX+SupX)/2,
447 TakeInf = MidX*MidX > Y ? 1 : 0,
448 NewInf =
int(TakeInf) ? InfX :
int(MidX),
449 NewSup =
int(TakeInf) ?
int(MidX) : SupX
455 template<
int Y,
int InfX,
int SupX>
456 class meta_sqrt<Y, InfX, SupX, true> {
public:
enum {
ret = (SupX*SupX <= Y) ? SupX : InfX }; };
463 template<
int A,
int B,
int K=1,
bool Done = ((A*K)%B)==0>
468 template<
int A,
int B,
int K>
477 enum { Defined = 0 };
490 #if defined(__CUDA_ARCH__) 491 template<
typename T> EIGEN_DEVICE_FUNC
void swap(T &
a, T &
b) { T tmp =
b; b =
a; a = tmp; }
496 #if defined(__CUDA_ARCH__) 497 using internal::device::numeric_limits;
499 using std::numeric_limits;
516 bool equal_strict(
const float&
x,
const float&
y) {
return std::equal_to<float>()(x,y); }
519 bool equal_strict(
const double&
x,
const double&
y) {
return std::equal_to<double>()(x,y); }
534 #endif // EIGEN_META_H
#define EIGEN_STRONG_INLINE
remove_all< T >::type type
EIGEN_DEVICE_FUNC ~noncopyable()
Func::template result< Func(ArgType)>::type type
Func::template result< Func(ArgType0, ArgType1)>::type type
remove_all< T >::type type
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE
remove_all< T >::type type
MatrixType A(a, *n, *n, *lda)
remove_all< T >::type type
int EIGEN_BLAS_FUNC() swap(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_STRONG_INLINE bool not_equal_strict(const double &x, const double &y)
T div_ceil(const T &a, const T &b)
ternary_result_of_select< Func, ArgType0, ArgType1, ArgType2, FunctorType >::type type
Func::template result< Func(ArgType0, ArgType1, ArgType2)>::type type
EIGEN_DEVICE_FUNC noncopyable()
EIGEN_STRONG_INLINE bool equal_strict(const double &x, const double &y)
unary_result_of_select< Func, ArgType, FunctorType >::type type
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
internal::remove_all< ArgType0 >::type type
internal::remove_all< ArgType >::type type
remove_all< T >::type type
MatrixType B(b, *n, *nrhs, *ldb)
binary_result_of_select< Func, ArgType0, ArgType1, FunctorType >::type type
internal::remove_all< ArgType0 >::type type
void swap(scoped_array< T > &a, scoped_array< T > &b)