tesseract  4.00.00dev
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

◆ INTMATCHER_OFFSET_TABLE_SIZE

#define INTMATCHER_OFFSET_TABLE_SIZE   256

Definition at line 66 of file intmatcher.cpp.

◆ next_table_entries

#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.

◆ offset_table_entries

#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

◆ HeapSort()

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 1236 of file intmatcher.cpp.

1236  {
1237  int i, rra, rrb;
1238  int l, j, ir;
1239 
1240  l = (n >> 1) + 1;
1241  ir = n;
1242  for (;;) {
1243  if (l > 1) {
1244  rra = ra[--l];
1245  rrb = rb[l];
1246  }
1247  else {
1248  rra = ra[ir];
1249  rrb = rb[ir];
1250  ra[ir] = ra[1];
1251  rb[ir] = rb[1];
1252  if (--ir == 1) {
1253  ra[1] = rra;
1254  rb[1] = rrb;
1255  return;
1256  }
1257  }
1258  i = l;
1259  j = l << 1;
1260  while (j <= ir) {
1261  if (j < ir && ra[j] < ra[j + 1])
1262  ++j;
1263  if (rra < ra[j]) {
1264  ra[i] = ra[j];
1265  rb[i] = rb[j];
1266  j += (i = j);
1267  }
1268  else
1269  j = ir + 1;
1270  }
1271  ra[i] = rra;
1272  rb[i] = rrb;
1273  }
1274 }

◆ IMDebugConfiguration()

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 727 of file intmatcher.cpp.

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

◆ IMDebugConfigurationSum()

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 750 of file intmatcher.cpp.

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