Skip to content

Commit

Permalink
Merge pull request #405 from murraycu/develop-murrayc-examples-modern…
Browse files Browse the repository at this point in the history
…-cpp-attempt2

Examples: Fix minor warnings
  • Loading branch information
jeremy-murphy authored Dec 20, 2024
2 parents 68b08e3 + 350e8d7 commit ce1daeb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/fibonacci_heap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main()
uniform_int<> distrib(0, N - 1);
boost::variate_generator< random_ns::mt19937&, uniform_int<> > rand_gen(
gen, distrib);
for (int t = 0; t < 10; ++t)
for (std::size_t t = 0; t < 10; ++t)
{
std::vector< float > v, w(N);

Expand Down
3 changes: 2 additions & 1 deletion example/graph-thingie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <boost/foreach.hpp>
#include <string>
#include <sstream>
#include <cstdlib>

using namespace boost;
using namespace std;
Expand Down Expand Up @@ -104,5 +105,5 @@ int main()
<< get("label", dp, v) << ")\n";
}

return 0;
return status ? EXIT_SUCCESS : EXIT_FAILURE;
}
4 changes: 2 additions & 2 deletions example/prim-telephone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ int main()
#endif

int total_weight = 0;
for (int v = 0; v < num_vertices(g); ++v)
for (std::size_t v = 0; v < num_vertices(g); ++v)
if (parent[v] != v)
total_weight += get(weight, edge(parent[v], v, g).first);
std::cout << "total weight: " << total_weight << std::endl;

for (int u = 0; u < num_vertices(g); ++u)
for (std::size_t u = 0; u < num_vertices(g); ++u)
if (parent[u] != u)
edge_attr_map[edge(parent[u], u, g_dot).first]["color"] = "black";
std::ofstream out("figs/telephone-mst-prim.dot");
Expand Down

0 comments on commit ce1daeb

Please sign in to comment.