File: storage-visualization.cpp

package info (click to toggle)
seqan3 3.0.2%2Bds-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 16,052 kB
  • sloc: cpp: 144,641; makefile: 1,288; ansic: 294; sh: 228; xml: 217; javascript: 50; python: 27; php: 25
file content (26 lines) | stat: -rw-r--r-- 901 bytes parent folder | download | duplicates (13)
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
#include <sdsl/suffix_trees.hpp>
#include <sdsl/io.hpp>
#include <iostream>
#include <chrono>

using timer = std::chrono::high_resolution_clock;
using namespace std::chrono;
using namespace sdsl;

int main(int argc, char** argv)
{
    if (argc < 2) {
      std::cout << "Usage: " << argv[0] << " file" << std::endl;
      std::cout << " Creates a CST for a byte file and visualizes the space used by the data structure." << std::endl;
      return 1;
    }
    cst_sct3<> cst;
    auto start = timer::now();
    std::cout << "constructing cst..." << std::endl;
    construct(cst, argv[1], 1);
    std::cout << "construction cst time in seconds: " << duration_cast<seconds>(timer::now()-start).count() << std::endl;

    std::ofstream ofs("cst-space-usage.html");
    std::cout << "writing storage visualization to cst-space-usage.html" << std::endl;
    sdsl::write_structure<HTML_FORMAT>(cst,ofs);
}