Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
dd8bf755
Commit
dd8bf755
authored
Jun 11, 2016
by
Davis King
Browse files
Adjusted asserts to allow mat() to output empty matrices.
parent
44327908
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
dlib/matrix/matrix_mat.h
dlib/matrix/matrix_mat.h
+4
-4
dlib/matrix/matrix_mat_abstract.h
dlib/matrix/matrix_mat_abstract.h
+5
-5
No files found.
dlib/matrix/matrix_mat.h
View file @
dd8bf755
...
@@ -301,9 +301,9 @@ namespace dlib
...
@@ -301,9 +301,9 @@ namespace dlib
long
nr
long
nr
)
)
{
{
DLIB_ASSERT
(
nr
>
0
,
DLIB_ASSERT
(
nr
>
=
0
,
"
\t
const matrix_exp mat(ptr, nr)"
"
\t
const 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
,
"
\t
const matrix_exp mat(ptr, nr, nc)"
"
\t
const 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
);
);
...
...
dlib/matrix/matrix_mat_abstract.h
View file @
dd8bf755
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment