31 void compare_cand(
int *cand_n,
int *cand_e,
int ii_stok,
int *cand_n_ref,
int *cand_e_ref,
int ii_stok_ref)
33 std::vector<std::pair<int, int>> candidates, candidates_ref;
34 for (
int i = 0; i < ii_stok; ++i)
36 candidates.emplace_back(cand_n[i], cand_e[i]);
38 for (
int i = 0; i < ii_stok_ref; ++i)
40 candidates_ref.emplace_back(cand_n_ref[i], cand_e_ref[i]);
43 std::sort(candidates.begin(), candidates.end());
44 std::sort(candidates_ref.begin(), candidates_ref.end());
48 while (i < ii_stok && j < ii_stok_ref)
50 if (candidates[i] == candidates_ref[j])
56 else if (candidates[i] < candidates_ref[j])
65 std::cout <<
"number of candidates: " << ii_stok <<
"(ref: "<<ii_stok_ref<<
")\n";
66 if (num_matches == ii_stok_ref)
68 std::cout <<
"Success: All candidates_ref are found in candidates.\n";
72 std::cout <<
"Failure: Not all candidates_ref are found in candidates.\n";
void compare_cand(int *cand_n, int *cand_e, int ii_stok, int *cand_n_ref, int *cand_e_ref, int ii_stok_ref)