MCPcopy Create free account
hub / github.com/comaps/comaps / DecodeZigZagDelta

Function DecodeZigZagDelta

libs/routing/coding.hpp:101–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99// Reverse function for EncodeZigZagDelta.
100template <typename T, typename UnsignedT = std::make_unsigned_t<T>>
101T DecodeZigZagDelta(T prev, UnsignedT delta)
102{
103 static_assert(std::is_integral<T>::value, "T should be an integral type");
104
105 auto decoded = bits::ZigZagDecode(delta);
106 static_assert(std::is_same<decltype(decoded), std::make_signed_t<T>>::value,
107 "It's expected that bits::ZigZagDecode returns SignedT");
108 return prev + static_cast<T>(decoded);
109}
110} // namespace routing

Callers 2

DeserializeWeightsMethod · 0.85
TestZigZagFunction · 0.85

Calls 1

ZigZagDecodeFunction · 0.85

Tested by 1

TestZigZagFunction · 0.68