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
1 change: 1 addition & 0 deletions examples/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "munkres.h"
#include "adapters/boostmatrixadapter.h"

using namespace MunkresCpp;
int
main(int argc, char *argv[]) {
int nrows = 101;
Expand Down
3 changes: 3 additions & 0 deletions src/adapters/adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "matrix.h"
#include "munkres.h"

namespace MunkresCpp {

template<typename Data, class Container > class Adapter
{
public:
Expand All @@ -36,5 +38,6 @@ template<typename Data, class Container > class Adapter
protected:
Munkres<Data> m_munkres;
};
}

#endif /* _ADAPTER_H_ */
3 changes: 2 additions & 1 deletion src/adapters/boostmatrixadapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "adapter.h"
#include <boost/numeric/ublas/matrix.hpp>
namespace MunkresCpp {

template<typename Data> class BoostMatrixAdapter : public Adapter<Data,boost::numeric::ublas::matrix<Data> >
{
Expand Down Expand Up @@ -49,5 +50,5 @@ template<typename Data> class BoostMatrixAdapter : public Adapter<Data,boost::nu
}
}
};

}
#endif /* _BOOSTMATRIXADAPTER_H_ */
3 changes: 2 additions & 1 deletion src/adapters/std2darrayadapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define STD2DARRAYADAPTER_H

#include "adapter.h"
namespace MunkresCpp {

template<typename Data, size_t rows, size_t columns> class Std2dArrayAdapter : public Adapter<Data, std::array <std::array <Data, columns>, rows>>
{
Expand Down Expand Up @@ -48,5 +49,5 @@ template<typename Data, size_t rows, size_t columns> class Std2dArrayAdapter : p
}
}
};

}
#endif // STD2DARRAYADAPTER_H
1 change: 1 addition & 0 deletions src/adapters/std2dvectordapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "std2dvectordapter.h"

using namespace MunkresCpp;
template class Std2dVectorAdapter<double>;
template class Std2dVectorAdapter<float>;
template class Std2dVectorAdapter<int>;
2 changes: 2 additions & 0 deletions src/adapters/std2dvectordapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define RAW2DARRAY_H

#include "adapter.h"
namespace MunkresCpp {

template<typename Data> class Std2dVectorAdapter : public Adapter<Data,std::vector<std::vector <Data>>>
{
Expand Down Expand Up @@ -57,5 +58,6 @@ template<typename Data> class Std2dVectorAdapter : public Adapter<Data,std::vect
}
}
};
}

#endif // RAW2DARRAY_H
3 changes: 2 additions & 1 deletion src/matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <cassert>
#include <cstdlib>
#include <algorithm>
using namespace MunkresCpp;

/*export*/ template <class T>
Matrix<T>::Matrix() {
Expand Down Expand Up @@ -234,4 +235,4 @@ Matrix<T>::max() const {
}

return max;
}
}
3 changes: 2 additions & 1 deletion src/matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <cstdlib>
#include <ostream>

namespace MunkresCpp {
template <class T>
class Matrix {
public:
Expand Down Expand Up @@ -63,7 +64,7 @@ class Matrix {
size_t m_rows;
size_t m_columns;
};

}
#ifndef USE_EXPORT_KEYWORD
#include "matrix.cpp"
//#define export /*export*/
Expand Down
1 change: 1 addition & 0 deletions src/munkres.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "munkres.h"

using namespace MunkresCpp;
template class Munkres<double>;
template class Munkres<float>;
template class Munkres<int>;
Expand Down
4 changes: 3 additions & 1 deletion src/munkres.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <cmath>
#include <limits>

namespace MunkresCpp {

template<typename Data> class Munkres
{
static constexpr int NORMAL = 0;
Expand Down Expand Up @@ -460,5 +462,5 @@ template<typename Data> class Munkres
size_t saverow = 0, savecol = 0;
};


}
#endif /* !defined(_MUNKRES_H_) */
1 change: 1 addition & 0 deletions tests/adapters/boost_matrixtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <iostream>
#include <iomanip>

using namespace MunkresCpp;


class Adapters_boost_matrix_Test : public ::testing::Test
Expand Down
1 change: 1 addition & 0 deletions tests/adapters/std_2d_arraytest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <iomanip>


using namespace MunkresCpp;

class Adapters_std_2d_array_Test : public ::testing::Test
{
Expand Down
1 change: 1 addition & 0 deletions tests/adapters/std_2d_vectortest.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <gtest/gtest.h>
#include "adapters/std2dvectordapter.h"

using namespace MunkresCpp;


class Adapters_std_2d_vector_Test : public ::testing::Test
Expand Down
1 change: 1 addition & 0 deletions tests/matrixtest.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "matrix.h"
#include <iostream>
using namespace MunkresCpp;

template <class T>
bool operator == (const Matrix <T> & a, const Matrix <T> & b)
Expand Down