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

Function _max_cost_assignment

tools/python/src/other.cpp:57–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55// ----------------------------------------------------------------------------------------
56
57py::list _max_cost_assignment (
58 const matrix<double>& cost
59)
60{
61 if (cost.nr() != cost.nc())
62 throw dlib::error("The input matrix must be square.");
63
64 // max_cost_assignment() only works with integer matrices, so convert from
65 // double to integer.
66 const double scale = (std::numeric_limits<dlib::int64>::max()/1000)/max(abs(cost));
67 matrix<dlib::int64> int_cost = matrix_cast<dlib::int64>(round(cost*scale));
68 return vector_to_python_list(max_cost_assignment(int_cost));
69}
70
71double _assignment_cost (
72 const matrix<double>& cost,

Callers

nothing calls this directly

Calls 8

errorClass · 0.85
absFunction · 0.85
roundFunction · 0.85
vector_to_python_listFunction · 0.85
max_cost_assignmentFunction · 0.85
maxFunction · 0.50
nrMethod · 0.45
ncMethod · 0.45

Tested by

no test coverage detected