Skip to content

Commit

Permalink
Fix bug in rusty code, rename "aux" directory so Windows can handle it.
Browse files Browse the repository at this point in the history
  • Loading branch information
kristomu committed Sep 5, 2024
1 parent 4e9e525 commit 35b6f10
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ add_library(qe_multiwinner_methods
src/multiwinner/qrange_stv.cc
src/multiwinner/randballots.cc
src/multiwinner/range_stv.cc
src/multiwinner/rusty/aux/dsc.cc
src/multiwinner/rusty/auxiliary/dsc.cc
src/multiwinner/shuntsstv.cc
src/multiwinner/stv.cc
src/stats/multiwinner/mwstats.cc
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ int get_clustering_error(const vector<vector<int> > & penalties,

sort(queue.begin(), queue.end(), sorting);

for (counter = penalties.size() - 1; counter >= 0; --counter) {
for (size_t idx = 0; idx < penalties.size(); ++idx) {
// We want to count backwards. Why not put this in the for loop?
// Because then the end condition would be "counter >= 0" which
// is always true!
counter = penalties.size() - 1 - idx;

// If any are now above the threshold, mark them as full
// and redo sort based on this.

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/multiwinner/rusty/fc_kemeny.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

// Ranks are struct vectors of ints, easier that way.

#include "aux/greedy_cluster.h"
#include "aux/assignment.h"
#include "auxiliary/greedy_cluster.h"
#include "auxiliary/assignment.h"
#include "multiwinner/methods.h"
#include "tools/ballot_tools.h"

#include "aux/qballot.h"
#include "auxiliary/qballot.h"

#include <iostream>
#include <iterator>
Expand Down
2 changes: 1 addition & 1 deletion src/multiwinner/rusty/mono_webst_640.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <math.h>
#include <assert.h>

#include "aux/dsc.h"
#include "auxiliary/dsc.h"
#include "multiwinner/methods.h"
#include "tools/ballot_tools.h"
#include "setwise/coalition.h"
Expand Down
2 changes: 1 addition & 1 deletion src/multiwinner/rusty/mono_webst_c37.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <math.h>
#include <assert.h>

#include "aux/dsc.h"
#include "auxiliary/dsc.h"
#include "multiwinner/methods.h"
#include "tools/ballot_tools.h"
#include "setwise/coalition.h"
Expand Down
2 changes: 1 addition & 1 deletion src/multiwinner/rusty/mono_webst_f03.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <math.h>
#include <assert.h>

#include "aux/dsc.h"
#include "auxiliary/dsc.h"
#include "multiwinner/methods.h"
#include "tools/ballot_tools.h"
#include "setwise/coalition.h"
Expand Down
2 changes: 1 addition & 1 deletion src/multiwinner/rusty/mw_kemeny2_34e.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <numeric>
#include <vector>

#include "aux/qballot.h"
#include "auxiliary/qballot.h"

using namespace std;

Expand Down
2 changes: 1 addition & 1 deletion src/multiwinner/rusty/mw_kemeny_db0.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include "multiwinner/methods.h"
#include "tools/ballot_tools.h"
#include "aux/qballot.h"
#include "auxiliary/qballot.h"

#include <iostream>
#include <iterator>
Expand Down
2 changes: 1 addition & 1 deletion src/multiwinner/rusty/set_functs.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <math.h>
#include <assert.h>

#include "aux/dsc.h"
#include "auxiliary/dsc.h"
#include "multiwinner/methods.h"
#include "tools/ballot_tools.h"
#include "multiwinner/rusty/setwise/coalition.h"
Expand Down
2 changes: 1 addition & 1 deletion src/multiwinner/rusty/setwise/coalition.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class sorted_reference {
// I.e. count AB|, C|, AC|, then later complete these in one swoop each... Hm.
// DSC doesn't have to deal with that.

struct simple_hash : unary_function<vector<bool>, size_t> {
struct simple_hash {

size_t operator()(const vector<bool> & a) const {

Expand Down

0 comments on commit 35b6f10

Please sign in to comment.