kaori
A C++ library for barcode extraction and matching
Loading...
Searching...
No Matches
kaori::SegmentedBarcodeSearch< num_segments_ >::State Struct Reference

State of the search. More...

#include <BarcodeSearch.hpp>

Public Attributes

BarcodeIndex index = 0
 
int mismatches = 0
 
std::array< int, num_segments_ > per_segment
 

Detailed Description

template<int num_segments_>
struct kaori::SegmentedBarcodeSearch< num_segments_ >::State

State of the search.

This contains both the results of search() for any given input sequence, as well as cached mismatches to optimize searches for future inputs.

Member Data Documentation

◆ index

template<int num_segments_>
BarcodeIndex kaori::SegmentedBarcodeSearch< num_segments_ >::State::index = 0

Index of the known sequence that matches best to the input sequence in search() (i.e., fewest total mismatches). If all barcodes have more mismatches than allowed_mismatches, STATUS_UNMATCHED is returned. If multiple barcodes share the same lowest number of mismatches (not greater than allowed_mismatches), STATUS_AMBIGUOUS is returned.

◆ mismatches

template<int num_segments_>
int kaori::SegmentedBarcodeSearch< num_segments_ >::State::mismatches = 0

Total number of mismatches with the matching known sequence, summed across all segments. This should be ignored if index == STATUS_UNMATCHED, as the search will terminate early without computing the exact number of mismatches if allowed_mismatches is exceeded.

◆ per_segment

template<int num_segments_>
std::array<int, num_segments_> kaori::SegmentedBarcodeSearch< num_segments_ >::State::per_segment

Number of mismatches in each segment. This should be ignored if index == STATUS_UNMATCHED, as the search will terminate early without computing the exact number of mismatches if allowed_mismatches is exceeded.


The documentation for this struct was generated from the following file: