indigoX
nicetreedecomp.hpp
Go to the documentation of this file.
1 //
2 // tree_decomposition.hpp
3 // indigox
4 //
5 // Created by Welsh, Ivan on 20/11/17.
6 // Copyright © 2017 Allison Group. All rights reserved.
7 //
8 
9 #ifndef INDIGOX_CLASSES_NICETREEDECOMP_HPP
10 #define INDIGOX_CLASSES_NICETREEDECOMP_HPP
11 
12 #include "../utils/graph.hpp"
13 #include "treedecomp.hpp"
14 
15 #include <set>
16 #include <string>
17 
18 namespace indigox {
19 
20  struct NTDVertProp {
21  uint32_t id;
22  std::set<MolVertPair> bag;
23  std::pair<char, MolVertPair> kind;
24  };
25 
26  typedef utils::Graph<NTDVertProp, utils::NoProperty, utils::DirectedGraph>
28 
29  typedef _NTDGraph::VertType NTDVertex;
30  typedef _NTDGraph::VertIter NTDVertexIter;
31  typedef _NTDGraph::EdgeType NTDEdge;
32  typedef _NTDGraph::EdgeIter NTDEdgeIter;
33  typedef _NTDGraph::NbrsIter NTDNeighboursIter;
34  typedef _NTDGraph::PredIter NTDPredecessorsIter;
35 
36  typedef _NTDGraph::VertTypePair NTDVertPair;
37  typedef _NTDGraph::VertIterPair NTDVertIterPair;
38  typedef _NTDGraph::EdgeIterPair NTDEdgeIterPair;
39  typedef _NTDGraph::NbrsIterPair NTDNbrsIterPair;
40  typedef _NTDGraph::PredIterPair NTDPredIterPair;
41  typedef _NTDGraph::VertBool NTDVertBool;
42  typedef _NTDGraph::EdgeBool NTDEdgeBool;
43 
44  class _NTDecomp : public _NTDGraph {
45  public:
46  _NTDecomp();
49 
50  void SetInput(TDecomp);
51  void SetInput(TDecomp, TDVertex);
52  void TopologicalSort(std::vector<NTDVertex> &) const;
53  TDecomp GetSourceGraph() { return source_; }
54  size_t GetWidth();
55 
56  private:
57  uint32_t vert_count_ = 0;
58  TDecomp source_;
59  };
60 
61  typedef std::shared_ptr<_NTDecomp> NTDecomp;
62 
63 } // namespace indigox
64 
65 #endif /* INDIGOX_CLASSES_NICETREEDECOMP_HPP */
std::pair< char, MolVertPair > kind
Definition: nicetreedecomp.hpp:23
_NTDGraph::VertTypePair NTDVertPair
Definition: nicetreedecomp.hpp:36
Definition: nicetreedecomp.hpp:44
_NTDGraph::NbrsIterPair NTDNbrsIterPair
Definition: nicetreedecomp.hpp:39
_NTDGraph::EdgeIter NTDEdgeIter
Definition: nicetreedecomp.hpp:32
_NTDGraph::EdgeIterPair NTDEdgeIterPair
Definition: nicetreedecomp.hpp:38
utils::Graph< NTDVertProp, utils::NoProperty, utils::DirectedGraph > _NTDGraph
Definition: nicetreedecomp.hpp:27
void SetInput(TDecomp)
_NTDGraph::NbrsIter NTDNeighboursIter
Definition: nicetreedecomp.hpp:33
_NTDGraph::PredIter NTDPredecessorsIter
Definition: nicetreedecomp.hpp:34
std::set< MolVertPair > bag
Definition: nicetreedecomp.hpp:22
void TopologicalSort(std::vector< NTDVertex > &) const
Namespace for all graph related functionality.
Definition: access.hpp:7
_NTDGraph::VertIterPair NTDVertIterPair
Definition: nicetreedecomp.hpp:37
_TDGraph::VertType TDVertex
Definition: treedecomp.hpp:28
TDecomp GetSourceGraph()
Definition: nicetreedecomp.hpp:53
_NTDGraph::VertIter NTDVertexIter
Definition: nicetreedecomp.hpp:30
_NTDGraph::EdgeBool NTDEdgeBool
Definition: nicetreedecomp.hpp:42
_NTDGraph::VertType NTDVertex
Definition: nicetreedecomp.hpp:29
std::shared_ptr< _TDecomp > TDecomp
Definition: treedecomp.hpp:64
_NTDGraph::EdgeType NTDEdge
Definition: nicetreedecomp.hpp:31
_NTDGraph::PredIterPair NTDPredIterPair
Definition: nicetreedecomp.hpp:40
_NTDGraph::VertBool NTDVertBool
Definition: nicetreedecomp.hpp:41
std::shared_ptr< _NTDecomp > NTDecomp
Definition: nicetreedecomp.hpp:61
uint32_t id
Definition: nicetreedecomp.hpp:21
Definition: nicetreedecomp.hpp:20