MCPcopy Create free account
hub / github.com/davisking/dlib / factor_value

Method factor_value

dlib/test/graph_cuts.cpp:839–847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

837 typedef double value_type;
838
839 value_type factor_value(unsigned long idx) const
840 {
841 // Copy idx into a char buffer to avoid warnings about violation of strict aliasing
842 // rules when murmur_hash3() gets inlined into this function.
843 char buf[sizeof(idx)];
844 memcpy(buf,&idx,sizeof(idx));
845 // now hash the buffer rather than idx.
846 return ((double)murmur_hash3(buf, sizeof(buf), seed) - std::numeric_limits<uint32>::max()/2.0)/1000.0;
847 }
848
849 value_type factor_value_disagreement(unsigned long idx1, unsigned long idx2) const
850 {

Callers

nothing calls this directly

Calls 3

murmur_hash3Function · 0.85
memcpyFunction · 0.50
maxFunction · 0.50

Tested by

no test coverage detected