Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
c9c3fa17
Commit
c9c3fa17
authored
Jun 18, 2015
by
Davis King
Browse files
Made max_cost_assignment() give an error if you incorrectly give it a
non-square matrix.
parent
3286a0a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
tools/python/src/other.cpp
tools/python/src/other.cpp
+3
-0
No files found.
tools/python/src/other.cpp
View file @
c9c3fa17
...
...
@@ -57,6 +57,9 @@ list _max_cost_assignment (
const
matrix
<
double
>&
cost
)
{
if
(
cost
.
nr
()
!=
cost
.
nc
())
throw
dlib
::
error
(
"The input matrix must be square."
);
// max_cost_assignment() only works with integer matrices, so convert from
// double to integer.
const
double
scale
=
(
std
::
numeric_limits
<
dlib
::
int64
>::
max
()
/
1000
)
/
max
(
abs
(
cost
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment