37 #define PRUNER_ANGLE 2 40 #define ANGLE_SHIFT (0.0) 44 #define MAX_PROTO_INDEX 24 45 #define BITS_PER_WERD static_cast<int>(8 * sizeof(uint32_t)) 47 #define MAX_NUM_CONFIGS 64 48 #define MAX_NUM_PROTOS 512 49 #define PROTOS_PER_PROTO_SET 64 50 #define MAX_NUM_PROTO_SETS (MAX_NUM_PROTOS / PROTOS_PER_PROTO_SET) 51 #define NUM_PP_PARAMS 3 52 #define NUM_PP_BUCKETS 64 53 #define NUM_CP_BUCKETS 24 54 #define CLASSES_PER_CP 32 55 #define NUM_BITS_PER_CLASS 2 56 #define CLASS_PRUNER_CLASS_MASK (~(~0u << NUM_BITS_PER_CLASS)) 57 #define CLASSES_PER_CP_WERD (CLASSES_PER_CP / NUM_BITS_PER_CLASS) 58 #define PROTOS_PER_PP_WERD BITS_PER_WERD 59 #define BITS_PER_CP_VECTOR (CLASSES_PER_CP * NUM_BITS_PER_CLASS) 60 #define MAX_NUM_CLASS_PRUNERS \ 61 ((MAX_NUM_CLASSES + CLASSES_PER_CP - 1) / CLASSES_PER_CP) 62 #define WERDS_PER_CP_VECTOR (BITS_PER_CP_VECTOR / BITS_PER_WERD) 63 #define WERDS_PER_PP_VECTOR \ 64 ((PROTOS_PER_PROTO_SET + BITS_PER_WERD - 1) / BITS_PER_WERD) 65 #define WERDS_PER_PP (NUM_PP_PARAMS * NUM_PP_BUCKETS * WERDS_PER_PP_VECTOR) 66 #define WERDS_PER_CP \ 67 (NUM_CP_BUCKETS * NUM_CP_BUCKETS * NUM_CP_BUCKETS * WERDS_PER_CP_VECTOR) 68 #define WERDS_PER_CONFIG_VEC \ 69 ((MAX_NUM_CONFIGS + BITS_PER_WERD - 1) / BITS_PER_WERD) 129 #define MAX_NUM_INT_FEATURES 512 130 #define INT_CHAR_NORM_RANGE 256 163 #define MaxNumIntProtosIn(C) (C->NumProtoSets * PROTOS_PER_PROTO_SET) 164 #define SetForProto(P) (P / PROTOS_PER_PROTO_SET) 165 #define IndexForProto(P) (P % PROTOS_PER_PROTO_SET) 166 #define ProtoForProtoId(C, P) \ 167 (&((C->ProtoSets[SetForProto(P)])->Protos[IndexForProto(P)])) 168 #define PPrunerWordIndexFor(I) \ 169 (((I) % PROTOS_PER_PROTO_SET) / PROTOS_PER_PP_WERD) 170 #define PPrunerBitIndexFor(I) ((I) % PROTOS_PER_PP_WERD) 171 #define PPrunerMaskFor(I) (1 << PPrunerBitIndexFor(I)) 173 #define MaxNumClassesIn(T) (T->NumClassPruners * CLASSES_PER_CP) 174 #define LegalClassId(c) ((c) >= 0 && (c) <= MAX_CLASS_ID) 175 #define UnusedClassIdIn(T, c) ((T)->Class[c] == nullptr) 176 #define ClassForClassId(T, c) ((T)->Class[c]) 177 #define ClassPrunersFor(T) ((T)->ClassPruner) 178 #define CPrunerIdFor(c) ((c) / CLASSES_PER_CP) 179 #define CPrunerFor(T, c) ((T)->ClassPruners[CPrunerIdFor(c)]) 180 #define CPrunerWordIndexFor(c) (((c) % CLASSES_PER_CP) / CLASSES_PER_CP_WERD) 181 #define CPrunerBitIndexFor(c) (((c) % CLASSES_PER_CP) % CLASSES_PER_CP_WERD) 182 #define CPrunerMaskFor(L, c) \ 183 (((L) + 1) << CPrunerBitIndexFor(c) * NUM_BITS_PER_CLASS) 186 #define PRINT_MATCH_SUMMARY 0x001 187 #define DISPLAY_FEATURE_MATCHES 0x002 188 #define DISPLAY_PROTO_MATCHES 0x004 189 #define PRINT_FEATURE_MATCHES 0x008 190 #define PRINT_PROTO_MATCHES 0x010 191 #define CLIP_MATCH_EVIDENCE 0x020 193 #define MatchDebuggingOn(D) (D) 194 #define PrintMatchSummaryOn(D) ((D)&PRINT_MATCH_SUMMARY) 195 #define DisplayFeatureMatchesOn(D) ((D)&DISPLAY_FEATURE_MATCHES) 196 #define DisplayProtoMatchesOn(D) ((D)&DISPLAY_PROTO_MATCHES) 197 #define PrintFeatureMatchesOn(D) ((D)&PRINT_FEATURE_MATCHES) 198 #define PrintProtoMatchesOn(D) ((D)&PRINT_PROTO_MATCHES) 199 #define ClipMatchEvidenceOn(D) ((D)&CLIP_MATCH_EVIDENCE) 216 uint8_t
Bucket8For(
float param,
float offset,
int num_buckets);
217 uint16_t
Bucket16For(
float param,
float offset,
int num_buckets);
219 uint8_t
CircBucketFor(
float param,
float offset,
int num_buckets);
246 #ifndef GRAPHICS_DISABLED 259 #endif // GRAPHICS_DISABLED void AddIntClass(INT_TEMPLATES Templates, CLASS_ID ClassId, INT_CLASS Class)
ScrollView * CreateFeatureSpaceWindow(const char *name, int xpos, int ypos)
void AddProtoToProtoPruner(PROTO Proto, int ProtoId, INT_CLASS Class, bool debug)
void ClearFeatureSpaceWindow(NORM_METHOD norm_method, ScrollView *window)
void InitIntMatchWindowIfReqd()
void RenderIntFeature(ScrollView *window, const INT_FEATURE_STRUCT *Feature, ScrollView::Color color)
struct INT_CLASS_STRUCT * INT_CLASS
INT_FEATURE_STRUCT * INT_FEATURE
void AddProtoToClassPruner(PROTO Proto, CLASS_ID ClassId, INT_TEMPLATES Templates)
#define MAX_NUM_PROTO_SETS
void DisplayIntFeature(const INT_FEATURE_STRUCT *Feature, float Evidence)
uint32_t p[NUM_CP_BUCKETS][NUM_CP_BUCKETS][NUM_CP_BUCKETS][WERDS_PER_CP_VECTOR]
void InitProtoDisplayWindowIfReqd()
void UpdateMatchDisplay()
int AddIntProto(INT_CLASS Class)
#define WERDS_PER_PP_VECTOR
void DisplayIntProto(INT_CLASS Class, PROTO_ID ProtoId, float Evidence)
struct INT_PROTO_STRUCT * INT_PROTO
uint8_t CircBucketFor(float param, float offset, int num_buckets)
INT_CLASS NewIntClass(int MaxNumProtos, int MaxNumConfigs)
#define MAX_NUM_INT_FEATURES
void free_int_templates(INT_TEMPLATES templates)
void InitFeatureDisplayWindowIfReqd()
struct PROTO_SET_STRUCT * PROTO_SET
int AddIntConfig(INT_CLASS Class)
DLLSYM void tprintf(const char *format,...)
#define PROTOS_PER_PROTO_SET
INT_FEATURE_STRUCT INT_FEATURE_ARRAY[MAX_NUM_INT_FEATURES]
INT_TEMPLATES NewIntTemplates()
uint8_t Bucket8For(float param, float offset, int num_buckets)
#define WERDS_PER_CP_VECTOR
void ConvertConfig(BIT_VECTOR Config, int ConfigId, INT_CLASS Class)
uint16_t Bucket16For(float param, float offset, int num_buckets)
#define MAX_NUM_CLASS_PRUNERS
uint32_t PROTO_PRUNER[NUM_PP_PARAMS][NUM_PP_BUCKETS][WERDS_PER_PP_VECTOR]
struct INT_TEMPLATES_STRUCT * INT_TEMPLATES
#define WERDS_PER_CONFIG_VEC
uint32_t CONFIG_PRUNER[NUM_PP_PARAMS][NUM_PP_BUCKETS][4]