Change memory allocation for mex function

fixes-turtlebasket
Mattia 2019-07-09 16:56:06 +01:00
parent 2dc15e8cf9
commit 9b878ec71c
1 changed files with 5 additions and 13 deletions

View File

@ -901,21 +901,13 @@ void mexFunction( int nlhs, mxArray *plhs[],
for (i = 0; i < nCoordsB; i++) for (i = 0; i < nCoordsB; i++)
arr2[i] = (ptr2 + c * i); arr2[i] = (ptr2 + c * i);
for (i = 0; i < nCoordsA; i++) for (j = 0; j < nCoordsA; j++)
for (j = 0; j < c; j++) for (i = 0; i < 3; i++)
arr1[i][j] = ++count;
for (i = 0; i < nCoordsB; i++)
for (j = 0; j < c; j++)
arr2[i][j] = ++count;
for (i = 0; i < 3; i++)
for (j = 0; j < nCoordsA; j++)
arr1[j][i] = inCoordsA[i + j * 3]; arr1[j][i] = inCoordsA[i + j * 3];
for (i = 0; i < 3; i++) for (j = 0; j < nCoordsB; j++)
for (j = 0; j < nCoordsB; j++) for (i = 0; i < 3; i++)
arr2[j][i] = inCoordsB[i + j * 3]; arr2[j][i] = inCoordsB[i + j * 3];