File: app.cpp

package info (click to toggle)
iqtree 2.0.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 14,620 kB
  • sloc: cpp: 142,571; ansic: 57,789; sh: 275; python: 242; makefile: 95
file content (30 lines) | stat: -rw-r--r-- 839 bytes parent folder | download | duplicates (3)
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
#include <bitset>
#include <chrono>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <thread>

#include <terraces/simple.hpp>

int main(int argc, char** argv) try {
	auto tree_file_name = std::string{};
	auto data_file_name = std::string{};
	if (argc == 3) {
		tree_file_name = argv[1];
		data_file_name = argv[2];
	} else {
		std::cerr << "Usage: \n" << argv[0] << " <tree-file> <occurrence file>\n";
		return 1;
	}
	auto trees = std::ostringstream{};
	const auto terraces_count =
	        terraces::simple::print_terrace_from_file(tree_file_name, data_file_name, trees);

	std::cout << "There are " << terraces_count
	          << " trees on the terrace.\n\nThe trees in question are:\n"
	          << trees.str() << '\n';
} catch (std::exception& e) {
	std::cerr << "Error: " << e.what() << "\n";
}