File: wt_helper.cpp

package info (click to toggle)
libsdsl 2.1.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,992 kB
  • sloc: cpp: 42,286; makefile: 1,171; ansic: 318; sh: 201; python: 27
file content (35 lines) | stat: -rw-r--r-- 661 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "sdsl/wt_helper.hpp"

namespace sdsl
{

bool empty(const range_type& r)
{
    return std::get<0>(r) == (std::get<1>(r) + 1);
}

int_vector<>::size_type size(const range_type& r)
{
    return std::get<1>(r) - std::get<0>(r) + 1;
}


pc_node::pc_node(uint64_t freq, uint64_t sym, uint64_t parent,
                 uint64_t child_left, uint64_t child_right):
    freq(freq), sym(sym), parent(parent)
{
    child[0] = child_left;
    child[1] = child_right;
}

pc_node& pc_node::operator=(const pc_node& v)
{
    freq     = v.freq;
    sym      = v.sym;
    parent   = v.parent;
    child[0] = v.child[0];
    child[1] = v.child[1];
    return *this;
}

}