Skip to content

Commit b994f02

Browse files
committed
changed namespaces and basic types to avoid conflicts
1 parent 037d3fb commit b994f02

File tree

20 files changed

+47
-38
lines changed

20 files changed

+47
-38
lines changed

include/maxplus/base/analysis/mcm/mcm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
#include "maxplus/base/analysis/mcm/mcmgraph.h"
4949

50-
namespace Graphs {
50+
namespace MaxPlus::Graphs {
5151

5252
/// <summary>
5353
/// The function computes the maximum cycle mean of an MCMgraph using Karp's
@@ -101,5 +101,5 @@ v_uint mcmGetAdjacentActors(uint a,
101101
const std::vector<v_uint> &graph,
102102
uint nrNodes);
103103

104-
} // namespace Graphs
104+
} // namespace MaxPlus::Graphs
105105
#endif

include/maxplus/base/analysis/mcm/mcmdg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
#include "maxplus/base/analysis/mcm/mcmgraph.h"
5555

56-
namespace Graphs {
56+
namespace MaxPlus::Graphs {
5757

5858
/**
5959
* mcmDG ()
@@ -66,6 +66,6 @@ namespace Graphs {
6666
*/
6767
CDouble mcmDG(MCMgraph &mcmGraph);
6868

69-
} // namespace Graphs
69+
} // namespace MaxPlus::Graphs
7070

7171
#endif

include/maxplus/base/analysis/mcm/mcmgraph.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
#include <memory>
4747
#include <utility>
4848

49-
namespace Graphs {
49+
using namespace MaxPlus;
50+
51+
namespace MaxPlus::Graphs {
5052
class MCMnode;
5153

5254
class MCMedge {
@@ -263,5 +265,5 @@ void relabelMCMgraph(MCMgraph &g);
263265
*/
264266
void addLongestDelayEdgesToMCMgraph(MCMgraph &g);
265267

266-
} // namespace Graphs
268+
} // namespace MaxPlus::Graphs
267269
#endif

include/maxplus/base/analysis/mcm/mcmhoward.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
#include "maxplus/base/analysis/mcm/mcmgraph.h"
5656
#include <memory>
57-
namespace Graphs {
57+
namespace MaxPlus::Graphs {
5858
/**
5959
* convertMCMgraphToMatrix ()
6060
* The function converts a weighted directed graph used in the MCM algorithms
@@ -125,5 +125,5 @@ CDouble maximumCycleMeanHoward(MCMgraph &g, MCMnode **criticalNode);
125125
*/
126126
CDouble maximumCycleMeanHowardGeneral(MCMgraph &g, MCMnode **criticalNode);
127127

128-
} // namespace Graphs
128+
} // namespace MaxPlus::Graphs
129129
#endif

include/maxplus/base/analysis/mcm/mcmyto.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#include <memory>
5454
#include <vector>
5555

56-
namespace Graphs {
56+
namespace MaxPlus::Graphs {
5757

5858
using node = struct Node {
5959
// index into nodes array of graph structure is id - 1
@@ -186,6 +186,6 @@ void convertMCMgraphToYTOgraph(MCMgraph &g,
186186

187187
void mmcycle(graph &gr, CDouble *lambda, std::vector<const arc *> *cycle);
188188

189-
} // namespace Graphs
189+
} // namespace MaxPlus::Graphs
190190

191191
#endif

include/maxplus/base/basic_types.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
/* STL functionality */
4949
#include <algorithm>
50+
#include <cstdint>
5051
#include <fstream>
5152
#include <iostream>
5253
#include <list>
@@ -55,16 +56,20 @@
5556
#include <set>
5657
#include <vector>
5758

59+
namespace MaxPlus {
60+
5861
/* basic types */
59-
using uint = unsigned int;
60-
using v_int = std::vector<int>;
61-
using v_uint = std::vector<uint>;
62+
using uint = uint32_t;
63+
using v_int = std::vector<int32_t>;
64+
using v_uint = std::vector<uint32_t>;
6265

6366
/* Id */
64-
using CId = uint;
65-
using CSize = unsigned long long;
67+
using CId = uint32_t;
68+
using CSize = uint64_t;
6669

6770
/* Doubles */
6871
using CDouble = double;
6972

73+
} // namespace MaxPlus
74+
7075
#endif

include/maxplus/base/fsm/fsm.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
#include <set>
5252
#include <utility>
5353

54-
namespace FSM {
54+
using namespace MaxPlus;
55+
56+
namespace MaxPlus::FSM {
5557

5658
// the abstract ancestor of FSM types
5759
namespace Abstract {
@@ -1205,6 +1207,6 @@ class FiniteStateMachine : public Abstract::FiniteStateMachine {
12051207

12061208
} // namespace Product
12071209

1208-
} // namespace FSM
1210+
} // namespace MaxPlus::FSM
12091211

12101212
#endif

include/maxplus/base/fsm/iofsm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ using IOASetOfStateRefs = ::FSM::Labeled::SetOfStateRefs<CId, IOAEdgeLabel>;
1919
using IOASetOfEdges = ::FSM::Labeled::SetOfEdges<CId, IOAEdgeLabel>;
2020
using IOASetOfEdgeRefs = ::FSM::Labeled::SetOfEdgeRefs<CId, IOAEdgeLabel>;
2121

22-
namespace FSM::Labeled {
22+
namespace MaxPlus::FSM::Labeled {
2323

2424
class IOAutomaton : public ::FSM::Labeled::FiniteStateMachine<CId, IOAEdgeLabel> {
2525
public:
2626
virtual ~IOAutomaton(){};
2727
};
2828

29-
} // namespace FSM::Labeled
29+
} // namespace MaxPlus::FSM::Labeled
3030

3131
#endif

include/maxplus/game/policyiteration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
namespace MaxPlus {
5353

54-
using namespace ::FSM::Labeled;
54+
using namespace ::MaxPlus::FSM::Labeled;
5555

5656
/**
5757
* Policy Iteration Algorithm to solve ratio games.

include/maxplus/game/ratiogame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
namespace MaxPlus {
4848

49-
using namespace ::FSM::Labeled;
49+
using namespace ::MaxPlus::FSM::Labeled;
5050

5151
template <typename SL, typename EL> class RatioGame : virtual public DoubleWeightedGraph<SL, EL> {
5252
public:

0 commit comments

Comments
 (0)