Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a17a2ac

Browse files
committed
compiling with g++ 7.4
1 parent 4de0932 commit a17a2ac

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

‎src/bgaMain.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// with a basic text user interface for all algorithms.
1010
//
1111

12+
#include "dvector.h"
1213
#include "scc.h"
1314
#include "dfs.h"
1415
#include "mst.h"

‎src/graph.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <sstream>
1515
#include <set>
1616
#include <vector>
17+
#include <limits.h>
1718

1819
using namespace std;
1920

@@ -184,4 +185,4 @@ namespace basicGraph {
184185
};
185186
}
186187

187-
#endif //BASIC_GRAPH_H
188+
#endif //BASIC_GRAPH_H

‎src/mst.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ namespace MST {
4747
virtual void build() = 0;
4848
bool nodePartOfMST(const basicGraph::bNode* gnode)
4949
{
50-
return tree_.find(&treeNode(gnode)) != tree_.end();
50+
treeNode tmpTreeNode = treeNode(gnode);
51+
return tree_.find(&tmpTreeNode) != tree_.end();
5152
}
5253
treeNode* getTreeNode(const basicGraph::bNode* gnode)
5354
{
54-
set<treeNode*, treeNodeCompare>::iterator niter = tree_.find(&treeNode(gnode));
55+
treeNode tmpTreeNode = treeNode(gnode);
56+
set<treeNode*, treeNodeCompare>::iterator niter = tree_.find(&tmpTreeNode);
5557
return niter == tree_.end() ? nullptr : *niter;
5658
}
5759
void print(bool edges_only=false)
@@ -177,8 +179,10 @@ namespace MST {
177179
{
178180
const basicGraph::bNode* u = sortedEdges[i]->n1();
179181
const basicGraph::bNode* v = sortedEdges[i]->n2();
180-
auto uset = tree_.find(&treeNode(u));
181-
auto vset = tree_.find(&treeNode(v));
182+
treeNode tmpUNode = treeNode(u);
183+
treeNode tmpVNode = treeNode(v);
184+
auto uset = tree_.find(&tmpUNode);
185+
auto vset = tree_.find(&tmpVNode);
182186
if (uset != tree_.end() && vset != tree_.end() &&
183187
(*uset)->iset_ != (*vset)->iset_ )
184188
{
@@ -297,4 +301,5 @@ namespace MST {
297301
};
298302
}
299303

300-
#endif GRAPH_MST_H
304+
#endif
305+

‎src/shortestPath.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ namespace short_paths {
6868
pathNode* src() { return src_; }
6969
pathNode* retrievePathNode(const basicGraph::bNode* gnode)
7070
{
71-
set<pathNode*, pathNodeCompare>::iterator niter = tree_.find(&pathNode(gnode));
71+
pathNode tmpNode = pathNode(gnode);
72+
set<pathNode*, pathNodeCompare>::iterator niter = tree_.find(&tmpNode);
7273
return niter == tree_.end() ? nullptr : *niter;
7374
}
7475
pathNode* retrieveOrAddPathNode(const basicGraph::bNode* gnode)
@@ -405,4 +406,4 @@ namespace short_paths {
405406
};
406407
}
407408

408-
#endif
409+
#endif

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /