CXXGraph  0.2.0
CXXGraph is a header only, that manages the Graphs and it's algorithm in C++
Typedef.hpp
1 /***********************************************************/
2 /*** ______ ____ ______ _ ***/
3 /*** / ___\ \/ /\ \/ / ___|_ __ __ _ _ __ | |__ ***/
4 /*** | | \ / \ / | _| '__/ _` | '_ \| '_ \ ***/
5 /*** | |___ / \ / \ |_| | | | (_| | |_) | | | | ***/
6 /*** \____/_/\_\/_/\_\____|_| \__,_| .__/|_| |_| ***/
7 /*** |_| ***/
8 /***********************************************************/
9 /*** Header-Only C++ Library for Graph ***/
10 /*** Representation and Algorithms ***/
11 /***********************************************************/
12 /*** Author: ZigRazor ***/
13 /*** E-Mail: zigrazor@gmail.com ***/
14 /***********************************************************/
15 /*** Collaboration: ----------- ***/
16 /***********************************************************/
17 /*** License: AGPL v3.0 ***/
18 /***********************************************************/
19 
20 #ifndef __CXXGRAPH_TYPEDEF_H__
21 #define __CXXGRAPH_TYPEDEF_H__
22 
23 #pragma once
24 
25 #include <map>
26 #include <string>
27 #include <fstream>
28 
29 namespace CXXGRAPH
30 {
31 
32  template <typename T>
33  class Node;
34 
35  template <typename T>
36  class Edge;
37 
38  namespace PARTITIONING{
39  template<typename T>
40  class Partition;
41  }
42  // ENUMERATION //////////////////////////////////////
43 
45  enum E_InputOutputFormat
46  {
47  STANDARD_CSV,
48  STANDARD_TSV,
49  OUT_1,
50  OUT_2
51  };
52 
53  typedef E_InputOutputFormat InputOutputFormat;
54 
55 
56 
58  // Structures ///////////////////////////////////////
59 
62  {
63  bool success; // TRUE if the function does not return error, FALSE otherwise
64  std::string errorMessage; //message of error
65  double result; //result (valid only if success is TRUE)
66  };
68 
71  {
72  bool success; // TRUE if the function does not return error, FALSE otherwise
73  bool negativeCycle; // TRUE if graph contains a negative cycle, FALSE otherwise
74  std::string errorMessage; //message of error
75  double result; //result (valid only if success is TRUE & negativeCycle is false )
76  };
78 
81  {
82  bool success; // TRUE if the function does not return error, FALSE otherwise
83  bool negativeCycle; // TRUE if graph contains a negative cycle, FALSE otherwise
84  std::string errorMessage; //message of error
85  std::map<std::pair<unsigned long, unsigned long>, double> result;
86  };
87  typedef FWResult_struct FWResult;
88 
91  {
92  bool success; // TRUE if the function does not return error, FALSE otherwise
93  std::string errorMessage; //message of error
94  std::vector<unsigned long> result; // MST
95  double mstCost; // MST
96  };
98 
101  {
102  bool success; // TRUE if the function does not return error, FALSE otherwise
103  std::string errorMessage; //message of error
104  std::map<unsigned long, long> minDistanceMap; //result a map that contains the node id and the minumum distance from source (valid only if success is TRUE)
105  };
107 
109 
110 
112  // Using Definition ///////////////////////////////////////////////////////////////
113 
114  template <typename T>
115  using AdjacencyMatrix = std::map<const Node<T> *, std::vector<std::pair<const Node<T> *, const Edge<T> *>>>;
116 
117  template <typename T>
118  using PartitionMap = std::map<unsigned int, PARTITIONING::Partition<T> *>;
119 
121 }
122 
123 #endif // __CXXGRAPH_TYPEDEF_H__
Definition: Edge.hpp:39
Struct that contains the information about Dijsktra's Algorithm results.
Definition: Typedef.hpp:71
Struct that contains the information about Dijsktra's Algorithm results.
Definition: Typedef.hpp:101
Struct that contains the information about Dijsktra's Algorithm results.
Definition: Typedef.hpp:62
Struct that contains the information about Floyd-Warshall Algorithm results.
Definition: Typedef.hpp:81
Struct that contains the information about Prim Algorithm results.
Definition: Typedef.hpp:91