mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Made the mex wrapper deal with cell arrays that have null elements.
This commit is contained in:
parent
b8e1282ac6
commit
dd16139a37
@ -387,6 +387,29 @@ namespace mex_binding
|
||||
return escape_percent(sout.str());
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
|
||||
template <
|
||||
typename matrix_type
|
||||
>
|
||||
typename dlib::enable_if_c<is_matrix<matrix_type>::value || is_array2d<matrix_type>::value >::type
|
||||
clear_mat (
|
||||
matrix_type& m
|
||||
)
|
||||
{
|
||||
m.set_size(0,0);
|
||||
}
|
||||
|
||||
template <
|
||||
typename matrix_type
|
||||
>
|
||||
typename dlib::disable_if_c<is_matrix<matrix_type>::value || is_array2d<matrix_type>::value >::type
|
||||
clear_mat (
|
||||
matrix_type&
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
|
||||
template <
|
||||
@ -651,6 +674,12 @@ namespace mex_binding
|
||||
}
|
||||
else if (is_matrix<T>::value || is_array2d<T>::value)
|
||||
{
|
||||
if (prhs == NULL)
|
||||
{
|
||||
clear_mat(arg);
|
||||
return;
|
||||
}
|
||||
|
||||
typedef typename inner_type<T>::type type;
|
||||
|
||||
const int num_dims = mxGetNumberOfDimensions(prhs);
|
||||
|
Loading…
Reference in New Issue
Block a user