/home/rays/src/opensrc/tesseract-ocr/cutil/bitvec.cpp File Reference

#include "bitvec.h"
#include "host.h"
#include <stdio.h>
#include <assert.h>
#include "params.h"
#include "unichar.h"
#include "tprintf.h"

Functions

BIT_VECTOR ExpandBitVector (BIT_VECTOR Vector, int NewNumBits)
void FreeBitVector (BIT_VECTOR BitVector)
int hamming_distance (uinT32 *array1, uinT32 *array2, int length)
BIT_VECTOR NewBitVector (int NumBits)

Function Documentation

BIT_VECTOR ExpandBitVector ( BIT_VECTOR  Vector,
int  NewNumBits 
)

This routine uses realloc to increase the size of the specified bit vector.

Globals:

  • none
Parameters:
Vector bit vector to be expanded
NewNumBits new size of bit vector
Returns:
New expanded bit vector.
Note:
Exceptions: none
History: Fri Nov 16 10:11:16 1990, DSJ, Created.
void FreeBitVector ( BIT_VECTOR  BitVector  ) 

This routine frees a bit vector. It also decrements the global counter that keeps track of the number of bit vectors allocated. If BitVector is NULL, then the count is printed to stderr.

Globals:

  • BitVectorCount count of number of bit vectors allocated
Parameters:
BitVector bit vector to be freed
Note:
Exceptions: none
History: Tue Oct 23 16:46:09 1990, DSJ, Created.

int hamming_distance ( uinT32 array1,
uinT32 array2,
int  length 
)

hamming_distance(array1,array2,length) computes the hamming distance between two bit strings.

BIT_VECTOR NewBitVector ( int  NumBits  ) 

Allocate and return a new bit vector large enough to hold the specified number of bits.

Globals:

  • BitVectorCount number of bit vectors allocated
Parameters:
NumBits number of bits in new bit vector
Returns:
New bit vector.
Note:
Exceptions: none
History: Tue Oct 23 16:51:27 1990, DSJ, Created.
Generated on Thu Feb 2 08:19:22 2012 for Tesseract by  doxygen 1.6.3