Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.o
Release/BMatchingSolver
Release/src/*.d
Shared\ Library/src/*.d
Shared\ Library/libBMatchingSolver.*
2 changes: 1 addition & 1 deletion Shared Library/objects.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

USER_OBJS :=

LIBS :=
LIBS := -lm -lpthread

1 change: 1 addition & 0 deletions src/BMatchingSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
#include "BMatchingLibrary.h"
#include "utils.h"
#include "SparseMatrix.h"
Expand Down
1 change: 1 addition & 0 deletions src/BeliefPropagator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <math.h>
#include <time.h>
#include <pthread.h>
#include <string.h>
#include "BeliefPropagator.h"
#include "BMatchingSolution.h"
using namespace std;
Expand Down
11 changes: 6 additions & 5 deletions src/BipartiteFunctionOracle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BipartiteFunctionOracle::BipartiteFunctionOracle(double **dataX, double **dataY,
rows = r;
cols = c;
dimension = d;
setCacheSize(max(rows, cols));
setCacheSize(std::max(rows, cols));
}

BipartiteFunctionOracle::~BipartiteFunctionOracle() {
Expand All @@ -27,12 +27,13 @@ int BipartiteFunctionOracle::getSize() {
}

double BipartiteFunctionOracle::computeWeight(int row, int col) {
if (row < rows && col < rows ||
row >= rows && col >= rows ||
row - rows >= cols || col - rows >= cols) {
if ((row < rows && col < rows) ||
(row >= rows && col >= rows) ||
row - rows >= cols || col - rows >= cols) {
return -INFINITY;
} else if (row < rows)
} else if (row < rows) {
return weightFunction->getWeight(X[row], Y[col - rows], dimension);
}
return weightFunction->getWeight(X[col], Y[row-rows], dimension);
}

9 changes: 5 additions & 4 deletions src/BipartiteMatrixOracle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ int BipartiteMatrixOracle::getSize() {
}

double BipartiteMatrixOracle::computeWeight(int row, int col) {
if (row < rows && col < rows ||
row >= rows && col >= rows ||
row - rows >= cols || col - rows >= cols)
if ((row < rows && col < rows) ||
(row >= rows && col >= rows) ||
row - rows >= cols || col - rows >= cols) {
return -INFINITY;
else if (row < rows)
}else if (row < rows) {
return K[row][col - rows];
}
return K[col][row - rows];
}

Expand Down
2 changes: 0 additions & 2 deletions src/BipartiteMatrixOracle.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class BipartiteMatrixOracle: public WeightOracle {
int rows;
int cols;
double **K;
int **index;
double **cache;
};

#endif /* KERNELMATRIXORACLE_H_ */
3 changes: 1 addition & 2 deletions src/FunctionOracle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ FunctionOracle::~FunctionOracle() {
}

double FunctionOracle::computeWeight(int row, int col) {
if (!selfLoops && row == col ||
row >= size || col >= size)
if ((!selfLoops && row == col) || row >= size || col >= size)
return -INFINITY;
return weightFunction->getWeight(data[row], data[col], dimension);
}
Expand Down
2 changes: 0 additions & 2 deletions src/IntDoubleMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ class IntDoubleMap {
double * value;
bool * filled;
int size;
int lastIndex;
int tableSize;
int maxSize;
double hits;
double misses;

Expand Down
1 change: 1 addition & 0 deletions src/IntSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "IntSet.h"
#include <iostream>
#include <string.h>
using namespace std;

IntSet::IntSet() {
Expand Down
3 changes: 1 addition & 2 deletions src/MatrixOracle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ int MatrixOracle::getSize() {
}

double MatrixOracle::computeWeight(int row, int col) {
if (!selfLoops && row == col ||
row >= size || col >= size)
if ((!selfLoops && row == col) || row >= size || col >= size)
return -INFINITY;
return weights[row][col];
}
Expand Down
1 change: 1 addition & 0 deletions src/OscillationDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include <math.h>
#include <string.h>
#include <iostream>
#include "OscillationDetector.h"

Expand Down
2 changes: 0 additions & 2 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#ifndef UTILS_H_
#define UTILS_H_

using namespace std;

namespace utils {

// Takes a file and reads the input as a matrix of values
Expand Down