forked from simongog/sdsl-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage-visualization.cpp
More file actions
26 lines (23 loc) · 901 Bytes
/
storage-visualization.cpp
File metadata and controls
26 lines (23 loc) · 901 Bytes
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);
}