Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
javadsaberlatibari authored Mar 15, 2024
1 parent 8379f78 commit 33aaa7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions wellcoordination/benchmark/pnset-crdt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ class PNSet : public ReplicatedObject
if (b==false){
find=false;
for(int i=0; i<arraysizesource; i++){
if(pnsetsource[i][0]==std::atoi(a)){
if(pnsetsource[i][0]==std::stoi(a)){
pnsetsource[i][1]++;
setsizesource++;
find=true;
break;
}
}
if(!find){
pnsetsource[arraysizesource][0]= std::atoi(a);
pnsetsource[arraysizesource][0]= std::stoi(a);
pnsetsource[arraysizesource][1]++;
arraysizesource++;
setsizesource++;
Expand All @@ -101,15 +101,15 @@ class PNSet : public ReplicatedObject
else{
find=false;
for(int i=0; i<arraysizeremote; i++){
if(pnsetremote[i][0]==std::atoi(a)){
if(pnsetremote[i][0]==std::stoi(a)){
pnsetremote[i][1]++;
setsizeremote++;
find=true;
break;
}
}
if(!find){
pnsetremote[arraysizeremote][0]= std::atoi(a);
pnsetremote[arraysizeremote][0]= std::stoi(a);
pnsetremote[arraysizeremote][1]++;
arraysizeremote++;
setsizeremote++;
Expand All @@ -127,15 +127,15 @@ class PNSet : public ReplicatedObject
if (b==false){
find=false;
for(int i=0; i<arraysizesource; i++){
if(pnsetsource[i][0]==std::atoi(a)){
if(pnsetsource[i][0]==std::stoi(a)){
pnsetsource[i][1]--;
setsizesource--;
find=true;
break;
}
}
if(!find){
pnsetsource[arraysizesource][0]= std::atoi(a);
pnsetsource[arraysizesource][0]= std::stoi(a);
pnsetsource[arraysizesource][1]--;
arraysizesource++;
setsizesource--;
Expand All @@ -145,15 +145,15 @@ class PNSet : public ReplicatedObject
else{
find=false;
for(int i=0; i<arraysizeremote; i++){
if(pnsetremote[i][0]==std::atoi(a)){
if(pnsetremote[i][0]==std::stoi(a)){
pnsetremote[i][1]--;
setsizeremote--;
find=true;
break;
}
}
if(!find){
pnsetremote[arraysizeremote][0]= std::atoi(a);
pnsetremote[arraysizeremote][0]= std::stoi(a);
pnsetremote[arraysizeremote][1]--;
arraysizeremote++;
setsizeremote--;
Expand Down
8 changes: 4 additions & 4 deletions wellcoordination/benchmark/pnset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ class PNSet : public ReplicatedObject
lock.store(true);
find=false;
for(int i=0; i<arraysize; i++){
if(pnset[i][0]==std::atoi(a)){
if(pnset[i][0]==std::stoi(a)){
pnset[i][1]++;
setsize++;
find=true;
break;
}
}
if(!find){
pnset[arraysize][0]= std::atoi(a);
pnset[arraysize][0]= std::stoi(a);
pnset[arraysize][1]++;
arraysize++;
setsize++;
Expand All @@ -90,15 +90,15 @@ class PNSet : public ReplicatedObject
lock.store(true);
find=false;
for(int i=0; i<arraysize; i++){
if(pnset[i][0]==std::atoi(a)){
if(pnset[i][0]==std::stoi(a)){
pnset[i][1]--;
setsize--;
find=true;
break;
}
}
if(!find){
pnset[arraysize][0]= std::atoi(a);
pnset[arraysize][0]= std::stoi(a);
pnset[arraysize][1]--;
arraysize++;
setsize--;
Expand Down

0 comments on commit 33aaa7f

Please sign in to comment.