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
a47551eb
Commit
a47551eb
authored
Sep 04, 2015
by
Davis King
Browse files
Added a check that you don't mix matrix types (float vs. double) when using
set_ptrm().
parent
fe54cfa1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
dlib/matrix/matrix_subexp.h
dlib/matrix/matrix_subexp.h
+15
-0
No files found.
dlib/matrix/matrix_subexp.h
View file @
a47551eb
...
...
@@ -561,6 +561,11 @@ namespace dlib
const
matrix_exp
<
EXP
>&
exp
)
{
// You can only assign to a set_ptrm() expression with a source matrix that
// contains the same type of elements as the target (i.e. you can't mix double
// and float types).
COMPILE_TIME_ASSERT
((
is_same_type
<
T
,
typename
EXP
::
type
>::
value
==
true
));
DLIB_ASSERT
(
exp
.
nr
()
==
height
&&
exp
.
nc
()
==
width
,
"
\t
assignable_matrix_expression set_ptrm()"
<<
"
\n\t
You have tried to assign to this object using a matrix that isn't the right size"
...
...
@@ -589,6 +594,11 @@ namespace dlib
const
matrix_exp
<
EXP
>&
exp
)
{
// You can only assign to a set_ptrm() expression with a source matrix that
// contains the same type of elements as the target (i.e. you can't mix double
// and float types).
COMPILE_TIME_ASSERT
((
is_same_type
<
T
,
typename
EXP
::
type
>::
value
==
true
));
DLIB_ASSERT
(
exp
.
nr
()
==
height
&&
exp
.
nc
()
==
width
,
"
\t
assignable_matrix_expression set_ptrm()"
<<
"
\n\t
You have tried to assign to this object using a matrix that isn't the right size"
...
...
@@ -617,6 +627,11 @@ namespace dlib
const
matrix_exp
<
EXP
>&
exp
)
{
// You can only assign to a set_ptrm() expression with a source matrix that
// contains the same type of elements as the target (i.e. you can't mix double
// and float types).
COMPILE_TIME_ASSERT
((
is_same_type
<
T
,
typename
EXP
::
type
>::
value
==
true
));
DLIB_ASSERT
(
exp
.
nr
()
==
height
&&
exp
.
nc
()
==
width
,
"
\t
assignable_matrix_expression set_ptrm()"
<<
"
\n\t
You have tried to assign to this object using a matrix that isn't the right size"
...
...
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