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 uinT32 * | BIT_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
---------------------------------------------------------------------------- Include Files and Type Defines ----------------------------------------------------------------------------
#define copy_all_bits |
( |
source, |
|
|
dest, |
|
|
length |
|
) |
|
Value:{\
register int index; \
\
for (index=0;index<length;index++)\
dest[index]=source[index]; \
}
#define reset_bit |
( |
array, |
|
|
bit |
|
) |
(array[bit/BITSINLONG]&=~(1<<(bit&(BITSINLONG-1)))) |
#define set_all_bits |
( |
array, |
|
|
length |
|
) |
|
Value:{\
register int index; \
\
for (index=0;index<length;index++)\
array[index]= ~0; \
}
#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; \
\
for (index=0;index<length;index++)\
array[index]=0; \
}
---------------------------------------------------------------------------- Public Function Prototypes ----------------------------------------------------------------------------
Typedef Documentation
Function Documentation
---------------------------------------------------------------------------- Public Code ----------------------------------------------------------------------------
int hamming_distance |
( |
uinT32 * |
array1, |
|
|
uinT32 * |
array2, |
|
|
int |
length | |
|
) |
| | |