Commit 8e537c97 authored by Davis King's avatar Davis King

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

in visual studio.
parent 67ac182f
......@@ -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,
"\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
)
{
......@@ -242,7 +259,7 @@ namespace dlib
);
return std::sqrt(sum(squared(m)));
}
// ----------------------------------------------------------------------------------------
template <
......
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