Yet Another eXchange Tool  0.9.0
Functions
xt_cover.c File Reference
#include <stdlib.h>
#include <string.h>
#include "core/ppm_xfuncs.h"
#include "ensure_array_size.h"
#include "xt/xt_idxlist.h"
#include "xt_cover.h"
Include dependency graph for xt_cover.c:

Go to the source code of this file.

Functions

void xt_cover_start (struct Xt_pos_ext_vec *restrict cover, size_t initial_size)
 
void xt_cover_finish (struct Xt_pos_ext_vec *restrict cover)
 
bool xt_idxlist_pos_ext_is_full_cover (Xt_idxlist idxlist, struct Xt_pos_ext_vec cover)
 
size_t xt_cover_search (struct Xt_pos_ext_vec *restrict cover, struct Xt_pos_range query, bool forward, size_t search_start_pos)
 
void xt_cover_range_append (struct Xt_pos_ext_vec *restrict cover, struct Xt_pos_ext range)
 
size_t xt_cover_insert_or_overlap (struct Xt_pos_ext_vec *restrict cover, struct Xt_pos_range range, bool forward, size_t search_start_pos)
 

Detailed Description

Author
Jörg Behrens behre.nosp@m.ns@d.nosp@m.krz.d.nosp@m.e Moritz Hanke hanke.nosp@m.@dkr.nosp@m.z.de Thomas Jahns jahns.nosp@m.@dkr.nosp@m.z.de

Definition in file xt_cover.c.

Function Documentation

◆ xt_cover_finish()

void xt_cover_finish ( struct Xt_pos_ext_vec *restrict  cover)

Definition at line 69 of file xt_cover.c.

Here is the caller graph for this function:

◆ xt_cover_insert_or_overlap()

size_t xt_cover_insert_or_overlap ( struct Xt_pos_ext_vec *restrict  cover,
struct Xt_pos_range  range,
bool  forward,
size_t  search_start_pos 
)
Parameters
covercontainer of extents describing already covered portions of index list
rangedescribes a contiguous interval of positions to search for and insert if not found
forwarddirection in which to search cover, i.e. incrementing from search_start_pos if true and decrementing if false
search_start_posshould be 0, if forward == true or cover->num_pos_ext, if forward == false to search all of cover, choose value to start search at if part of cover is known to be non-matching
Returns
SIZE_MAX if range could be fully integrated with cover, position i of overlapping cover.pos_ext[i] otherwise

Definition at line 148 of file xt_cover.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xt_cover_range_append()

void xt_cover_range_append ( struct Xt_pos_ext_vec *restrict  cover,
struct Xt_pos_ext  range 
)

append range to cover

Note
user must ensure range actually is appendable, i.e. does not overlap or precede an existing range in cover

Definition at line 128 of file xt_cover.c.

Here is the caller graph for this function:

◆ xt_cover_search()

size_t xt_cover_search ( struct Xt_pos_ext_vec *restrict  cover,
struct Xt_pos_range  query,
bool  forward,
size_t  search_start_pos 
)
Parameters
covercontainer of extents describing already covered portions of index list
queryrange of positions to query if any in [query.start,query.end] is already in cover
forwarddirection to search the cover
search_start_posshould be 0, if forward == true or cover->num_pos_ext, if forward == false to search all of cover, choose value to start search at if part of cover is known to be non-matching
Returns
index of first position extent in cover that overlaps or is adjacent to query

Definition at line 95 of file xt_cover.c.

Here is the caller graph for this function:

◆ xt_cover_start()

void xt_cover_start ( struct Xt_pos_ext_vec *restrict  cover,
size_t  initial_size 
)

Definition at line 60 of file xt_cover.c.

Here is the caller graph for this function:

◆ xt_idxlist_pos_ext_is_full_cover()

bool xt_idxlist_pos_ext_is_full_cover ( Xt_idxlist  idxlist,
struct Xt_pos_ext_vec  cover 
)

tests if sorted pos_ext in coverage do indeed fully cover idxlist

Definition at line 75 of file xt_cover.c.

Here is the call graph for this function:
Here is the caller graph for this function: