Commit 3dd1af02 authored by Davis King's avatar Davis King

optimized the squared and cubed functions a little

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402455
parent ea6d003c
......@@ -148,7 +148,10 @@ DLIB_MATRIX_SIMPLE_STD_FUNCTION(atan)
typedef typename EXP::type type;
template <typename M>
static type apply ( const M& m, long r, long c)
{ return m(r,c)*m(r,c)*m(r,c); }
{
const type temp = m(r,c);
return temp*temp*temp;
}
};
};
......@@ -173,7 +176,10 @@ DLIB_MATRIX_SIMPLE_STD_FUNCTION(atan)
typedef typename EXP::type type;
template <typename M>
static type apply ( const M& m, long r, long c)
{ return m(r,c)*m(r,c); }
{
const type temp = m(r,c);
return temp*temp;
}
};
};
......
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