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

Function normalize_inplace

dlib/svm/sparse_vector.h:430–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428
429 template <typename T>
430 typename disable_if<is_matrix<T>,void>::type normalize_inplace (
431 T& a
432 )
433 {
434 const auto len = length(a);
435 if (len != 0)
436 {
437 for (auto& entry : a)
438 entry.second /= len;
439 }
440 }
441
442 template <typename T>
443 typename enable_if<is_matrix<T>,void>::type normalize_inplace (

Callers 3

operator()Method · 0.85
test_normalizeFunction · 0.85
normalizeFunction · 0.85

Calls 2

lengthFunction · 0.70
normalizeFunction · 0.70

Tested by 1

test_normalizeFunction · 0.68