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

Function length_squared

dlib/svm/sparse_vector.h:376–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374
375 template <typename T>
376 typename T::value_type::second_type length_squared (
377 const T& a
378 )
379 {
380 typedef typename T::value_type::second_type scalar_type;
381
382 typename T::const_iterator i;
383
384 scalar_type sum = 0;
385
386 for (i = a.begin(); i != a.end(); ++i)
387 {
388 sum += i->second * i->second;
389 }
390
391 return sum;
392 }
393
394// ------------------------------------------------------------------------------------
395

Callers 15

nearest_centerFunction · 0.70
initMethod · 0.70
sort_basis_vectors_implFunction · 0.70
operator()Method · 0.70
squared_normMethod · 0.70
squared_normMethod · 0.70
operator()Method · 0.70
lengthFunction · 0.70
pick_initial_vectorMethod · 0.70
compute_initial_alphaMethod · 0.70
do_trainMethod · 0.70

Calls 2

beginMethod · 0.45
endMethod · 0.45