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
13bc3880
Commit
13bc3880
authored
Apr 12, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed compiler errors when using std::vector in mex wrapper.
parent
61591b13
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
mex_wrapper.cpp
dlib/matlab/mex_wrapper.cpp
+25
-16
No files found.
dlib/matlab/mex_wrapper.cpp
View file @
13bc3880
...
@@ -341,6 +341,15 @@ namespace mex_binding
...
@@ -341,6 +341,15 @@ namespace mex_binding
std
::
string
msg
;
std
::
string
msg
;
};
};
// -------------------------------------------------------
template
<
typename
T
>
void
validate_and_populate_arg
(
long
arg_idx
,
const
mxArray
*
prhs
,
T
&
arg
);
// -------------------------------------------------------
// -------------------------------------------------------
template
<
typename
T
>
template
<
typename
T
>
...
@@ -1075,22 +1084,6 @@ namespace mex_binding
...
@@ -1075,22 +1084,6 @@ namespace mex_binding
assign_to_matlab
(
plhs
,
array_to_matrix
(
item
));
assign_to_matlab
(
plhs
,
array_to_matrix
(
item
));
}
}
template
<
typename
T
>
typename
dlib
::
enable_if
<
is_array_type
<
T
>
>::
type
assign_to_matlab
(
mxArray
*&
plhs
,
const
T
&
item
)
{
mwSize
dims
[
1
]
=
{
item
.
size
()};
plhs
=
mxCreateCellArray
(
1
,
dims
);
for
(
unsigned
long
i
=
0
;
i
<
item
.
size
();
++
i
)
{
mxArray
*
next
=
0
;
assign_to_matlab
(
next
,
item
[
i
]);
mxSetCell
(
plhs
,
i
,
next
);
}
}
template
<
typename
T
>
template
<
typename
T
>
typename
dlib
::
disable_if_c
<
is_matrix
<
T
>::
value
||
is_array_type
<
T
>::
value
||
typename
dlib
::
disable_if_c
<
is_matrix
<
T
>::
value
||
is_array_type
<
T
>::
value
||
is_same_type
<
T
,
function_handle
>::
value
>::
type
assign_to_matlab
(
is_same_type
<
T
,
function_handle
>::
value
>::
type
assign_to_matlab
(
...
@@ -1117,6 +1110,22 @@ namespace mex_binding
...
@@ -1117,6 +1110,22 @@ namespace mex_binding
{
{
}
}
template
<
typename
T
>
typename
dlib
::
enable_if
<
is_array_type
<
T
>
>::
type
assign_to_matlab
(
mxArray
*&
plhs
,
const
T
&
item
)
{
mwSize
dims
[
1
]
=
{
item
.
size
()};
plhs
=
mxCreateCellArray
(
1
,
dims
);
for
(
unsigned
long
i
=
0
;
i
<
item
.
size
();
++
i
)
{
mxArray
*
next
=
0
;
assign_to_matlab
(
next
,
item
[
i
]);
mxSetCell
(
plhs
,
i
,
next
);
}
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
typename
T
>
template
<
typename
T
>
...
...
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