1 /*********************************************************************** 2 * Software License Agreement (BSD License) 3 * 4 * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 *************************************************************************/ 28 29 30 #ifndef FLANN_DEFINES_H_ 31 #define FLANN_DEFINES_H_ 32 33 #define FLANN_VERSION_ "1.7.1" 34 35 #if defined _WIN32 && defined Hugin_shared 36 /* win32 dll export/import directives */ 37 #ifdef flann_cpp_EXPORTS 38 #define FLANN_EXPORT __declspec(dllexport) 39 #elif defined(FLANN_STATIC) 40 #define FLANN_EXPORT 41 #else 42 #define FLANN_EXPORT __declspec(dllimport) 43 #endif 44 #else 45 /* unix needs nothing */ 46 #define FLANN_EXPORT 47 #endif 48 49 #ifdef FLANN_DEPRECATED 50 #undef FLANN_DEPRECATED 51 #endif 52 #ifdef __GNUC__ 53 #define FLANN_DEPRECATED __attribute__ ((deprecated)) 54 #elif defined(_MSC_VER) 55 #define FLANN_DEPRECATED __declspec(deprecated) 56 #else 57 #pragma message("WARNING: You need to implement FLANN_DEPRECATED for this compiler") 58 #define FLANN_DEPRECATED 59 #endif 60 61 #undef FLANN_PLATFORM_64_BIT 62 #undef FLANN_PLATFORM_32_BIT 63 #if __amd64__ || __x86_64__ || _WIN64 || _M_X64 64 #define FLANN_PLATFORM_64_BIT 65 #else 66 #define FLANN_PLATFORM_32_BIT 67 #endif 68 69 #undef FLANN_ARRAY_LEN 70 #define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0])) 71 72 #ifdef __cplusplus 73 namespace flann { 74 #endif 75 76 /* Nearest neighbour index algorithms */ 77 enum flann_algorithm_t 78 { 79 FLANN_INDEX_LINEAR = 0, 80 FLANN_INDEX_KDTREE = 1, 81 FLANN_INDEX_KMEANS = 2, 82 FLANN_INDEX_COMPOSITE = 3, 83 FLANN_INDEX_KDTREE_SINGLE = 4, 84 FLANN_INDEX_HIERARCHICAL = 5, 85 FLANN_INDEX_LSH = 6, 86 FLANN_INDEX_KDTREE_CUDA = 7, 87 FLANN_INDEX_SAVED = 254, 88 FLANN_INDEX_AUTOTUNED = 255, 89 90 // deprecated constants, should use the FLANN_INDEX_* ones instead 91 LINEAR = 0, 92 KDTREE = 1, 93 KMEANS = 2, 94 COMPOSITE = 3, 95 KDTREE_SINGLE = 4, 96 SAVED = 254, 97 AUTOTUNED = 255 98 }; 99 100 101 102 enum flann_centers_init_t 103 { 104 FLANN_CENTERS_RANDOM = 0, 105 FLANN_CENTERS_GONZALES = 1, 106 FLANN_CENTERS_KMEANSPP = 2, 107 108 // deprecated constants, should use the FLANN_CENTERS_* ones instead 109 CENTERS_RANDOM = 0, 110 CENTERS_GONZALES = 1, 111 CENTERS_KMEANSPP = 2 112 }; 113 114 enum flann_log_level_t 115 { 116 FLANN_LOG_NONE = 0, 117 FLANN_LOG_FATAL = 1, 118 FLANN_LOG_ERROR = 2, 119 FLANN_LOG_WARN = 3, 120 FLANN_LOG_INFO = 4 121 }; 122 123 enum flann_distance_t 124 { 125 FLANN_DIST_EUCLIDEAN = 1, 126 FLANN_DIST_L2 = 1, 127 FLANN_DIST_MANHATTAN = 2, 128 FLANN_DIST_L1 = 2, 129 FLANN_DIST_MINKOWSKI = 3, 130 FLANN_DIST_MAX = 4, 131 FLANN_DIST_HIST_INTERSECT = 5, 132 FLANN_DIST_HELLINGER = 6, 133 FLANN_DIST_CHI_SQUARE = 7, 134 FLANN_DIST_CS = 7, 135 FLANN_DIST_KULLBACK_LEIBLER = 8, 136 FLANN_DIST_KL = 8, 137 FLANN_DIST_HAMMING = 9, 138 FLANN_DIST_HAMMING_LUT = 10, 139 FLANN_DIST_HAMMING_POPCNT = 11, 140 141 // deprecated constants, should use the FLANN_DIST_* ones instead 142 EUCLIDEAN = 1, 143 MANHATTAN = 2, 144 MINKOWSKI = 3, 145 MAX_DIST = 4, 146 HIST_INTERSECT = 5, 147 HELLINGER = 6, 148 CS = 7, 149 KL = 8, 150 KULLBACK_LEIBLER = 8 151 }; 152 153 enum flann_datatype_t 154 { 155 FLANN_NONE = -1, 156 FLANN_INT8 = 0, 157 FLANN_INT16 = 1, 158 FLANN_INT32 = 2, 159 FLANN_INT64 = 3, 160 FLANN_UINT8 = 4, 161 FLANN_UINT16 = 5, 162 FLANN_UINT32 = 6, 163 FLANN_UINT64 = 7, 164 FLANN_FLOAT32 = 8, 165 FLANN_FLOAT64 = 9 166 }; 167 168 enum flann_checks_t { 169 FLANN_CHECKS_UNLIMITED = -1, 170 FLANN_CHECKS_AUTOTUNED = -2 171 }; 172 173 #ifdef __cplusplus 174 } 175 #endif 176 177 178 #endif /* FLANN_DEFINES_H_ */ 179