File: cst-node-child-iterator.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 (33 lines) | stat: -rw-r--r-- 701 bytes parent folder | download | duplicates (19)
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
#include <sdsl/suffix_trees.hpp>
#include <iostream>
#include <string>

using namespace std;
using namespace sdsl;

typedef cst_sct3<> cst_t;
typedef cst_sada<> csts_t;

int main(int argc, char* argv[])
{
    if (argc < 2) {
        cout << "usage: "<<argv[0]<< " file" << std::endl;
        return 1;
    }

    cst_t cst;
    construct(cst, argv[1], 1);

    auto root = cst.root();

    for (auto& child: cst.children(root)) {
        std::cout << "sct3 id = " << cst.id(child) << std::endl;
    }

    csts_t csts;
    construct(csts, argv[1], 1);
    auto roots = csts.root();
    for (auto child: csts.children(roots)) {
        std::cout << "sada id = " << csts.id(child) << std::endl;
    }
}