All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
intmatcher.cpp File Reference
#include "intmatcher.h"
#include "fontinfo.h"
#include "intproto.h"
#include "callcpp.h"
#include "scrollview.h"
#include "float2int.h"
#include "globals.h"
#include "helpers.h"
#include "classify.h"
#include "shapetable.h"
#include <math.h>

Go to the source code of this file.

Classes

class  tesseract::ClassPruner
 

Namespaces

 tesseract
 

Macros

#define offset_table_entries
 
#define INTMATCHER_OFFSET_TABLE_SIZE   256
 
#define next_table_entries
 

Functions

void IMDebugConfiguration (int FeatureNum, uinT16 ActualProtoNum, uinT8 Evidence, BIT_VECTOR ConfigMask, uinT32 ConfigWord)
 
void IMDebugConfigurationSum (int FeatureNum, uinT8 *FeatureEvidence, inT32 ConfigCount)
 
void HeapSort (int n, register int ra[], register int rb[])
 

Macro Definition Documentation

#define INTMATCHER_OFFSET_TABLE_SIZE   256

Definition at line 66 of file intmatcher.cpp.

#define next_table_entries
Value:
0, 0, 0, 0x2, 0, 0x4, 0x4, 0x6, 0, 0x8, 0x8, 0x0a, 0x08, 0x0c, 0x0c, 0x0e, \
0, 0x10, 0x10, 0x12, 0x10, 0x14, 0x14, 0x16, 0x10, 0x18, 0x18, 0x1a, \
0x18, 0x1c, 0x1c, 0x1e, 0, 0x20, 0x20, 0x22, 0x20, 0x24, 0x24, 0x26, \
0x20, 0x28, 0x28, 0x2a, 0x28, 0x2c, 0x2c, 0x2e, 0x20, 0x30, 0x30, 0x32, \
0x30, 0x34, 0x34, 0x36, 0x30, 0x38, 0x38, 0x3a, 0x38, 0x3c, 0x3c, 0x3e, \
0, 0x40, 0x40, 0x42, 0x40, 0x44, 0x44, 0x46, 0x40, 0x48, 0x48, 0x4a, \
0x48, 0x4c, 0x4c, 0x4e, 0x40, 0x50, 0x50, 0x52, 0x50, 0x54, 0x54, 0x56, \
0x50, 0x58, 0x58, 0x5a, 0x58, 0x5c, 0x5c, 0x5e, 0x40, 0x60, 0x60, 0x62, \
0x60, 0x64, 0x64, 0x66, 0x60, 0x68, 0x68, 0x6a, 0x68, 0x6c, 0x6c, 0x6e, \
0x60, 0x70, 0x70, 0x72, 0x70, 0x74, 0x74, 0x76, 0x70, 0x78, 0x78, 0x7a, \
0x78, 0x7c, 0x7c, 0x7e, 0, 0x80, 0x80, 0x82, 0x80, 0x84, 0x84, 0x86, \
0x80, 0x88, 0x88, 0x8a, 0x88, 0x8c, 0x8c, 0x8e, 0x80, 0x90, 0x90, 0x92, \
0x90, 0x94, 0x94, 0x96, 0x90, 0x98, 0x98, 0x9a, 0x98, 0x9c, 0x9c, 0x9e, \
0x80, 0xa0, 0xa0, 0xa2, 0xa0, 0xa4, 0xa4, 0xa6, 0xa0, 0xa8, 0xa8, 0xaa, \
0xa8, 0xac, 0xac, 0xae, 0xa0, 0xb0, 0xb0, 0xb2, 0xb0, 0xb4, 0xb4, 0xb6, \
0xb0, 0xb8, 0xb8, 0xba, 0xb8, 0xbc, 0xbc, 0xbe, 0x80, 0xc0, 0xc0, 0xc2, \
0xc0, 0xc4, 0xc4, 0xc6, 0xc0, 0xc8, 0xc8, 0xca, 0xc8, 0xcc, 0xcc, 0xce, \
0xc0, 0xd0, 0xd0, 0xd2, 0xd0, 0xd4, 0xd4, 0xd6, 0xd0, 0xd8, 0xd8, 0xda, \
0xd8, 0xdc, 0xdc, 0xde, 0xc0, 0xe0, 0xe0, 0xe2, 0xe0, 0xe4, 0xe4, 0xe6, \
0xe0, 0xe8, 0xe8, 0xea, 0xe8, 0xec, 0xec, 0xee, 0xe0, 0xf0, 0xf0, 0xf2, \
0xf0, 0xf4, 0xf4, 0xf6, 0xf0, 0xf8, 0xf8, 0xfa, 0xf8, 0xfc, 0xfc, 0xfe

Definition at line 68 of file intmatcher.cpp.

#define offset_table_entries
Value:
255, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, \
0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, \
0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 6, 0, 1, 0, 2, 0, 1, 0, 3, \
0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, \
0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, \
0, 1, 0, 2, 0, 1, 0, 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, \
0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, \
0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 6, \
0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, \
0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, \
0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0

Definition at line 53 of file intmatcher.cpp.

Function Documentation

void HeapSort ( int  n,
register int  ra[],
register int  rb[] 
)

Sort Key array in ascending order using heap sort algorithm. Also sort Index array that is tied to the key array.

Parameters
nNumber of elements to sort
raKey array [1..n]
rbIndex array [1..n]
Returns
none
Note
Exceptions: none
History: Tue Feb 19 10:24:24 MST 1991, RWM, Created.

Definition at line 1242 of file intmatcher.cpp.

1242  {
1243  register int i, rra, rrb;
1244  int l, j, ir;
1245 
1246  l = (n >> 1) + 1;
1247  ir = n;
1248  for (;;) {
1249  if (l > 1) {
1250  rra = ra[--l];
1251  rrb = rb[l];
1252  }
1253  else {
1254  rra = ra[ir];
1255  rrb = rb[ir];
1256  ra[ir] = ra[1];
1257  rb[ir] = rb[1];
1258  if (--ir == 1) {
1259  ra[1] = rra;
1260  rb[1] = rrb;
1261  return;
1262  }
1263  }
1264  i = l;
1265  j = l << 1;
1266  while (j <= ir) {
1267  if (j < ir && ra[j] < ra[j + 1])
1268  ++j;
1269  if (rra < ra[j]) {
1270  ra[i] = ra[j];
1271  rb[i] = rb[j];
1272  j += (i = j);
1273  }
1274  else
1275  j = ir + 1;
1276  }
1277  ra[i] = rra;
1278  rb[i] = rrb;
1279  }
1280 }
void IMDebugConfiguration ( int  FeatureNum,
uinT16  ActualProtoNum,
uinT8  Evidence,
BIT_VECTOR  ConfigMask,
uinT32  ConfigWord 
)

Print debugging information for Configuations

Returns
none
Note
Exceptions: none
History: Wed Feb 27 14:12:28 MST 1991, RWM, Created.

Definition at line 728 of file intmatcher.cpp.

732  {
733  cprintf ("F = %3d, P = %3d, E = %3d, Configs = ",
734  FeatureNum, (int) ActualProtoNum, (int) Evidence);
735  while (ConfigWord) {
736  if (ConfigWord & 1)
737  cprintf ("1");
738  else
739  cprintf ("0");
740  ConfigWord >>= 1;
741  }
742  cprintf ("\n");
743 }
void cprintf(const char *format,...)
Definition: callcpp.cpp:40
void IMDebugConfigurationSum ( int  FeatureNum,
uinT8 FeatureEvidence,
inT32  ConfigCount 
)

Print debugging information for Configuations

Returns
none
Note
Exceptions: none
History: Wed Feb 27 14:12:28 MST 1991, RWM, Created.

Definition at line 752 of file intmatcher.cpp.

754  {
755  cprintf("F=%3d, C=", FeatureNum);
756  for (int ConfigNum = 0; ConfigNum < ConfigCount; ConfigNum++) {
757  cprintf("%4d", FeatureEvidence[ConfigNum]);
758  }
759  cprintf("\n");
760 }
void cprintf(const char *format,...)
Definition: callcpp.cpp:40