mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 20:59:36 +08:00
Fixed type of bit vector
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@234 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
parent
636765e622
commit
74c3f2d4af
@ -18,11 +18,13 @@
|
||||
#ifndef BITVEC_H
|
||||
#define BITVEC_H
|
||||
|
||||
#include "host.h"
|
||||
|
||||
/**----------------------------------------------------------------------------
|
||||
Include Files and Type Defines
|
||||
----------------------------------------------------------------------------**/
|
||||
#define BITSINLONG 32 /*no of bits in a long */
|
||||
typedef unsigned int *BIT_VECTOR;
|
||||
typedef uinT32 *BIT_VECTOR;
|
||||
|
||||
/**----------------------------------------------------------------------------
|
||||
Public Function Prototypes
|
||||
@ -67,9 +69,7 @@ BIT_VECTOR ExpandBitVector(BIT_VECTOR Vector, int NewNumBits);
|
||||
|
||||
void FreeBitVector(BIT_VECTOR BitVector);
|
||||
|
||||
int hamming_distance(register unsigned long *array1,
|
||||
register unsigned long *array2,
|
||||
register int length);
|
||||
int hamming_distance(uinT32* array1, uinT32* array2, int length);
|
||||
|
||||
BIT_VECTOR NewBitVector(int NumBits);
|
||||
/*
|
||||
|
@ -26,6 +26,8 @@
|
||||
/*----------------------------------------------------------------------
|
||||
I n c l u d e s
|
||||
---------------------------------------------------------------------*/
|
||||
#include <assert.h>
|
||||
|
||||
#include "bestfirst.h"
|
||||
#include "heuristic.h"
|
||||
#include "plotseg.h"
|
||||
@ -166,9 +168,9 @@ void delete_search(SEARCH_RECORD *the_search) {
|
||||
float closeness;
|
||||
|
||||
closeness = (the_search->num_joints ?
|
||||
(hamming_distance ((unsigned long *) the_search->first_state,
|
||||
(unsigned long *) the_search->best_state,
|
||||
2) / (float) the_search->num_joints) : 0.0);
|
||||
(hamming_distance(reinterpret_cast<uinT32*>(the_search->first_state),
|
||||
reinterpret_cast<uinT32*>(the_search->best_state), 2) /
|
||||
(float) the_search->num_joints) : 0.0f);
|
||||
|
||||
record_search_status (the_search->num_states,
|
||||
the_search->before_best, closeness);
|
||||
|
Loading…
Reference in New Issue
Block a user