Adjusted asserts to allow mat() to output empty matrices.

This commit is contained in:
Davis King 2016-06-11 21:15:04 -04:00
parent 443279089f
commit dd8bf7553d
2 changed files with 9 additions and 9 deletions

View File

@ -301,9 +301,9 @@ namespace dlib
long nr
)
{
DLIB_ASSERT(nr > 0 ,
DLIB_ASSERT(nr >= 0 ,
"\tconst matrix_exp mat(ptr, nr)"
<< "\n\t nr must be bigger than 0"
<< "\n\t nr must be >= 0"
<< "\n\t nr: " << nr
);
typedef op_pointer_to_col_vect<T> op;
@ -409,9 +409,9 @@ namespace dlib
long nc
)
{
DLIB_ASSERT(nr > 0 && nc > 0 ,
DLIB_ASSERT(nr >= 0 && nc >= 0 ,
"\tconst matrix_exp mat(ptr, nr, nc)"
<< "\n\t nr and nc must be bigger than 0"
<< "\n\t nr and nc must be >= 0"
<< "\n\t nr: " << nr
<< "\n\t nc: " << nc
);

View File

@ -114,8 +114,8 @@ namespace dlib
);
/*!
requires
- nr > 0
- ptr == a pointer to at least nr T objects
- nr >= 0
- ptr == a pointer to at least nr T objects (or the NULL pointer if nr==0)
ensures
- returns a matrix M such that:
- M.nr() == nr
@ -138,9 +138,9 @@ namespace dlib
);
/*!
requires
- nr > 0
- nc > 0
- ptr == a pointer to at least nr*nc T objects
- nr >= 0
- nc >= 0
- ptr == a pointer to at least nr*nc T objects (or the NULL pointer if nr*nc==0)
ensures
- returns a matrix M such that:
- M.nr() == nr