Skip to content

Commit

Permalink
replace reserve with resize in vector
Browse files Browse the repository at this point in the history
  • Loading branch information
ritesh99rakesh committed Dec 8, 2019
1 parent c4c083f commit 3acb73a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -30,7 +30,7 @@ MIDAS expects the input edge stream to be stored in a single file containing the
2. `destination (int)`: destination ID of the edge
3. `time (int)`: time stamp of the edge

Thus, each line represents an edge. Edges should be sorted in non-decreasing order of their time stamps and the column delimiter should be ,
Thus, each line represents an edge. Edges should be sorted in non-decreasing order of their time stamps and the column delimiter should be `,`


## Datasets
Expand Down
4 changes: 2 additions & 2 deletions edgehash.cpp
Expand Up @@ -9,8 +9,8 @@ Edgehash::Edgehash(int r, int b, int m0)
num_rows = r;
num_buckets = b;
m = m0;
hash_a.reserve(r);
hash_b.reserve(r);
hash_a.resize(num_rows);
hash_b.resize(num_rows);
for (int i = 0; i < r; i++) {
// a is in [1, p-1]; b is in [0, p-1]
hash_a[i] = rand() % (num_buckets - 1) + 1;
Expand Down
4 changes: 2 additions & 2 deletions nodehash.cpp
Expand Up @@ -8,8 +8,8 @@ Nodehash::Nodehash(int r, int b)
{
num_rows = r;
num_buckets = b;
hash_a.reserve(r);
hash_b.reserve(r);
hash_a.resize(num_rows);
hash_b.resize(num_rows);
for (int i = 0; i < r; i++) {
// a is in [1, p-1]; b is in [0, p-1]
hash_a[i] = rand() % (num_buckets - 1) + 1;
Expand Down

0 comments on commit 3acb73a

Please sign in to comment.