Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
a47551eb
Commit
a47551eb
authored
Sep 04, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a check that you don't mix matrix types (float vs. double) when using
set_ptrm().
parent
fe54cfa1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
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