mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Added some missing requires clauses to the max and min functions.
--HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402338
This commit is contained in:
parent
6cd52824f8
commit
69b4407c50
@ -171,6 +171,11 @@ namespace dlib
|
|||||||
const matrix_exp<EXP>& m
|
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;
|
typedef typename matrix_exp<EXP>::type type;
|
||||||
|
|
||||||
type val = m(0,0);
|
type val = m(0,0);
|
||||||
@ -195,6 +200,11 @@ namespace dlib
|
|||||||
const matrix_exp<EXP>& m
|
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;
|
typedef typename matrix_exp<EXP>::type type;
|
||||||
|
|
||||||
type val = m(0,0);
|
type val = m(0,0);
|
||||||
|
@ -682,6 +682,8 @@ namespace dlib
|
|||||||
const matrix_exp& m
|
const matrix_exp& m
|
||||||
);
|
);
|
||||||
/*!
|
/*!
|
||||||
|
requires
|
||||||
|
- m.size() > 0
|
||||||
ensures
|
ensures
|
||||||
- returns the value of the smallest element of m
|
- returns the value of the smallest element of m
|
||||||
!*/
|
!*/
|
||||||
@ -692,6 +694,8 @@ namespace dlib
|
|||||||
const matrix_exp& m
|
const matrix_exp& m
|
||||||
);
|
);
|
||||||
/*!
|
/*!
|
||||||
|
requires
|
||||||
|
- m.size() > 0
|
||||||
ensures
|
ensures
|
||||||
- returns the value of the biggest element of m
|
- returns the value of the biggest element of m
|
||||||
!*/
|
!*/
|
||||||
|
Loading…
Reference in New Issue
Block a user