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
8e537c97
Commit
8e537c97
authored
Sep 03, 2012
by
Davis King
Browse files
Made the matrix length() routine work with integer valued matricies when used
in visual studio.
parent
67ac182f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
dlib/matrix/matrix_utilities.h
dlib/matrix/matrix_utilities.h
+19
-2
No files found.
dlib/matrix/matrix_utilities.h
View file @
8e537c97
...
...
@@ -230,7 +230,24 @@ namespace dlib
template
<
typename
EXP
>
const
typename
matrix_exp
<
EXP
>::
type
length
(
typename
enable_if_c
<
std
::
numeric_limits
<
typename
EXP
::
type
>::
is_integer
,
double
>::
type
length
(
const
matrix_exp
<
EXP
>&
m
)
{
DLIB_ASSERT
(
is_vector
(
m
)
==
true
,
"
\t
type length(const matrix_exp& m)"
<<
"
\n\t
m must be a row or column vector"
<<
"
\n\t
m.nr(): "
<<
m
.
nr
()
<<
"
\n\t
m.nc(): "
<<
m
.
nc
()
);
return
std
::
sqrt
(
static_cast
<
double
>
(
sum
(
squared
(
m
))));
}
template
<
typename
EXP
>
typename
disable_if_c
<
std
::
numeric_limits
<
typename
EXP
::
type
>::
is_integer
,
const
typename
EXP
::
type
>::
type
length
(
const
matrix_exp
<
EXP
>&
m
)
{
...
...
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