Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
coordinates.h
Go to the documentation of this file.
1
#include "
storm/utility/constants.h
"
2
#include "
storm/utility/macros.h
"
3
4
namespace
storm
{
5
namespace
storage {
6
namespace
geometry {
7
8
template
<
typename
T>
9
T
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
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:9
storm
LabParser.cpp.
Definition
cli.cpp:18
src
storm
storage
geometry
coordinates.h
Generated by
1.9.8