diff --git a/examples/main.cpp b/examples/main.cpp index e7a90b3..ce10f63 100644 --- a/examples/main.cpp +++ b/examples/main.cpp @@ -28,6 +28,7 @@ #include "munkres.h" #include "adapters/boostmatrixadapter.h" +using namespace MunkresCpp; int main(int argc, char *argv[]) { int nrows = 101; diff --git a/src/adapters/adapter.h b/src/adapters/adapter.h index 818a62c..ae4a7d8 100644 --- a/src/adapters/adapter.h +++ b/src/adapters/adapter.h @@ -22,6 +22,8 @@ #include "matrix.h" #include "munkres.h" +namespace MunkresCpp { + template class Adapter { public: @@ -36,5 +38,6 @@ template class Adapter protected: Munkres m_munkres; }; +} #endif /* _ADAPTER_H_ */ diff --git a/src/adapters/boostmatrixadapter.h b/src/adapters/boostmatrixadapter.h index 8ebe8b1..4d44f27 100644 --- a/src/adapters/boostmatrixadapter.h +++ b/src/adapters/boostmatrixadapter.h @@ -21,6 +21,7 @@ #include "adapter.h" #include +namespace MunkresCpp { template class BoostMatrixAdapter : public Adapter > { @@ -49,5 +50,5 @@ template class BoostMatrixAdapter : public Adapter class Std2dArrayAdapter : public Adapter, rows>> { @@ -48,5 +49,5 @@ template class Std2dArrayAdapter : p } } }; - +} #endif // STD2DARRAYADAPTER_H diff --git a/src/adapters/std2dvectordapter.cpp b/src/adapters/std2dvectordapter.cpp index 4dc55ae..94bb200 100644 --- a/src/adapters/std2dvectordapter.cpp +++ b/src/adapters/std2dvectordapter.cpp @@ -18,6 +18,7 @@ #include "std2dvectordapter.h" +using namespace MunkresCpp; template class Std2dVectorAdapter; template class Std2dVectorAdapter; template class Std2dVectorAdapter; diff --git a/src/adapters/std2dvectordapter.h b/src/adapters/std2dvectordapter.h index 5b81704..b2c815a 100644 --- a/src/adapters/std2dvectordapter.h +++ b/src/adapters/std2dvectordapter.h @@ -20,6 +20,7 @@ #define RAW2DARRAY_H #include "adapter.h" +namespace MunkresCpp { template class Std2dVectorAdapter : public Adapter>> { @@ -57,5 +58,6 @@ template class Std2dVectorAdapter : public Adapter #include #include +using namespace MunkresCpp; /*export*/ template Matrix::Matrix() { @@ -234,4 +235,4 @@ Matrix::max() const { } return max; -} +} \ No newline at end of file diff --git a/src/matrix.h b/src/matrix.h index 4be2a35..e5c973c 100644 --- a/src/matrix.h +++ b/src/matrix.h @@ -23,6 +23,7 @@ #include #include +namespace MunkresCpp { template class Matrix { public: @@ -63,7 +64,7 @@ class Matrix { size_t m_rows; size_t m_columns; }; - +} #ifndef USE_EXPORT_KEYWORD #include "matrix.cpp" //#define export /*export*/ diff --git a/src/munkres.cpp b/src/munkres.cpp index fdd1b55..9e7e0e0 100644 --- a/src/munkres.cpp +++ b/src/munkres.cpp @@ -19,6 +19,7 @@ #include "munkres.h" +using namespace MunkresCpp; template class Munkres; template class Munkres; template class Munkres; diff --git a/src/munkres.h b/src/munkres.h index 02f558a..9dc0988 100644 --- a/src/munkres.h +++ b/src/munkres.h @@ -28,6 +28,8 @@ #include #include +namespace MunkresCpp { + template class Munkres { static constexpr int NORMAL = 0; @@ -460,5 +462,5 @@ template class Munkres size_t saverow = 0, savecol = 0; }; - +} #endif /* !defined(_MUNKRES_H_) */ diff --git a/tests/adapters/boost_matrixtest.cpp b/tests/adapters/boost_matrixtest.cpp index 7fcfd97..415d609 100644 --- a/tests/adapters/boost_matrixtest.cpp +++ b/tests/adapters/boost_matrixtest.cpp @@ -3,6 +3,7 @@ #include #include +using namespace MunkresCpp; class Adapters_boost_matrix_Test : public ::testing::Test diff --git a/tests/adapters/std_2d_arraytest.cpp b/tests/adapters/std_2d_arraytest.cpp index d3cf118..5c63742 100644 --- a/tests/adapters/std_2d_arraytest.cpp +++ b/tests/adapters/std_2d_arraytest.cpp @@ -4,6 +4,7 @@ #include +using namespace MunkresCpp; class Adapters_std_2d_array_Test : public ::testing::Test { diff --git a/tests/adapters/std_2d_vectortest.cpp b/tests/adapters/std_2d_vectortest.cpp index 3e01034..4653e13 100644 --- a/tests/adapters/std_2d_vectortest.cpp +++ b/tests/adapters/std_2d_vectortest.cpp @@ -1,6 +1,7 @@ #include #include "adapters/std2dvectordapter.h" +using namespace MunkresCpp; class Adapters_std_2d_vector_Test : public ::testing::Test diff --git a/tests/matrixtest.h b/tests/matrixtest.h index 645dc49..e283207 100644 --- a/tests/matrixtest.h +++ b/tests/matrixtest.h @@ -21,6 +21,7 @@ #include "matrix.h" #include +using namespace MunkresCpp; template bool operator == (const Matrix & a, const Matrix & b)