Skip to content

Commit

Permalink
changed formatting to match with the current version
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianMenzelSAP committed Jan 22, 2024
1 parent bf5a937 commit 9349789
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions benchmark/single/benchmark_numbers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ void Generator_sorted_end (size_t n_last)
void Generator_sorted_middle (size_t n_last)
{
vector<uint64_t> A, B, C;
A.reserve(NELEM);
A.clear();
if (fill_vector_uint64("input.bin", A, NELEM + n_last) != 0)
A.reserve (NELEM);
A.clear ();
if (fill_vector_uint64 ("input.bin", A, NELEM + n_last) != 0)
{
std::cout << "Error in the input file\n";
return;
Expand All @@ -186,20 +186,20 @@ void Generator_sorted_middle (size_t n_last)
B.push_back(std::move(A[i]));
A.resize(NELEM);

std::sort(A.begin(), A.end());
std::sort (A.begin (), A.end ());
size_t step = NELEM / n_last;
size_t pos = 0;

for (size_t i = 0; i < B.size(); ++i, pos += step)
for (size_t i = 0; i < B.size (); ++i, pos += step)
{
C.push_back(B[i]);
C.push_back (B[i]);
for (size_t k = 0; k < step; ++k)
C.push_back(A.at(pos + k));
C.push_back (A.at(pos + k));
};
while (pos < A.size())
C.push_back(A[pos++]);
while (pos < A.size ())
C.push_back (A[pos++]);
A = C;
Test<uint64_t, std::less<uint64_t>>(A);
Test<uint64_t, std::less<uint64_t>> (A);
}
;
void Generator_reverse_sorted (void)
Expand Down Expand Up @@ -231,33 +231,33 @@ void Generator_reverse_sorted_end (size_t n_last)
void Generator_reverse_sorted_middle (size_t n_last)
{
vector<uint64_t> A, B, C;
A.reserve(NELEM);
A.clear();
if (fill_vector_uint64("input.bin", A, NELEM + n_last) != 0)
A.reserve (NELEM);
A.clear ();
if (fill_vector_uint64 ("input.bin", A, NELEM + n_last) != 0)
{
std::cout << "Error in the input file\n";
return;
};
for (size_t i = NELEM; i < A.size(); ++i)
B.push_back(std::move(A[i]));
A.resize(NELEM);
for (size_t i = NELEM; i < A.size (); ++i)
B.push_back (std::move(A[i]));
A.resize ( NELEM);

std::sort(A.begin(), A.end());
std::sort (A.begin (), A.end ());
size_t step = NELEM / n_last;
size_t pos = 0;
for (size_t i = 0; i < (NELEM >> 1); ++i)
std::swap(A[i], A[NELEM - 1 - i]);

for (size_t i = 0; i < B.size(); ++i, pos += step)
for (size_t i = 0; i < B.size (); ++i, pos += step)
{
C.push_back(B[i]);
C.push_back (B[i]);
for (size_t k = 0; k < step; ++k)
C.push_back(A.at(pos + k));
C.push_back (A.at(pos + k));
};
while (pos < A.size())
C.push_back(A[pos++]);
while (pos < A.size ())
C.push_back (A[pos++]);
A = C;
Test<uint64_t, std::less<uint64_t>>(A);
Test<uint64_t, std::less<uint64_t>> (A);
};


Expand Down

0 comments on commit 9349789

Please sign in to comment.