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