Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoern-andres committed Nov 16, 2015
1 parent faaabd7 commit 6095cb0
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions include/andres/graph/fast-marching.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
namespace andres {
namespace graph {

/// \cond SUPPRESS DOXYGEN
namespace detail {

template<typename T, typename Enable = void>
struct my_make_signed {
typedef typename std::make_signed<T>::type type;
};

template<typename T>
struct my_make_signed<T,
typename std::enable_if<std::is_floating_point<T>::value>::type> {
typedef T type;
};

}
/// \endcond

template<class T = double, class S = std::size_t>
class FastMarchingBuffers {
public:
Expand All @@ -29,18 +46,7 @@ public:
std::vector<value_type> distances_;
};

template<typename T, typename Enable = void>
struct my_make_signed {
typedef typename std::make_signed<T>::type type;
};

template<typename T>
struct my_make_signed<T,
typename std::enable_if<std::is_floating_point<T>::value>::type> {
typedef T type;
};

/// Fast Marching for (a subgraph of) a 2-dimensional grid graph.
/// Fast Marching Algorithm for (a subgraph of) a 2-dimensional grid graph.
///
/// Implementation by Margret Keuper <[email protected]>
/// of the algorithm defined in:
Expand Down Expand Up @@ -97,7 +103,7 @@ fastMarching(
typedef typename InputGraph::AdjacencyType Adjacency;
typedef typename InputGraph::EdgeCoordinate EdgeCoordinate;
typedef typename std::iterator_traits<TARGET_EDGE_VALUE_ITERATOR>::value_type Value;
typedef typename my_make_signed<Value>::type signedValue;
typedef typename detail::my_make_signed<Value>::type signedValue;
if(interpolationOrder < 0 || interpolationOrder > 1) {
throw std::runtime_error("specified interpolation order not implemented.");
}
Expand Down

0 comments on commit 6095cb0

Please sign in to comment.