mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Adjusted asserts to allow mat() to output empty matrices.
This commit is contained in:
parent
443279089f
commit
dd8bf7553d
@ -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
|
||||
);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user