149 #ifndef __PCL_FREEBSD
152 # ifndef __PCL_MACOSX
153 # ifndef __PCL_WINDOWS
154 # error No platform selection macro has been defined.
165 # ifndef __PCL_MACOSX
166 # define __PCL_MACOSX
179 # if defined( __PCL_LINUX ) || defined( __PCL_MACOSX ) || defined( __PCL_WINDOWS )
180 # error Multiple platform selection macros have been defined.
184 # if defined( __PCL_FREEBSD ) || defined( __PCL_MACOSX ) || defined( __PCL_WINDOWS )
185 # error Multiple platform selection macros have been defined.
189 # if defined( __PCL_FREEBSD ) || defined( __PCL_LINUX ) || defined( __PCL_WINDOWS )
190 # error Multiple platform selection macros have been defined.
194 # if defined( __PCL_FREEBSD ) || defined( __PCL_LINUX ) || defined( __PCL_MACOSX )
195 # error Multiple platform selection macros have been defined.
202 #if defined( __PCL_LINUX ) || defined( __PCL_FREEBSD ) || defined( __PCL_MACOSX )
211 #if defined( __PCL_LINUX ) || defined( __PCL_FREEBSD )
228 # error This version of PCL requires an x86_64 / EM64T / AMD64 architecture.
249 # error This version of PCL requires MSVC++ 15.0 / Visual Studio 2017 or higher on MS Windows platforms.
252 # error Unsupported C++ compiler on MS Windows platform.
256 # error _MSC_VER should not be #defined on UNIX/Linux platforms.
259 # if ( __clang_major__ < 5 )
260 # error This version of PCL requires Clang 5 or higher on UNIX/Linux platforms.
264 # if ( __GNUC__ < 7 )
265 # error This version of PCL requires GCC 7 or higher on UNIX/Linux platforms.
268 # error Unsupported C++ compiler on UNIX/Linux platform.
278 #ifndef __PCL_NO_WARNING_MUTE_PRAGMAS
280 # define _CRT_SECURE_NO_DEPRECATE 1
281 # pragma warning( disable: 4996 )
282 # pragma warning( disable: 4018 )
283 # pragma warning( disable: 4049 )
284 # pragma warning( disable: 4150 )
285 # pragma warning( disable: 4244 )
286 # pragma warning( disable: 4345 )
287 # pragma warning( disable: 4355 )
288 # pragma warning( disable: 4521 )
289 # pragma warning( disable: 4522 )
290 # pragma warning( disable: 4710 )
291 # pragma warning( disable: 4723 )
292 # pragma warning( disable: 4800 )
300 # define PCL_WARNINGS_PUSH \
301 __pragma(warning(push))
303 # define PCL_WARNINGS_PUSH \
304 _Pragma("GCC diagnostic push")
308 # define PCL_WARNINGS_POP \
309 __pragma(warning(pop))
311 # define PCL_WARNINGS_POP \
312 _Pragma("GCC diagnostic pop")
316 # define PCL_WARNINGS_DISABLE_UNINITIALIZED_VARIABLE \
317 __pragma(warning( disable: 6001 )) \
318 __pragma(warning( disable: 4700 ))
320 # define PCL_WARNINGS_DISABLE_UNINITIALIZED_VARIABLE \
321 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
326 # define PCL_WARNINGS_DISABLE_SIZE_T_TO_INT_LOSS \
327 __pragma(warning( disable: 4267 ))
335 template <
typename... Args>
inline void __pcl_unused__( Args&&... ) {}
336 #define PCL_UNUSED( x ) __pcl_unused__( x );
342 #ifndef __PCL_NO_BRANCH_OPTIMIZATION_MACROS
343 # if defined( __GNUC__ ) || defined( __clang__ )
344 # define unlikely( expr ) __builtin_expect( !!(expr), 0 )
345 # define likely( expr ) __builtin_expect( !!(expr), 1 )
347 # define unlikely( expr ) (expr)
348 # define likely( expr ) (expr)
383 #ifndef __type_traits_h
384 # include <type_traits>
385 # ifndef __type_traits_h
386 # define __type_traits_h
393 #ifndef __initializer_list_h
394 # include <initializer_list>
395 # ifndef __initializer_list_h
396 # define __initializer_list_h
407 # define PCL_EXPORT __declspec(dllexport)
408 # define PCL_MODULE_EXPORT extern "C" PCL_EXPORT
409 # define PCL_IMPORT __declspec(dllimport)
411 # define PCL_BEGIN_LOCAL
412 # define PCL_END_LOCAL
413 # define PCL_INTERNAL
414 # define PCL_BEGIN_INTERNAL
415 # define PCL_END_INTERNAL
417 # define PCL_EXPORT __attribute__((visibility ("default")))
418 # if defined( __clang__ )
419 # define PCL_MODULE_EXPORT extern "C" __attribute__((visibility ("default")))
421 # define PCL_MODULE_EXPORT extern "C" __attribute__((visibility ("default"), externally_visible))
423 # define PCL_IMPORT __attribute__((visibility ("default")))
424 # define PCL_LOCAL __attribute__((visibility ("hidden")))
425 # define PCL_BEGIN_LOCAL _Pragma ( "GCC visibility push( hidden )" )
426 # define PCL_END_LOCAL _Pragma ( "GCC visibility pop" )
427 # define PCL_INTERNAL __attribute__((visibility ("internal")))
428 # define PCL_BEGIN_INTERNAL _Pragma ( "GCC visibility push( internal )" )
429 # define PCL_END_INTERNAL _Pragma ( "GCC visibility pop" )
432 # ifdef __PCL_BUILDING_PCL_DSO
433 # define PCL_PUBLIC PCL_EXPORT
435 # define PCL_PUBLIC PCL_IMPORT
445 #define PCL_CLASS PCL_PUBLIC
446 #define PCL_FUNC PCL_PUBLIC
447 #define PCL_DATA PCL_PUBLIC
452 #define PCL_STRINGIFY( x ) #x
457 #ifndef __PCL_NO_FASTCALL
459 # define PCL_FASTCALL __fastcall
461 # define PCL_FASTCALL __attribute__((fastcall))
464 # define PCL_FASTCALL
470 #ifndef __PCL_NO_FORCE_INLINE
472 # define PCL_FORCE_INLINE __forceinline
474 # define PCL_FORCE_INLINE inline __attribute__((always_inline))
477 # define PCL_FORCE_INLINE
483 #ifndef __PCL_NO_HOT_FUNCTIONS
485 # define PCL_HOT_FUNCTION
487 # define PCL_HOT_FUNCTION __attribute__((hot))
490 # define PCL_HOT_FUNCTION
497 # define PCL_ALIGNED_MALLOC _aligned_malloc
498 # define PCL_ALIGNED_FREE _aligned_free
500 # define PCL_ALIGNED_MALLOC _mm_malloc
501 # define PCL_ALIGNED_FREE _mm_free
508 # define PCL_ALIGNED_16 __declspec(align(16))
509 # define PCL_ASSUME_ALIGNED_16( x ) x
510 # define PCL_ALIGNED_32 __declspec(align(32))
511 # define PCL_ASSUME_ALIGNED_32( x ) x
513 # define PCL_ALIGNED_16 __attribute__((aligned(16)))
514 # define PCL_ASSUME_ALIGNED_16( x ) __builtin_assume_aligned( x, 16 )
515 # define PCL_ALIGNED_32 __attribute__((aligned(32)))
516 # define PCL_ASSUME_ALIGNED_32( x ) __builtin_assume_aligned( x, 32 )
525 # define __restrict__
532 # define PCL_IVDEP __pragma(loop( ivdep ))
538 # define PCL_IVDEP _Pragma("GCC ivdep")
546 #define PCL_PRAGMA( x ) _Pragma( #x )
548 # define PCL_UNROLL( n )
551 # define PCL_UNROLL( n ) PCL_PRAGMA( clang loop unroll_count( n ) )
554 # define PCL_UNROLL( n ) PCL_PRAGMA( GCC unroll n )
563 # define PCL_FUNCTION_NAME __FUNCTION__
565 # define PCL_FUNCTION_NAME __func__
588 # ifndef __PCL_NO_WIN32_MINIMUM_VERSIONS
589 # define WINVER 0x0601
590 # define _WIN32_WINNT 0x0601
597 #ifndef __PCL_NO_SIZE_AND_DISTANCE_TYPES
624 #ifndef __PCL_NO_PORTABLE_INTEGER_TYPES
669 using int64 =
signed __int64;
670 using uint64 =
unsigned __int64;
676 using int64 = signed long long;
685 struct PCL_AssertScalarSizes
687 static_assert(
sizeof(
int8 ) == 1,
"Invalid sizeof( int8 )" );
688 static_assert(
sizeof(
uint8 ) == 1,
"Invalid sizeof( uint8 )" );
689 static_assert(
sizeof(
int16 ) == 2,
"Invalid sizeof( int16 )" );
690 static_assert(
sizeof(
uint16 ) == 2,
"Invalid sizeof( uint16 )" );
691 static_assert(
sizeof(
int32 ) == 4,
"Invalid sizeof( int32 )" );
692 static_assert(
sizeof(
uint32 ) == 4,
"Invalid sizeof( uint32 )" );
693 static_assert(
sizeof(
int64 ) == 8,
"Invalid sizeof( int64 )" );
694 static_assert(
sizeof(
uint64 ) == 8,
"Invalid sizeof( uint64 )" );
695 static_assert(
sizeof(
float ) ==
sizeof(
uint32 ),
"Invalid sizeof( float )" );
696 static_assert(
sizeof(
double ) ==
sizeof(
uint64 ),
"Invalid sizeof( double )" );
704 #ifndef __PCL_NO_INTEGER_LIMITS
716 #define int8_min (-127i8-1)
717 #define int8_max 127i8
718 #define int8_ofs 128ui8
719 #define char_min int8_min
720 #define char_max int8_max
722 #define uint8_max 0xffui8
724 #define int16_min (-32767i16-1)
725 #define int16_max 32767i16
726 #define int16_ofs 32768ui16
727 #define short_min int16_min
728 #define short_max int16_max
730 #define uint16_max 0xffffui16
731 #define ushort_max uint16_max
733 #define uint20_max 0xfffffui32
735 #define uint22_max 0x3fffffui32
737 #define uint24_max 0xffffffui32
739 #define int32_min (-2147483647i32-1)
740 #define int32_max 2147483647i32
741 #define int32_ofs 2147483648ui32
742 #define int_min int32_min
743 #define int_max int32_max
745 #define uint32_max 0xffffffffui32
746 #define uint_max uint32_max
748 #define int64_min (-9223372036854775807i64-1)
749 #define int64_max 9223372036854775807i64
750 #define int64_ofs 9223372036854775808ui64
751 #define longlong_min int64_min
752 #define longlong_max int64_max
754 #define uint64_max 0xffffffffffffffffui64
755 #define ulonglong_max uint64_max
757 #define uint8_to_uint16 257ui16
758 #define uint8_to_uint20 4.1120588235294117647058823529412e+03
759 #define uint8_to_uint24 65793ui32
760 #define uint8_to_uint32 16843009ui32
761 #define uint8_to_uint64 72340172838076673ui64
763 #define uint16_to_uint8 3.8910505836575875486381322957198e-03
764 #define uint16_to_uint20 1.6000228885328450446326390478370e+01
765 #define uint16_to_uint24 2.5600389105058365758754863813230e+02
766 #define uint16_to_uint32 65537ui32
767 #define uint16_to_uint64 281479271743489ui64
769 #define uint20_to_uint8 2.4318718260496387955081896860024e-04
770 #define uint20_to_uint16 6.2499105929475717044560474930262e-02
771 #define uint20_to_uint24 1.6000014305128388527287032401116e+01
772 #define uint20_to_uint32 4.0960039053000500679493598455046e+03
773 #define uint20_to_uint64 1.7592202821648000014305128388527e+13
775 #define uint24_to_uint8 1.5199185323666651467481343000015e-05
776 #define uint24_to_uint16 3.9061906281823294271427051510039e-03
777 #define uint24_to_uint20 6.2499944120642192402016663671533e-02
778 #define uint24_to_uint32 2.5600001519918532366665146748134e+02
779 #define uint24_to_uint64 1.0995116933120039061906281823294e+12
781 #define uint32_to_uint8 5.9371814145560333073502484027646e-08
782 #define uint32_to_uint16 1.5258556235409005599890138395105e-05
783 #define uint32_to_uint20 2.4414039222619971079430536152662e-04
784 #define uint32_to_uint24 3.9062497680788509939049489316309e-03
785 #define uint32_to_uint64 4294967297ui64
787 #define uint64_to_uint8 1.3823577699190181534344400859741e-17
788 #define uint64_to_uint16 3.5526594686918766543265110209534e-15
789 #define uint64_to_uint20 5.6843364650699390597549726005894e-14
790 #define uint64_to_uint24 9.0949464756281961368912116576494e-13
791 #define uint64_to_uint32 2.3283064359965952029459655278022e-10
799 #define int8_min (-int8( 127 )-1)
805 #define int8_max int8( 127 )
806 #define int8_ofs uint8( 128u )
807 #define char_min int8_min
808 #define char_max int8_max
814 #define uint8_max uint8( 0xffu )
820 #define int16_min (-int16( 32767 )-1)
826 #define int16_max int16( 32767 )
827 #define int16_ofs uint16( 32768u )
828 #define short_min int16_min
829 #define short_max int16_max
835 #define uint16_max uint16( 0xffffu )
836 #define ushort_max uint16_max
842 #define uint20_max uint32( 0xfffffu )
848 #define uint22_max uint32( 0x3fffffu )
854 #define uint24_max uint32( 0xffffffu )
860 #define int32_min (-int32( 2147483647 )-1)
866 #define int32_max int32( 2147483647 )
867 #define int32_ofs uint32( 2147483648u )
868 #define int_min int32_min
869 #define int_max int32_max
875 #define uint32_max uint32( 0xffffffffu )
876 #define uint_max uint32_max
882 #define int64_min (-int64( 9223372036854775807ll )-1)
888 #define int64_max int64( 9223372036854775807ll )
889 #define int64_ofs uint64( 9223372036854775808ull )
890 #define longlong_min int64_min
891 #define longlong_max int64_max
897 #define uint64_max uint64( 0xffffffffffffffffull )
898 #define ulonglong_max uint64_max
904 #define uint8_to_uint16 uint16( 257u )
910 #define uint8_to_uint20 4.1120588235294117647058823529412e+03
916 #define uint8_to_uint24 uint32( 65793u )
922 #define uint8_to_uint32 uint32( 16843009u )
928 #define uint8_to_uint64 uint64( 72340172838076673ull )
934 #define uint16_to_uint8 3.8910505836575875486381322957198e-03
940 #define uint16_to_uint20 1.6000228885328450446326390478370e+01
946 #define uint16_to_uint24 2.5600389105058365758754863813230e+02
952 #define uint16_to_uint32 uint32( 65537u )
958 #define uint16_to_uint64 uint64( 281479271743489ull )
964 #define uint20_to_uint8 2.4318718260496387955081896860024e-04
970 #define uint20_to_uint16 6.2499105929475717044560474930262e-02
976 #define uint20_to_uint24 1.6000014305128388527287032401116e+01
982 #define uint20_to_uint32 4.0960039053000500679493598455046e+03
988 #define uint20_to_uint64 1.7592202821648000014305128388527e+13
994 #define uint24_to_uint8 1.5199185323666651467481343000015e-05
1000 #define uint24_to_uint16 3.9061906281823294271427051510039e-03
1006 #define uint24_to_uint20 6.2499944120642192402016663671533e-02
1012 #define uint24_to_uint32 2.5600001519918532366665146748134e+02
1018 #define uint24_to_uint64 1.0995116933120039061906281823294e+12
1024 #define uint32_to_uint8 5.9371814145560333073502484027646e-08
1030 #define uint32_to_uint16 1.5258556235409005599890138395105e-05
1036 #define uint32_to_uint20 2.4414039222619971079430536152662e-04
1042 #define uint32_to_uint24 3.9062497680788509939049489316309e-03
1048 #define uint32_to_uint64 uint64( 4294967297ull )
1054 #define uint64_to_uint8 1.3823577699190181534344400859741e-17
1060 #define uint64_to_uint16 3.5526594686918766543265110209534e-15
1066 #define uint64_to_uint20 5.6843364650699390597549726005894e-14
1072 #define uint64_to_uint24 9.0949464756281961368912116576494e-13
1078 #define uint64_to_uint32 2.3283064359965952029459655278022e-10
1085 inline double BitMin(
int n )
1093 default:
return -double( (
uint64( 1 ) << n) >> 1 );
1097 inline double BitMax(
int n )
1105 default:
return double( ((
uint64( 1 ) << n) >> 1) - 1 );
1109 inline double UBitMax(
int n )
1117 default:
return double( (
uint64( 1 ) << n) - 1 );
1128 #ifndef __PCL_NO_UNICODE_CHARACTER_TYPES
1156 #ifndef __PCL_NO_FILE_SIZE_AND_POSITION_TYPES
1158 #ifndef __PCL_WINDOWS
1159 # ifndef _FILE_OFFSET_BITS
1160 # define _FILE_OFFSET_BITS 64
1162 # define _LARGEFILE_SOURCE 1
1163 # define _LARGEFILE64_SOURCE 1
1196 #define PCL_MAX_PROCESSORS 1023
1197 #define PCL_MAX_PROCESSORS_BITCOUNT 10
unsigned long long uint64