Added some missing requires clauses to the max and min functions.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402338
pull/2/head
Davis King 16 years ago
parent 6cd52824f8
commit 69b4407c50

@ -171,6 +171,11 @@ namespace dlib
const matrix_exp<EXP>& m
)
{
DLIB_ASSERT(m.size() > 0,
"\ttype max(const matrix_exp& m)"
<< "\n\tYou can't ask for the max() of an empty matrix"
<< "\n\tm.size(): " << m.size()
);
typedef typename matrix_exp<EXP>::type type;
type val = m(0,0);
@ -195,6 +200,11 @@ namespace dlib
const matrix_exp<EXP>& m
)
{
DLIB_ASSERT(m.size() > 0,
"\ttype min(const matrix_exp& m)"
<< "\n\tYou can't ask for the min() of an empty matrix"
<< "\n\tm.size(): " << m.size()
);
typedef typename matrix_exp<EXP>::type type;
type val = m(0,0);

@ -682,6 +682,8 @@ namespace dlib
const matrix_exp& m
);
/*!
requires
- m.size() > 0
ensures
- returns the value of the smallest element of m
!*/
@ -692,6 +694,8 @@ namespace dlib
const matrix_exp& m
);
/*!
requires
- m.size() > 0
ensures
- returns the value of the biggest element of m
!*/

Loading…
Cancel
Save