Raptor 3.0.0-rc.1
A fast and space-efficient pre-filter for querying very large collections of nucleotide sequences
 
node_data.hpp
Go to the documentation of this file.
1// --------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2023, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2023, Knut Reinert & MPI für molekulare Genetik
4// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5// shipped with this file and also available at: https://github.com/seqan/raptor/blob/main/LICENSE.md
6// --------------------------------------------------------------------------------------------------
7
13#pragma once
14
15#include <vector>
16
17#include <lemon/list_graph.h>
18
20
21namespace raptor::hibf
22{
23
24struct node_data // rename:ibf_data? or ibf_node_data
25{
26 size_t parent_bin_index{};
27 size_t max_bin_index{};
28 size_t number_of_technical_bins{};
29 lemon::ListDigraph::Node favourite_child{lemon::INVALID};
30 std::vector<chopper_pack_record> remaining_records{}; // non-merged bins (either split or single)
31
32 bool operator==(node_data const & rhs) const
33 {
34 bool res = std::tie(parent_bin_index, max_bin_index, number_of_technical_bins, favourite_child)
35 == std::tie(rhs.parent_bin_index, rhs.max_bin_index, rhs.number_of_technical_bins, rhs.favourite_child);
36
37 if (remaining_records.size() != rhs.remaining_records.size())
38 return false;
39
40 for (size_t i = 0; i < remaining_records.size(); ++i)
41 res &= (remaining_records[i] == rhs.remaining_records[i]);
42
43 return res;
44 }
45
46 bool operator!=(node_data const & rhs) const
47 {
48 return !(*this == rhs);
49 }
50};
51
52} // namespace raptor::hibf
Provides raptor::hibf::chopper_pack_record.
Must be first include.
Definition: bin_prefixes.hpp:18
Definition: node_data.hpp:25
T tie(T... args)