Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
8e537c97
Commit
8e537c97
authored
Sep 03, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the matrix length() routine work with integer valued matricies when used
in visual studio.
parent
67ac182f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
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
)
{
...
...
@@ -242,7 +259,7 @@ namespace dlib
);
return
std
::
sqrt
(
sum
(
squared
(
m
)));
}
// ----------------------------------------------------------------------------------------
template
<
...
...
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