Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mexFunctions/source/Nsum_mex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* to the element X[i+j*dims[0]+z*dims[0]*dims[1]]
*/

double Nsum(double *X, double *V, double *idx, int n, int I, int i)
void Nsum(double *X, double *V, double *idx, int n, int I, int i)
{
int k;
int ctr=0;
Expand All @@ -35,7 +35,7 @@ double Nsum(double *X, double *V, double *idx, int n, int I, int i)

}

double NsumC(double *Xr, double *Xi, double *Vr, double *Vi, double *idx, int n, int I, int i)
void NsumC(double *Xr, double *Xi, double *Vr, double *Vi, double *idx, int n, int I, int i)
{
int k;
int ctr=0;
Expand Down Expand Up @@ -87,7 +87,7 @@ void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
int Nw=dims[number_of_dims-1];
int N=num_of_X/Nw; // N= N1 x N2 ...

mwSize dims_V[number_of_dims-1]; // dimensions of the output matrix V
mwSize * dims_V = (mwSize *)calloc(sizeof(mwSize), number_of_dims-1); // dimensions of the output matrix V
for (j=0; j < number_of_dims-1; j++)
dims_V[j]=dims[j];

Expand Down
2 changes: 2 additions & 0 deletions mexFunctions/source/compile_mex.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

if ispc
mex -v proxSpMat2xNc.cpp libmwblas.lib CFLAGS="\$CFLAGS /openmp" LDFLAGS="\$LDFLAGS /openmp" -largeArrayDims -I../headers/
mex -v Nsum_mex.cpp libmwblas.lib CFLAGS="\$CFLAGS /openmp" LDFLAGS="\$LDFLAGS /openmp" -largeArrayDims -I../headers/
else
mex -v proxSpMat2xNc.c -lmwblas CFLAGS="\$CFLAGS -fopenmp -std=c99“ LDFLAGS="\$LDFLAGS -fopenmp" -largeArrayDims -I../headers/
mex -v Nsum_mex.c -lmwblas CFLAGS="\$CFLAGS -fopenmp -std=c99“ LDFLAGS="\$LDFLAGS -fopenmp" -largeArrayDims -I../headers/
end
4 changes: 2 additions & 2 deletions mexFunctions/source/proxSpMat2xNc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
double *Xp=mxGetPr(plhs[0]);

int k;
double tmp[2*nc];
double tmp2[2*nc];
double *tmp = (double*)calloc(sizeof(double), 2*nc);
double *tmp2= (double*)calloc(sizeof(double), 2*nc);

if(p==2){
#pragma omp parallel for shared(X, Xp) private(i,k,tmp,tmp2)
Expand Down