Version: 1.0
forest2dag.h
Go to the documentation of this file.
1 // Copyright (c) 2020, the GRAPHGEN contributors, as
2 // shown by the AUTHORS file. All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
6 
7 #ifndef GRAPHGEN_FOREST2DAG_H_
8 #define GRAPHGEN_FOREST2DAG_H_
9 
10 #include <iterator>
11 #include <string>
12 #include <unordered_map>
13 
14 #include "forest.h"
15 
16 // Converts forest of decision trees into poly-rooted-dag
17 struct Forest2Dag {
18  std::unordered_map<BinaryDrag<conact>::node*, std::string> ps_; // pointer -> string
19  std::unordered_map<std::string, BinaryDrag<conact>::node*> sp_; // string -> pointer
21 
22  std::string Tree2String(BinaryDrag<conact>::node* n);
23 
25 
27 };
28 
29 #endif // !GRAPHGEN_FOREST2DAG_H_
A BinaryDrag is the GRAPHGEN implementation of a Binary Directed Rooted Acyclic Graph (DRAG in short)
Definition: drag.h:28
std::unordered_map< BinaryDrag< conact >::node *, std::string > ps_
Definition: forest2dag.h:18
Forest2Dag(LineForestHandler &f)
std::unordered_map< std::string, BinaryDrag< conact >::node * > sp_
Definition: forest2dag.h:19
LineForestHandler & f_
Definition: forest2dag.h:20
std::string Tree2String(BinaryDrag< conact >::node *n)
Definition: forest2dag.cpp:15
void FindAndLink(BinaryDrag< conact >::node *n)
Definition: forest2dag.cpp:39
Generates all the forests needed to handle one line of the image.
Definition: forest.h:51