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

Function dist

dlib/test/kcentroid.cpp:90–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89 template <typename K>
90 double dist (
91 const K& k,
92 const matrix<double,4,1>& a,
93 const matrix<double,5,1>& b
94 )
95 /*!
96 ensures
97 - returns the distance between the a and b vectors in the
98 feature space defined by the given kernel k.
99 !*/
100 {
101 const double bias = std::sqrt(k.offset);
102 return std::sqrt(length_squared(a-colm(b,0,4)) + std::pow(b(4)-bias,2.0));
103
104 }
105
106 template <typename K>
107 double dist (

Calls 3

sqrtFunction · 0.50
length_squaredFunction · 0.50
colmFunction · 0.50

Tested by

no test coverage detected