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
3
#include "
storm/utility/constants.h
"
4
#include "
storm/utility/macros.h
"
5
6
namespace
storm
{
7
namespace
storage {
8
namespace
geometry {
9
10
template
<
typename
T>
11
T
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
constants.h
macros.h
STORM_LOG_ASSERT
#define STORM_LOG_ASSERT(cond, message)
Definition
macros.h:11
storm::storage::geometry::squaredEuclideanDistance
T squaredEuclideanDistance(std::vector< T > const &p, std::vector< T > const &q)
Definition
coordinates.h:11
storm
Definition
AutomaticSettings.cpp:13
src
storm
storage
geometry
coordinates.h
Generated by
1.9.8