File: nodes.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 (25 lines) | stat: -rw-r--r-- 392 bytes parent folder | download
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
#include <terraces/trees.hpp>

#include <ostream>

namespace terraces {

std::ostream& operator<<(std::ostream& s, const node& n) {
	auto print_index = [&s](index i) {
		if (i == none) {
			s << "none";
		} else {
			s << i;
		}
	};
	s << '(';
	print_index(n.data[0]);
	s << ", ";
	print_index(n.data[1]);
	s << ", ";
	print_index(n.data[2]);
	s << ')';
	return s;
}

} // namespace terraces