mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Changed how murmur hash was used in find_max_factor_graph_nmplp to avoid a
violation of the strict aliasing rule. This fixes a bug which caused find_max_factor_graph_nmplp() to not work properly on some compilers.
This commit is contained in:
parent
453fee6235
commit
7ae702a49f
@ -40,8 +40,7 @@ namespace dlib
|
||||
- #(*this)(a,b) == value
|
||||
!*/
|
||||
{
|
||||
const unsigned long block[2] = {a,b};
|
||||
const uint32 h = murmur_hash3(&block[0], sizeof(block))%(data.size()-scan_dist);
|
||||
const uint32 h = murmur_hash3_2(a,b)%(data.size()-scan_dist);
|
||||
|
||||
const unsigned long empty_bucket = std::numeric_limits<unsigned long>::max();
|
||||
|
||||
@ -85,8 +84,7 @@ namespace dlib
|
||||
DLIB_ASSERT(a != b, "An invalid map_problem was given to find_max_factor_graph_nmplp()."
|
||||
<< "\nNode " << a << " is listed as being a neighbor with itself, which is illegal.");
|
||||
|
||||
const unsigned long block[2] = {a,b};
|
||||
uint32 h = murmur_hash3(&block[0], sizeof(block))%(data.size()-scan_dist);
|
||||
uint32 h = murmur_hash3_2(a,b)%(data.size()-scan_dist);
|
||||
|
||||
|
||||
for (unsigned long i = 0; i < scan_dist; ++i)
|
||||
|
Loading…
Reference in New Issue
Block a user