Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 8a151848 authored by hhakim's avatar hhakim
Browse files

Add missing matfaust.Faust.nbytes function.

parent 3683e14b
Branches
Tags
No related merge requests found
Pipeline #833785 skipped
...@@ -1007,6 +1007,20 @@ classdef Faust ...@@ -1007,6 +1007,20 @@ classdef Faust
n = prod(size(F)); n = prod(size(F));
end end
%======================================================================
%> @brief Gives the memory size of the Faust in bytes.
%>
%>
%> @retval n Faust size in bytes.
%======================================================================
function n = nbytes(F)
if (F.isReal)
n = mexFaustReal('nbytes',F.matrix.objectHandle);
else
n = mexFaustCplx('nbytes',F.matrix.objectHandle);
end
end
%====================================================================== %======================================================================
%> @brief The last index when slicing or indexing a Faust. %> @brief The last index when slicing or indexing a Faust.
%> %>
......
...@@ -501,6 +501,20 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) ...@@ -501,6 +501,20 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
} }
if (!strcmp("nbytes", cmd))
{
if (nlhs != 1 || nrhs != 2)
{
mexErrMsgTxt("get_nb_factor : incorrect number of arguments.");
}
faust_unsigned_int nbytes = core_ptr->getNBytes();
plhs[0] = mxCreateDoubleMatrix(1,1,mxREAL);
double* ptr_out = (double*) mxGetData(plhs[0]);
ptr_out[0]= (double) nbytes;
return;
}
if (!strcmp("disp",cmd)) if (!strcmp("disp",cmd))
{ {
if (nlhs != 0 || nrhs != 2) if (nlhs != 0 || nrhs != 2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment