Skip to content

Commit

Permalink
Update Utilities.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigRazor authored Jun 10, 2022
1 parent 4d57cdf commit 4f2b8c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions benchmark/Utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static std::map<unsigned long, CXXGRAPH::Node<int> *> generateRandomNodes(unsign
int randomNumber;
for (auto index = 0; index < numberOfNodes; index++)
{
randomNumber = (rand_r() % MaxValue) + 1;
randomNumber = (rand_r(NULL) % MaxValue) + 1;
CXXGRAPH::Node<int> *newNode = new CXXGRAPH::Node<int>(std::to_string(index), randomNumber);
nodes[index] = newNode;
}
Expand All @@ -27,8 +27,8 @@ static std::map<unsigned long, CXXGRAPH::Edge<int> *> generateRandomEdges(unsign
auto MaxValue = nodes.size();
for (auto index = 0; index < numberOfEdges; index++)
{
randomNumber1 = (rand_r() % MaxValue);
randomNumber2 = (rand_r() % MaxValue);
randomNumber1 = (rand_r(NULL) % MaxValue);
randomNumber2 = (rand_r(NULL) % MaxValue);
CXXGRAPH::Edge<int> *newEdge = new CXXGRAPH::Edge<int>(index, *(nodes.at(randomNumber1)), *(nodes.at(randomNumber2)));
edges[index] = newEdge;
}
Expand All @@ -44,8 +44,8 @@ static std::map<unsigned long, CXXGRAPH::UndirectedEdge<int> *> generateRandomUn
auto MaxValue = nodes.size();
for (auto index = 0; index < numberOfEdges; index++)
{
randomNumber1 = (rand_r() % MaxValue);
randomNumber2 = (rand_r() % MaxValue);
randomNumber1 = (rand_r(NULL) % MaxValue);
randomNumber2 = (rand_r(NULL) % MaxValue);
CXXGRAPH::UndirectedEdge<int> *newEdge = new CXXGRAPH::UndirectedEdge<int>(index, *(nodes.at(randomNumber1)), *(nodes.at(randomNumber2)));
edges[index] = newEdge;
}
Expand Down

0 comments on commit 4f2b8c3

Please sign in to comment.