Skip to content
Snippets Groups Projects
Commit 157bad2c authored by Nicola Vigano's avatar Nicola Vigano
Browse files

gtPlaceSubVolume: restored previous performance of C++ functions

parent 9c66a0dd
No related branches found
No related tags found
No related merge requests found
...@@ -15,16 +15,17 @@ void mexFunction( int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[] ) ...@@ -15,16 +15,17 @@ void mexFunction( int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[] )
return; return;
} }
mxArray * const mat_output = (mxArray *)prhs[0];
const mxArray * const mat_input = prhs[1]; const mxArray * const mat_input = prhs[1];
const mxArray * const mat_shifts_op = prhs[2]; const mxArray * const mat_shifts_op = prhs[2];
const mxArray * const mat_shifts_ip = prhs[3]; const mxArray * const mat_shifts_ip = prhs[3];
const mxArray * const mat_dims = prhs[4]; const mxArray * const mat_dims = prhs[4];
/* Incoming volumes dimensions */
/* Don't copy, just modify the incoming matrix */ /* Don't copy, just modify the incoming matrix */
mxUnshareArray(mat_output, true); plhs[0] = mxCreateSharedDataCopy(prhs[0]);
mxArray * const mat_output = plhs[0];
// mxArray * const mat_output = (mxArray *)prhs[0];
// mxUnshareArray(mat_output, true);
GT3D::GtMatlabSubVolumePlacer placer(mat_output, mat_input, mat_shifts_op, GT3D::GtMatlabSubVolumePlacer placer(mat_output, mat_input, mat_shifts_op,
mat_shifts_ip, mat_dims); mat_shifts_ip, mat_dims);
......
...@@ -15,16 +15,17 @@ void mexFunction( int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[] ) ...@@ -15,16 +15,17 @@ void mexFunction( int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[] )
return; return;
} }
mxArray * const mat_output = (mxArray *)prhs[0];
const mxArray * const mat_input = prhs[1]; const mxArray * const mat_input = prhs[1];
const mxArray * const mat_shifts_op = prhs[2]; const mxArray * const mat_shifts_op = prhs[2];
const mxArray * const mat_shifts_ip = prhs[3]; const mxArray * const mat_shifts_ip = prhs[3];
const mxArray * const mat_dims = prhs[4]; const mxArray * const mat_dims = prhs[4];
/* Incoming volumes dimensions */
/* Don't copy, just modify the incoming matrix */ /* Don't copy, just modify the incoming matrix */
mxUnshareArray(mat_output, true); plhs[0] = mxCreateSharedDataCopy(prhs[0]);
mxArray * const mat_output = plhs[0];
// mxArray * const mat_output = (mxArray *)prhs[0];
// mxUnshareArray(mat_output, true);
GT3D::GtMatlabSubVolumePlacer placer(mat_output, mat_input, mat_shifts_op, GT3D::GtMatlabSubVolumePlacer placer(mat_output, mat_input, mat_shifts_op,
mat_shifts_ip, mat_dims); mat_shifts_ip, mat_dims);
......
...@@ -15,16 +15,17 @@ void mexFunction( int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[] ) ...@@ -15,16 +15,17 @@ void mexFunction( int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[] )
return; return;
} }
mxArray * const mat_output = (mxArray *)prhs[0];
const mxArray * const mat_input = prhs[1]; const mxArray * const mat_input = prhs[1];
const mxArray * const mat_shifts_op = prhs[2]; const mxArray * const mat_shifts_op = prhs[2];
const mxArray * const mat_shifts_ip = prhs[3]; const mxArray * const mat_shifts_ip = prhs[3];
const mxArray * const mat_dims = prhs[4]; const mxArray * const mat_dims = prhs[4];
/* Incoming volumes dimensions */
/* Don't copy, just modify the incoming matrix */ /* Don't copy, just modify the incoming matrix */
mxUnshareArray(mat_output, true); plhs[0] = mxCreateSharedDataCopy(prhs[0]);
mxArray * const mat_output = plhs[0];
// mxArray * const mat_output = (mxArray *)prhs[0];
// mxUnshareArray(mat_output, true);
GT3D::GtMatlabSubVolumePlacer placer(mat_output, mat_input, mat_shifts_op, GT3D::GtMatlabSubVolumePlacer placer(mat_output, mat_input, mat_shifts_op,
mat_shifts_ip, mat_dims); mat_shifts_ip, mat_dims);
......
...@@ -88,11 +88,11 @@ function output = gtPlaceSubVolume(output, input, shift, index, assign_op, use_c ...@@ -88,11 +88,11 @@ function output = gtPlaceSubVolume(output, input, shift, index, assign_op, use_c
switch (assign_op) switch (assign_op)
case {'zero', 'conflict', 'adaptive'} % Mark overlapping... case {'zero', 'conflict', 'adaptive'} % Mark overlapping...
gtCxxPlaceSubVolumeInterf(output, input, shifts_op, shifts_ip, dims); output = gtCxxPlaceSubVolumeInterf(output, input, shifts_op, shifts_ip, dims);
case 'summed' case 'summed'
gtCxxPlaceSubVolumeSum(output, input, shifts_op, shifts_ip, dims); output = gtCxxPlaceSubVolumeSum(output, input, shifts_op, shifts_ip, dims);
case {'assign', 'parent'} case {'assign', 'parent'}
gtCxxPlaceSubVolumeAssign(output, input, shifts_op, shifts_ip, dims); output = gtCxxPlaceSubVolumeAssign(output, input, shifts_op, shifts_ip, dims);
otherwise otherwise
error('PLACE:wrong_argument', 'No option for "%s"', assign_op); error('PLACE:wrong_argument', 'No option for "%s"', assign_op);
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment