Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
intmatcher.cpp File Reference
#include "intmatcher.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
 

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[])
 

Function Documentation

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

Definition at line 1305 of file intmatcher.cpp.

1305  {
1306 /*
1307  ** Parameters:
1308  ** n Number of elements to sort
1309  ** ra Key array [1..n]
1310  ** rb Index array [1..n]
1311  ** Globals:
1312  ** Operation:
1313  ** Sort Key array in ascending order using heap sort
1314  ** algorithm. Also sort Index array that is tied to
1315  ** the key array.
1316  ** Return:
1317  ** Exceptions: none
1318  ** History: Tue Feb 19 10:24:24 MST 1991, RWM, Created.
1319  */
1320  register int i, rra, rrb;
1321  int l, j, ir;
1322 
1323  l = (n >> 1) + 1;
1324  ir = n;
1325  for (;;) {
1326  if (l > 1) {
1327  rra = ra[--l];
1328  rrb = rb[l];
1329  }
1330  else {
1331  rra = ra[ir];
1332  rrb = rb[ir];
1333  ra[ir] = ra[1];
1334  rb[ir] = rb[1];
1335  if (--ir == 1) {
1336  ra[1] = rra;
1337  rb[1] = rrb;
1338  return;
1339  }
1340  }
1341  i = l;
1342  j = l << 1;
1343  while (j <= ir) {
1344  if (j < ir && ra[j] < ra[j + 1])
1345  ++j;
1346  if (rra < ra[j]) {
1347  ra[i] = ra[j];
1348  rb[i] = rb[j];
1349  j += (i = j);
1350  }
1351  else
1352  j = ir + 1;
1353  }
1354  ra[i] = rra;
1355  rb[i] = rrb;
1356  }
1357 }
void IMDebugConfiguration ( int  FeatureNum,
uinT16  ActualProtoNum,
uinT8  Evidence,
BIT_VECTOR  ConfigMask,
uinT32  ConfigWord 
)

Definition at line 757 of file intmatcher.cpp.

761  {
762 /*
763  ** Parameters:
764  ** Globals:
765  ** Operation:
766  ** Print debugging information for Configuations
767  ** Return:
768  ** Exceptions: none
769  ** History: Wed Feb 27 14:12:28 MST 1991, RWM, Created.
770  */
771  cprintf ("F = %3d, P = %3d, E = %3d, Configs = ",
772  FeatureNum, (int) ActualProtoNum, (int) Evidence);
773  while (ConfigWord) {
774  if (ConfigWord & 1)
775  cprintf ("1");
776  else
777  cprintf ("0");
778  ConfigWord >>= 1;
779  }
780  cprintf ("\n");
781 }
void cprintf(const char *format,...)
Definition: callcpp.cpp:41
void IMDebugConfigurationSum ( int  FeatureNum,
uinT8 FeatureEvidence,
inT32  ConfigCount 
)

Definition at line 785 of file intmatcher.cpp.

787  {
788 /*
789  ** Parameters:
790  ** Globals:
791  ** Operation:
792  ** Print debugging information for Configuations
793  ** Return:
794  ** Exceptions: none
795  ** History: Wed Feb 27 14:12:28 MST 1991, RWM, Created.
796  */
797  cprintf("F=%3d, C=", FeatureNum);
798  for (int ConfigNum = 0; ConfigNum < ConfigCount; ConfigNum++) {
799  cprintf("%4d", FeatureEvidence[ConfigNum]);
800  }
801  cprintf("\n");
802 }
void cprintf(const char *format,...)
Definition: callcpp.cpp:41