Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

compilation fixes

  • Loading branch information...
commit 35a9d439362f839d1175dbed7884385c3ea979ab 1 parent a3f9d93
@truncs authored
Showing with 7 additions and 6 deletions.
  1. +6 −5 hw2/h/bfs_queue.cilk
  2. +1 −1  hw2/h/bfs_queue.h
View
11 hw2/h/bfs_queue.cilk
@@ -28,7 +28,7 @@ BfsQueue :: BfsQueue(int procs, int n ) {
void BfsQueue::enque(int i, int value) {
if (i < p) {
- queues[i].push(value);
+ queues[i].push_back(value);
}
}
@@ -42,10 +42,10 @@ void BfsQueue::set_segment_size() {
int BfsQueue :: deque(int p) {
- if (!queues[i].empty()) {
+ if (!queues[p].empty()) {
// Get the vertices from the processor's queue
- int u = queues[i].front();
- queues[i].pop_front();
+ int u = queues[p].front();
+ queues[p].pop_front();
return u;
}
else {
@@ -70,9 +70,10 @@ int BfsQueue :: deque(int p) {
}
return 0;
+ }
}
-int BfsQueue::getSize() {
+ int BfsQueue::getSize() {
int n = 0;
for (int i = 0; i < p; i++) {
View
2  hw2/h/bfs_queue.h
@@ -23,7 +23,7 @@ class BfsQueue {
public:
BfsQueue(int p, int n);
void enque(int i, int value);
- vector<int> * nextSegment(int p);
+ int deque(int p);
void set_segment_size();
int getSize();
};
Please sign in to comment.
Something went wrong with that request. Please try again.