"vscode:/vscode.git/clone" did not exist on "fad836df23ba18a87d95c924326b18b32d60b9ee"
Commit 8e537c97 authored by Davis King's avatar Davis King
Browse files

Made the matrix length() routine work with integer valued matricies when used

in visual studio.
parent 67ac182f
...@@ -230,7 +230,24 @@ namespace dlib ...@@ -230,7 +230,24 @@ namespace dlib
template < template <
typename EXP 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,
"\ttype length(const matrix_exp& m)"
<< "\n\tm must be a row or column vector"
<< "\n\tm.nr(): " << m.nr()
<< "\n\tm.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 const matrix_exp<EXP>& m
) )
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment