兼容性问题修复 #9

Closed
wch wants to merge 3 commits from wch into V2
  1. 18
      network_process/interface/fwd_types.hpp
  2. 2
      network_process/src/process.cpp

18
network_process/interface/fwd_types.hpp

@ -227,6 +227,17 @@ struct hash<pod_key_t<N>> {
size_t operator()(const pod_key_t<N>& k) const { return XXH3_64bits(&k, sizeof(pod_key_t<N>)); }
};
template <>
struct hash<compact_bg_mesh_coord_t> {
using argument_type = compact_bg_mesh_coord_t;
using result_type = size_t;
result_type operator()(const argument_type& coord) const noexcept {
// 使用 uint64_t 的哈希算法,将 hashed_value 映射为 size_t
return static_cast<result_type>(std::hash<uint64_t>()(coord.hashed_value));
}
};
template <>
struct equal_to<vertex_header_t> {
bool operator()(const vertex_header_t& v1, const vertex_header_t& v2) const
@ -256,7 +267,12 @@ template <size_t N>
struct equal_to<pod_key_t<N>> {
bool operator()(const pod_key_t<N>& k1, const pod_key_t<N>& k2) const
{
return static_cast<std::array<uint32_t, N>>(k1) == static_cast<std::array<uint32_t, N>>(k2);
std::array<uint32_t, N> a, b;
for (size_t i = 0; i < N; ++i) {
a[i] = static_cast<uint32_t>(k1[i]);
b[i] = static_cast<uint32_t>(k2[i]);
}
return a == b;
}
};
} // namespace std

2
network_process/src/process.cpp

@ -100,7 +100,7 @@ ISNP_API void build_implicit_network_by_blobtree(const s_settings&
if (components.size() == 1) // no nesting problem, each shell is an arrangement cell
{
arrangement_cells.reserve(shells.size());
for (uint32_t i = 0; i < shells.size(); ++i) { arrangement_cells.emplace_back(std::vector{i}); }
for (uint32_t i = 0; i < shells.size(); ++i) { arrangement_cells.emplace_back(stl_vector_mp<uint32_t>{ i }); }
} else {
{
stl_vector_mp<std::pair<uint32_t, uint32_t>> shell_links{};

Loading…
Cancel
Save