MCPcopy Create free account
hub / github.com/HiLab-git/SimpleCRF / get_l2_distance

Function get_l2_distance

maxflow_python/util.cpp:30–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29template<typename T>
30float get_l2_distance(std::vector<T> p1, std::vector<T> p2)
31{
32 T sq_sum = 0.0;
33 for(int d = 0; d < p1.size(); d++)
34 {
35 sq_sum = sq_sum + (p1[d] - p2[d]) * (p1[d] - p2[d]);
36 }
37 float dis = sqrt(sq_sum);
38 return dis;
39}
40
41template
42float get_pixel<float>(const float * data, int height, int width, int h, int w);

Callers 2

maxflow_inferenceFunction · 0.85
maxflow3d_inferenceFunction · 0.85

Calls 2

sqrtFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected