tesseract-doxygen/cutil/bitvec.h File Reference

#include "host.h"

Go to the source code of this file.

Defines

#define BITSINLONG   32
#define zero_all_bits(array, length)
#define set_all_bits(array, length)
#define copy_all_bits(source, dest, length)
#define SET_BIT(array, bit)   (array[bit/BITSINLONG]|=1<<(bit&(BITSINLONG-1)))
#define reset_bit(array, bit)   (array[bit/BITSINLONG]&=~(1<<(bit&(BITSINLONG-1))))
#define test_bit(array, bit)   (array[bit/BITSINLONG] & (1<<(bit&(BITSINLONG-1))))
#define WordsInVectorOfSize(NumBits)   (((NumBits) + BITSINLONG - 1) / BITSINLONG)

Typedefs

typedef uinT32BIT_VECTOR

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)

Define Documentation

#define BITSINLONG   32

---------------------------------------------------------------------------- Include Files and Type Defines ----------------------------------------------------------------------------

#define copy_all_bits ( source,
dest,
length   ) 
Value:
{\
        register int                    index;                                          /*temporary index*/\
\
for (index=0;index<length;index++)\
        dest[index]=source[index];                                                      /*copy all bits*/\
}
#define reset_bit ( array,
bit   )     (array[bit/BITSINLONG]&=~(1<<(bit&(BITSINLONG-1))))
#define set_all_bits ( array,
length   ) 
Value:
{\
        register int                    index;                                          /*temporary index*/\
\
for (index=0;index<length;index++)\
        array[index]= ~0;                                                                       /*set all bits*/\
}
#define SET_BIT ( array,
bit   )     (array[bit/BITSINLONG]|=1<<(bit&(BITSINLONG-1)))
#define test_bit ( array,
bit   )     (array[bit/BITSINLONG] & (1<<(bit&(BITSINLONG-1))))
#define WordsInVectorOfSize ( NumBits   )     (((NumBits) + BITSINLONG - 1) / BITSINLONG)
#define zero_all_bits ( array,
length   ) 
Value:
{\
        register int                    index;                                          /*temporary index*/\
\
for (index=0;index<length;index++)\
        array[index]=0;                                                                         /*zero all bits*/\
}

---------------------------------------------------------------------------- Public Function Prototypes ----------------------------------------------------------------------------


Typedef Documentation

typedef uinT32* BIT_VECTOR

Function Documentation

BIT_VECTOR ExpandBitVector ( BIT_VECTOR  Vector,
int  NewNumBits 
)

---------------------------------------------------------------------------- Public Code ----------------------------------------------------------------------------

void FreeBitVector ( BIT_VECTOR  BitVector  ) 
int hamming_distance ( uinT32 array1,
uinT32 array2,
int  length 
)
BIT_VECTOR NewBitVector ( int  NumBits  ) 
Generated on Sun Jul 18 17:10:50 2010 for Tesseract by  doxygen 1.6.3