First compiling version of map_match plugin
This commit is contained in:
+11
-11
@@ -13,7 +13,6 @@ namespace util
|
||||
{
|
||||
namespace json
|
||||
{
|
||||
|
||||
// Make sure we don't have inf and NaN values
|
||||
template <typename T> T clamp_float(T d)
|
||||
{
|
||||
@@ -47,16 +46,17 @@ template <typename T> Array make_array(const std::vector<T> &vector)
|
||||
return a;
|
||||
}
|
||||
|
||||
// template specialization needed as clang does not play nice
|
||||
template <> Array make_array(const std::vector<bool> &vector)
|
||||
{
|
||||
Array a;
|
||||
for (const bool v : vector)
|
||||
{
|
||||
a.values.emplace_back(v);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
//// template specialization needed as clang does not play nice
|
||||
//// FIXME this now causes compile errors on g++ -_-
|
||||
//template <> Array make_array(const std::vector<bool> &vector)
|
||||
//{
|
||||
// Array a;
|
||||
// for (const bool v : vector)
|
||||
// {
|
||||
// a.values.emplace_back(v);
|
||||
// }
|
||||
// return a;
|
||||
//}
|
||||
|
||||
// Easy acces to object hierachies
|
||||
inline Value &get(Value &value) { return value; }
|
||||
|
||||
@@ -81,8 +81,7 @@ struct MatchingDebugInfo
|
||||
}
|
||||
|
||||
void set_viterbi(const std::vector<std::vector<double>> &viterbi,
|
||||
const std::vector<std::vector<bool>> &pruned,
|
||||
const std::vector<std::vector<bool>> &suspicious)
|
||||
const std::vector<std::vector<bool>> &pruned)
|
||||
{
|
||||
// json logger not enabled
|
||||
if (!logger)
|
||||
@@ -98,8 +97,6 @@ struct MatchingDebugInfo
|
||||
json::clamp_float(viterbi[t][s_prime]);
|
||||
json::get(*object, "states", t, s_prime, "pruned") =
|
||||
static_cast<unsigned>(pruned[t][s_prime]);
|
||||
json::get(*object, "states", t, s_prime, "suspicious") =
|
||||
static_cast<unsigned>(suspicious[t][s_prime]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user