1 | /** \file graph.cpp
|
---|
2 | *
|
---|
3 | * Function definitions for the class graph.
|
---|
4 | *
|
---|
5 | */
|
---|
6 |
|
---|
7 | #ifndef GRAPH_HPP_
|
---|
8 | #define GRAPH_HPP_
|
---|
9 |
|
---|
10 | /*********************************************** includes ***********************************/
|
---|
11 |
|
---|
12 | // include config.h
|
---|
13 | #ifdef HAVE_CONFIG_H
|
---|
14 | #include <config.h>
|
---|
15 | #endif
|
---|
16 |
|
---|
17 | // STL headers
|
---|
18 | #include <deque>
|
---|
19 | #include <map>
|
---|
20 | #include <set>
|
---|
21 | #include <list>
|
---|
22 |
|
---|
23 | /****************************************** forward declarations *****************************/
|
---|
24 |
|
---|
25 | class atom;
|
---|
26 | class bond;
|
---|
27 | class config;
|
---|
28 | class molecule;
|
---|
29 |
|
---|
30 | class SubGraph;
|
---|
31 | class Node;
|
---|
32 | class Edge;
|
---|
33 | class UniqueFragments;
|
---|
34 |
|
---|
35 | /********************************************** definitions *********************************/
|
---|
36 |
|
---|
37 | typedef std::pair < int, class Node* > NodeMap;
|
---|
38 | typedef std::multimap < class Node*, class Edge* > EdgeMap;
|
---|
39 |
|
---|
40 | typedef std::deque<int> KeyStack;
|
---|
41 | typedef std::set<int> KeySet;
|
---|
42 | typedef std::pair<int, double> NumberValuePair;
|
---|
43 |
|
---|
44 | // needed for definition of Graph and GraphTestPair
|
---|
45 | struct KeyCompare
|
---|
46 | {
|
---|
47 | bool operator() (const KeySet SubgraphA, const KeySet SubgraphB) const;
|
---|
48 | };
|
---|
49 |
|
---|
50 | typedef std::map <KeySet, NumberValuePair, KeyCompare > Graph;
|
---|
51 | typedef std::pair <KeySet, NumberValuePair > GraphPair;
|
---|
52 | typedef std::pair<KeySet::iterator, bool> KeySetTestPair;
|
---|
53 | typedef std::pair<Graph::iterator, bool> GraphTestPair;
|
---|
54 |
|
---|
55 |
|
---|
56 | /******************************** Some small functions and/or structures **********************************/
|
---|
57 |
|
---|
58 | //bool operator < (KeySet SubgraphA, KeySet SubgraphB); //note: this declaration is important, otherwise normal < is used (producing wrong order)
|
---|
59 | void InsertGraphIntoGraph(Graph &graph1, Graph &graph2, int *counter); // Insert all KeySet's in a Graph into another Graph
|
---|
60 |
|
---|
61 |
|
---|
62 | /********************************************** declarations *******************************/
|
---|
63 |
|
---|
64 | ///** Graph class containing the graphs behind molecules.
|
---|
65 | // */
|
---|
66 | //class Graph
|
---|
67 | //{
|
---|
68 | // NodeMap ListOfNodes; //!< tree-list of all nodes in this graph
|
---|
69 | // EdgeMap ListOfEdges; //!< tree-multi-list of all nodes, referenced to node id
|
---|
70 | //};
|
---|
71 | //
|
---|
72 | ///** Class describing subgraphs of the Class \a Graph.
|
---|
73 | // * SubGraph has its own node and edge lists, however also a pointer to its father graph
|
---|
74 | // * and hence access to its list as well.
|
---|
75 | // */
|
---|
76 | //class SubGraph : class Graph
|
---|
77 | //{
|
---|
78 | // class Graph *FatherGraph; //!< Graph whose subgraph we are
|
---|
79 | //};
|
---|
80 | //
|
---|
81 | ///** Class containing the nodes of a graph.
|
---|
82 | // */
|
---|
83 | //class Node
|
---|
84 | //{
|
---|
85 | // int id; //!< individual id of the node
|
---|
86 | // char *Name; //!< Name of the node for pretty printing
|
---|
87 | //};
|
---|
88 | //
|
---|
89 | ///** Class containing egdes in a Graph strructure.
|
---|
90 | // */
|
---|
91 | //class Edge
|
---|
92 | //{
|
---|
93 | // class Node *leftnode; //!< pointer to first node
|
---|
94 | // class Node *atomnode; //!< pointer to second node
|
---|
95 | //};
|
---|
96 |
|
---|
97 |
|
---|
98 |
|
---|
99 | #endif /*GRAPH_HPP_*/
|
---|