diff --git a/src/storm/storage/geometry/coordinates.h b/src/storm/storage/geometry/coordinates.h new file mode 100644 index 000000000..f2795440f --- /dev/null +++ b/src/storm/storage/geometry/coordinates.h @@ -0,0 +1,24 @@ +#include "storm/utility/constants.h" +#include "storm/utility/macros.h" + +namespace storm { + namespace storage { + namespace geometry { + + template + T euclideanDistance(std::vector const& p, std::vector const& q) { + STORM_LOG_ASSERT(p.size() == q.size(), "Invalid dimensions of input vectors."); + T squaredSum = storm::utility::zero(); + auto pIt = p.begin(); + auto pItE = p.end(); + auto qIt = q.begin(); + for (; pIt != pItE; ++pIt, ++qIt) { + T diff = *pIt - *qIt; + squaredSum += diff * diff; + } + return storm::utility::sqrt(squaredSum); + } + + } + } +} \ No newline at end of file