Skip to content

Commit

Permalink
Throw an error when trying to access distances in a distanceless index
Browse files Browse the repository at this point in the history
  • Loading branch information
xchang1 committed Nov 21, 2024
1 parent e98cda2 commit e780aa4
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 22 deletions.
7 changes: 6 additions & 1 deletion bdsg/include/bdsg/snarl_distance_index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,11 @@ class SnarlDistanceIndex : public SnarlDecomposition, public TriviallySerializab
ROOT_SNARL, DISTANCED_ROOT_SNARL,
CHAIN, DISTANCED_CHAIN, MULTICOMPONENT_CHAIN,
CHILDREN};
const static bool has_distances(record_t type) {
return type == DISTANCED_NODE || type == DISTANCED_TRIVIAL_SNARL || type == DISTANCED_SIMPLE_SNARL
|| type == DISTANCED_SNARL || type == OVERSIZED_SNARL || type == DISTANCED_ROOT_SNARL
|| type == DISTANCED_CHAIN || type == MULTICOMPONENT_CHAIN;
}



Expand Down Expand Up @@ -1390,7 +1395,7 @@ class SnarlDistanceIndex : public SnarlDecomposition, public TriviallySerializab
//If new_record is true, make a new trivial snarl record for the node
size_t add_node(nid_t node_id, size_t node_length, bool is_reversed_in_parent,
size_t prefix_sum, size_t forward_loop, size_t reverse_loop, size_t component,
size_t max_prefix_sum, size_t previous_child_offset, bool new_record);
size_t max_prefix_sum, size_t previous_child_offset, bool new_record, bool include_distances);

};

Expand Down
Loading

0 comments on commit e780aa4

Please sign in to comment.