limits.hpp
/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2011, Willow Garage, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: Anatoly Baskeheev, Itseez Ltd, (myname.mysurname@mycompany.com)
*/
#ifndef PCL_DEVICE_NUMERIC_LIMITS_HPP_
#define PCL_DEVICE_NUMERIC_LIMITS_HPP_
namespace pcl
{
namespace device
{
template<class T> struct numeric_limits
{
typedef T type;
__device__ __forceinline__ static type min() { return type(); };
__device__ __forceinline__ static type max() { return type(); };
__device__ __forceinline__ static type epsilon() { return type(); }
__device__ __forceinline__ static type round_error() { return type(); }
__device__ __forceinline__ static type denorm_min() { return type(); }
__device__ __forceinline__ static type infinity() { return type(); }
__device__ __forceinline__ static type quiet_NaN() { return type(); }
__device__ __forceinline__ static type signaling_NaN() { return T(); }
static const bool is_signed;
};
template<> struct numeric_limits<bool>
{
typedef bool type;
__device__ __forceinline__ static type min() { return false; };
__device__ __forceinline__ static type max() { return true; };
__device__ __forceinline__ static type epsilon();
__device__ __forceinline__ static type round_error();
__device__ __forceinline__ static type denorm_min();
__device__ __forceinline__ static type infinity();
__device__ __forceinline__ static type quiet_NaN();
__device__ __forceinline__ static type signaling_NaN();
static const bool is_signed = false;
};
template<> struct numeric_limits<char>
{
typedef char type;
__device__ __forceinline__ static type min() { return CHAR_MIN; };
__device__ __forceinline__ static type max() { return CHAR_MAX; };
__device__ __forceinline__ static type epsilon();
__device__ __forceinline__ static type round_error();
__device__ __forceinline__ static type denorm_min();
__device__ __forceinline__ static type infinity();
__device__ __forceinline__ static type quiet_NaN();
__device__ __forceinline__ static type signaling_NaN();
static const bool is_signed = (char)-1 == -1;
};
template<> struct numeric_limits<signed char>
{
typedef char type;
__device__ __forceinline__ static type min() { return CHAR_MIN; };
__device__ __forceinline__ static type max() { return CHAR_MAX; };
__device__ __forceinline__ static type epsilon();
__device__ __forceinline__ static type round_error();
__device__ __forceinline__ static type denorm_min();
__device__ __forceinline__ static type infinity();
__device__ __forceinline__ static type quiet_NaN();
__device__ __forceinline__ static type signaling_NaN();
static const bool is_signed = (signed char)-1 == -1;
};
template<> struct numeric_limits<unsigned char>
{
typedef unsigned char type;
__device__ __forceinline__ static type min() { return 0; };
__device__ __forceinline__ static type max() { return UCHAR_MAX; };
__device__ __forceinline__ static type epsilon();
__device__ __forceinline__ static type round_error();
__device__ __forceinline__ static type denorm_min();
__device__ __forceinline__ static type infinity();
__device__ __forceinline__ static type quiet_NaN();
__device__ __forceinline__ static type signaling_NaN();
static const bool is_signed = false;
};
template<> struct numeric_limits<short>
{
typedef short type;
__device__ __forceinline__ static type min() { return SHRT_MIN; };
__device__ __forceinline__ static type max() { return SHRT_MAX; };
__device__ __forceinline__ static type epsilon();
__device__ __forceinline__ static type round_error();
__device__ __forceinline__ static type denorm_min();
__device__ __forceinline__ static type infinity();
__device__ __forceinline__ static type quiet_NaN();
__device__ __forceinline__ static type signaling_NaN();
static const bool is_signed = true;
};
template<> struct numeric_limits<unsigned short>
{
typedef unsigned short type;
__device__ __forceinline__ static type min() { return 0; };
__device__ __forceinline__ static type max() { return USHRT_MAX; };
__device__ __forceinline__ static type epsilon();
__device__ __forceinline__ static type round_error();
__device__ __forceinline__ static type denorm_min();
__device__ __forceinline__ static type infinity();
__device__ __forceinline__ static type quiet_NaN();
__device__ __forceinline__ static type signaling_NaN();
static const bool is_signed = false;
};
template<> struct numeric_limits<int>
{
typedef int type;
__device__ __forceinline__ static type min() { return INT_MIN; };
__device__ __forceinline__ static type max() { return INT_MAX; };
__device__ __forceinline__ static type epsilon();
__device__ __forceinline__ static type round_error();
__device__ __forceinline__ static type denorm_min();
__device__ __forceinline__ static type infinity();
__device__ __forceinline__ static type quiet_NaN();
__device__ __forceinline__ static type signaling_NaN();
static const bool is_signed = true;
};
template<> struct numeric_limits<unsigned int>
{
typedef unsigned int type;
__device__ __forceinline__ static type min() { return 0; };
__device__ __forceinline__ static type max() { return UINT_MAX; };
__device__ __forceinline__ static type epsilon();
__device__ __forceinline__ static type round_error();
__device__ __forceinline__ static type denorm_min();
__device__ __forceinline__ static type infinity();
__device__ __forceinline__ static type quiet_NaN();
__device__ __forceinline__ static type signaling_NaN();
static const bool is_signed = false;
};
template<> struct numeric_limits<long>
{
typedef long type;
__device__ __forceinline__ static type min() { return LONG_MIN; };
__device__ __forceinline__ static type max() { return LONG_MAX; };
__device__ __forceinline__ static type epsilon();
__device__ __forceinline__ static type round_error();
__device__ __forceinline__ static type denorm_min();
__device__ __forceinline__ static type infinity();
__device__ __forceinline__ static type quiet_NaN();
__device__ __forceinline__ static type signaling_NaN();
static const bool is_signed = true;
};
template<> struct numeric_limits<unsigned long>
{
typedef unsigned long type;
__device__ __forceinline__ static type min() { return 0; };
__device__ __forceinline__ static type max() { return ULONG_MAX; };
__device__ __forceinline__ static type epsilon();
__device__ __forceinline__ static type round_error();
__device__ __forceinline__ static type denorm_min();
__device__ __forceinline__ static type infinity();
__device__ __forceinline__ static type quiet_NaN();
__device__ __forceinline__ static type signaling_NaN();
static const bool is_signed = false;
};
template<> struct numeric_limits<float>
{
typedef float type;
__device__ __forceinline__ static type min() { return 1.175494351e-38f/*FLT_MIN*/; };
__device__ __forceinline__ static type max() { return 3.402823466e+38f/*FLT_MAX*/; };
__device__ __forceinline__ static type epsilon() { return 1.192092896e-07f/*FLT_EPSILON*/; };
__device__ __forceinline__ static type round_error();
__device__ __forceinline__ static type denorm_min();
__device__ __forceinline__ static type infinity() { return __int_as_float(0x7f800000); /*CUDART_INF_F*/ };
__device__ __forceinline__ static type quiet_NaN() { return __int_as_float(0x7fffffff); /*CUDART_NAN_F*/ };
__device__ __forceinline__ static type signaling_NaN();
static const bool is_signed = true;
};
template<> struct numeric_limits<double>
{
typedef double type;
__device__ __forceinline__ static type min() { return 2.2250738585072014e-308/*DBL_MIN*/; };
__device__ __forceinline__ static type max() { return 1.7976931348623158e+308/*DBL_MAX*/; };
__device__ __forceinline__ static type epsilon() { return 2.2204460492503131e-016 /*DBL_EPSILON*/; };
__device__ __forceinline__ static type round_error();
__device__ __forceinline__ static type denorm_min();
__device__ __forceinline__ static type infinity();
__device__ __forceinline__ static type quiet_NaN();
__device__ __forceinline__ static type signaling_NaN();
static const bool is_signed = true;
};
}
}
#endif /* PCL_DEVICE_NUMERIC_LIMITS_HPP_ */
pcl::device::numeric_limits< float >::epsilon
__device__ static __forceinline__ type epsilon()
Definition: limits.hpp:204
pcl::device::numeric_limits< unsigned short >::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:131
pcl::device::numeric_limits::round_error
__device__ static __forceinline__ type round_error()
Definition: limits.hpp:50
pcl::device::numeric_limits::is_signed
static const bool is_signed
Definition: limits.hpp:55
pcl::device::numeric_limits< signed char >::type
char type
Definition: limits.hpp:88
pcl
Definition: convolution.h:45
pcl::device::numeric_limits::type
T type
Definition: limits.hpp:46
pcl::device::numeric_limits< unsigned long >::type
unsigned long type
Definition: limits.hpp:187
pcl::device::numeric_limits< char >::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:75
pcl::device::numeric_limits< int >::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:146
pcl::device::numeric_limits< float >::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:203
pcl::device::numeric_limits< signed char >::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:90
pcl::device::numeric_limits< int >::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:145
pcl::device::numeric_limits< long >::type
long type
Definition: limits.hpp:173
pcl::device::numeric_limits< signed char >::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:89
pcl::device::numeric_limits< char >::type
char type
Definition: limits.hpp:74
pcl::device::numeric_limits< int >::type
int type
Definition: limits.hpp:144
pcl::device::numeric_limits< long >::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:175
pcl::device::numeric_limits< double >::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:217
pcl::device::numeric_limits< unsigned long >::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:188
pcl::device::numeric_limits< short >::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:118
pcl::device::numeric_limits< double >::type
double type
Definition: limits.hpp:215
pcl::device::numeric_limits< unsigned short >::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:132
pcl::device::numeric_limits< double >::epsilon
__device__ static __forceinline__ type epsilon()
Definition: limits.hpp:218
pcl::device::numeric_limits< char >::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:76
pcl::device::numeric_limits< bool >::type
bool type
Definition: limits.hpp:60
pcl::device::numeric_limits< double >::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:216
pcl::device::numeric_limits< bool >::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:61
pcl::device::numeric_limits< unsigned char >::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:104
pcl::device::numeric_limits::epsilon
__device__ static __forceinline__ type epsilon()
Definition: limits.hpp:49
pcl::device::numeric_limits::infinity
__device__ static __forceinline__ type infinity()
Definition: limits.hpp:52
pcl::device::numeric_limits::signaling_NaN
__device__ static __forceinline__ type signaling_NaN()
Definition: limits.hpp:54
pcl::device::numeric_limits< unsigned int >::type
unsigned int type
Definition: limits.hpp:159
pcl::device::numeric_limits< float >::quiet_NaN
__device__ static __forceinline__ type quiet_NaN()
Definition: limits.hpp:208
pcl::device::numeric_limits< unsigned char >::type
unsigned char type
Definition: limits.hpp:102
pcl::device::numeric_limits< unsigned long >::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:189
pcl::device::numeric_limits< float >::infinity
__device__ static __forceinline__ type infinity()
Definition: limits.hpp:207
pcl::device::numeric_limits< unsigned int >::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:160
pcl::device::numeric_limits< short >::type
short type
Definition: limits.hpp:116
pcl::device::numeric_limits
Definition: utils.hpp:53
pcl::device::numeric_limits::quiet_NaN
__device__ static __forceinline__ type quiet_NaN()
Definition: limits.hpp:53
pcl::device::numeric_limits< long >::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:174
pcl::device::numeric_limits< float >::type
float type
Definition: limits.hpp:201
pcl::device::numeric_limits::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:47
pcl::device::numeric_limits< unsigned short >::type
unsigned short type
Definition: limits.hpp:130
pcl::device::numeric_limits< unsigned char >::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:103
pcl::device::numeric_limits< float >::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:202
pcl::device::numeric_limits< bool >::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:62
pcl::device::numeric_limits< unsigned int >::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:161
pcl::device::numeric_limits< short >::min
__device__ static __forceinline__ type min()
Definition: limits.hpp:117
pcl::device::numeric_limits::denorm_min
__device__ static __forceinline__ type denorm_min()
Definition: limits.hpp:51
pcl::device::numeric_limits::max
__device__ static __forceinline__ type max()
Definition: limits.hpp:48