Commit dd8bf755 authored by Davis King's avatar Davis King

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

parent 44327908
...@@ -301,9 +301,9 @@ namespace dlib ...@@ -301,9 +301,9 @@ namespace dlib
long nr long nr
) )
{ {
DLIB_ASSERT(nr > 0 , DLIB_ASSERT(nr >= 0 ,
"\tconst matrix_exp mat(ptr, nr)" "\tconst matrix_exp mat(ptr, nr)"
<< "\n\t nr must be bigger than 0" << "\n\t nr must be >= 0"
<< "\n\t nr: " << nr << "\n\t nr: " << nr
); );
typedef op_pointer_to_col_vect<T> op; typedef op_pointer_to_col_vect<T> op;
...@@ -409,9 +409,9 @@ namespace dlib ...@@ -409,9 +409,9 @@ namespace dlib
long nc long nc
) )
{ {
DLIB_ASSERT(nr > 0 && nc > 0 , DLIB_ASSERT(nr >= 0 && nc >= 0 ,
"\tconst matrix_exp mat(ptr, nr, nc)" "\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 nr: " << nr
<< "\n\t nc: " << nc << "\n\t nc: " << nc
); );
......
...@@ -114,8 +114,8 @@ namespace dlib ...@@ -114,8 +114,8 @@ namespace dlib
); );
/*! /*!
requires requires
- nr > 0 - nr >= 0
- ptr == a pointer to at least nr T objects - ptr == a pointer to at least nr T objects (or the NULL pointer if nr==0)
ensures ensures
- returns a matrix M such that: - returns a matrix M such that:
- M.nr() == nr - M.nr() == nr
...@@ -138,9 +138,9 @@ namespace dlib ...@@ -138,9 +138,9 @@ namespace dlib
); );
/*! /*!
requires requires
- nr > 0 - nr >= 0
- nc > 0 - nc >= 0
- ptr == a pointer to at least nr*nc T objects - ptr == a pointer to at least nr*nc T objects (or the NULL pointer if nr*nc==0)
ensures ensures
- returns a matrix M such that: - returns a matrix M such that:
- M.nr() == nr - M.nr() == nr
......
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