tesseract
5.0.0-alpha-619-ge9db
|
Go to the documentation of this file.
20 #ifndef TESSERACT_CCUTIL_INDEXMAPBIDI_H_
21 #define TESSERACT_CCUTIL_INDEXMAPBIDI_H_
117 void Init(
int size,
bool all_mapped);
119 void SetMap(
int sparse_index,
bool mapped);
128 bool Merge(
int compact_index1,
int compact_index2);
131 return MasterCompactIndex(index) < 0;
139 return sparse_map_[sparse_index];
143 return sparse_map_.
size();
167 int MasterCompactIndex(
int compact_index)
const {
168 while (compact_index >= 0 &&
169 sparse_map_[
compact_map_[compact_index]] != compact_index)
170 compact_index = sparse_map_[
compact_map_[compact_index]];
171 return compact_index;
180 #endif // TESSERACT_CCUTIL_INDEXMAPBIDI_H_
bool DeSerialize(bool swap, FILE *fp)
int MapFeatures(const GenericVector< int > &sparse, GenericVector< int > *compact) const
void InitAndSetupRange(int sparse_size, int start, int end)
int SparseToCompact(int sparse_index) const override
int CompactToSparse(int compact_index) const
virtual int SparseToCompact(int sparse_index) const
bool Serialize(FILE *fp) const
bool DeSerialize(bool swap, FILE *fp)
bool Merge(int compact_index1, int compact_index2)
void CopyFrom(const IndexMap &src)
void CopyFrom(const IndexMapBiDi &src)
bool Serialize(FILE *fp) const
virtual int SparseSize() const
int SparseSize() const override
void Init(int size, bool all_mapped)
void SetMap(int sparse_index, bool mapped)
bool IsCompactDeleted(int index) const
GenericVector< int32_t > compact_map_