Skip to content

Commit e1c4ae6

Browse files
committed
Fix Matlab compilation
1 parent 9f31995 commit e1c4ae6

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

atintegrators/CrabCavityPass.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
120120
double *Voltages = atGetDoubleArray(ElemData,"Voltages"); check_error();
121121
double Frequency = atGetDouble(ElemData,"Frequency"); check_error();
122122
/* Optional fields */
123-
double Energy = atGetOptionalDouble(ElemData,"Energy",Param->energy); check_error();
124-
double Energy = atGetOptionalDouble(ElemData,"Energy",Param->energy); check_error();
123+
double Energy = atGetOptionalDouble(ElemData,"Energy",0.0); check_error();
125124
double Phase = atGetOptionalDouble(ElemData,"Phase",0.0); check_error();
126125
double SigPhi = atGetOptionalDouble(ElemData,"SigPhi",0.0); check_error();
127126
double SigVV = atGetOptionalDouble(ElemData,"SigVV",0.0); check_error();
@@ -132,7 +131,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
132131
plhs[0] = mxDuplicateArray(prhs[1]);
133132
r_in = mxGetDoubles(plhs[0]);
134133
CrabCavityPass(r_in, Length, Voltages[0]/Energy, Voltages[1]/Energy,
135-
Frequency, Phase, SigPhi, SigVV, num_particles);
134+
Frequency, Phase, SigPhi, SigVV, &pcg32_global, num_particles);
136135
}
137136
else if (nrhs == 0) {
138137
plhs[0] = mxCreateCellMatrix(3,1);

atmat/atmexall.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function atmexall(varargin)
149149
compile(compargs, pmeth);
150150
catch errcomp
151151
if fail
152-
rethrow(err);
152+
rethrow(errcomp);
153153
else
154154
fprintf(2, 'Could not compile %s:\n%s\n', pmeth, errcomp.message);
155155
end

0 commit comments

Comments
 (0)