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
5c2b1f98
Commit
5c2b1f98
authored
Apr 21, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed an error where some assignments to matrix output variables would result
in an exception getting thrown.
parent
060e876b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
6 deletions
+29
-6
mex_wrapper.cpp
dlib/matlab/mex_wrapper.cpp
+29
-6
No files found.
dlib/matlab/mex_wrapper.cpp
View file @
5c2b1f98
...
...
@@ -1044,9 +1044,20 @@ namespace mex_binding
matrix_colmajor
&
item
)
{
// Don't need to do a copy if it's this kind of matrix since we can just
// pull the underlying mxArray out directly and thus avoid a copy.
plhs
=
item
.
_private_release_mxArray
();
if
(
!
item
.
_private_is_persistent
())
{
// Don't need to do a copy if it's this kind of matrix since we can just
// pull the underlying mxArray out directly and thus avoid a copy.
plhs
=
item
.
_private_release_mxArray
();
}
else
{
plhs
=
mxCreateDoubleMatrix
(
item
.
nr
(),
item
.
nc
(),
mxREAL
);
if
(
item
.
size
()
!=
0
)
memcpy
(
mxGetPr
(
plhs
),
&
item
(
0
,
0
),
item
.
size
()
*
sizeof
(
double
));
}
}
void
assign_to_matlab
(
...
...
@@ -1054,9 +1065,21 @@ namespace mex_binding
fmatrix_colmajor
&
item
)
{
// Don't need to do a copy if it's this kind of matrix since we can just
// pull the underlying mxArray out directly and thus avoid a copy.
plhs
=
item
.
_private_release_mxArray
();
if
(
!
item
.
_private_is_persistent
())
{
// Don't need to do a copy if it's this kind of matrix since we can just
// pull the underlying mxArray out directly and thus avoid a copy.
plhs
=
item
.
_private_release_mxArray
();
}
else
{
plhs
=
mxCreateNumericMatrix
(
item
.
nr
(),
item
.
nc
(),
mxSINGLE_CLASS
,
mxREAL
);
if
(
item
.
size
()
!=
0
)
memcpy
(
mxGetPr
(
plhs
),
&
item
(
0
,
0
),
item
.
size
()
*
sizeof
(
float
));
}
}
void
assign_to_matlab
(
...
...
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