First compiling version of map_match plugin

This commit is contained in:
Patrick Niklaus
2016-02-21 04:27:26 +01:00
parent 1cc7d3ddfb
commit 9d10490613
19 changed files with 587 additions and 457 deletions
+11 -11
View File
@@ -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; }
+1 -4
View File
@@ -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]);
}
}
}