Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
coordinates.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace storm {
7namespace storage {
8namespace geometry {
9
10template<typename T>
11T squaredEuclideanDistance(std::vector<T> const& p, std::vector<T> const& q) {
12 STORM_LOG_ASSERT(p.size() == q.size(), "Invalid dimensions of input vectors.");
13 T squaredSum = storm::utility::zero<T>();
14 auto pIt = p.begin();
15 auto pItE = p.end();
16 auto qIt = q.begin();
17 for (; pIt != pItE; ++pIt, ++qIt) {
18 T diff = *pIt - *qIt;
19 squaredSum += diff * diff;
20 }
21 return squaredSum;
22}
23
24} // namespace geometry
25} // namespace storage
26} // namespace storm
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
T squaredEuclideanDistance(std::vector< T > const &p, std::vector< T > const &q)
Definition coordinates.h:11