File tree Expand file tree Collapse file tree 2 files changed +28
-13
lines changed
Expand file tree Collapse file tree 2 files changed +28
-13
lines changed Original file line number Diff line number Diff line change @@ -271,8 +271,6 @@ void Config::adaptDefaults()
271271inline const char * flowModelToString (FlowModel flowModel)
272272{
273273 switch (flowModel) {
274- case FlowModel::undirected:
275- return " undirected" ;
276274 case FlowModel::directed:
277275 return " directed" ;
278276 case FlowModel::undirdir:
@@ -281,6 +279,9 @@ inline const char* flowModelToString(FlowModel flowModel)
281279 return " outdirdir" ;
282280 case FlowModel::rawdir:
283281 return " rawdir" ;
282+ case FlowModel::undirected:
283+ default :
284+ return " undirected" ;
284285 }
285286}
286287
Original file line number Diff line number Diff line change 4242
4343namespace infomap {
4444
45- enum class FlowModel {
46- undirected,
47- directed,
48- undirdir,
49- outdirdir,
50- rawdir,
45+ struct FlowModel {
46+ static constexpr int undirected = 0 ;
47+ static constexpr int directed = 1 ;
48+ static constexpr int undirdir = 2 ;
49+ static constexpr int outdirdir = 3 ;
50+ static constexpr int rawdir = 4 ;
51+
52+ int value = 0 ;
53+
54+ FlowModel (int val) : value(val) {}
55+ FlowModel& operator =(int val) { value = val; return *this ; }
56+
57+
58+ operator int &() { return value; }
59+ operator int () const { return value; }
5160};
5261
5362std::ostream& operator <<(std::ostream& out, FlowModel f);
5463
55- enum class OptimizationLevel {
56- FullCoarseTune,
57- FastCoarseTune,
58- NoTune,
59- NoAggregationNoTune
64+ struct OptimizationLevel {
65+ static constexpr int FullCoarseTune = 0 ;
66+ static constexpr int FastCoarseTune = 1 ;
67+ static constexpr int NoTune = 2 ;
68+ static constexpr int NoAggregationNoTune = 3 ;
69+
70+ int value = 0 ;
71+
72+ operator int &() { return value; }
73+ operator int () const { return value; }
6074};
6175
6276struct Config {
You can’t perform that action at this time.
0 commit comments