/* ThinCavityPass.c and CavityPass.c Accelerator Toolbox Revision 7/22/03 A.Terebilo terebilo@ssrl.slac.stanford.edu */ #include "mex.h" #include "elempass.h" #include #define TWOPI 6.28318530717959 #define C0 2.99792458e8 void CavityPass(double *r_in, double le, double nv, double freq, int num_particles) /* le - physical length nv - peak voltage (V) normalized to the design enegy (eV) r is a 6-by-N matrix of initial conditions reshaped into 1-d array of 6*N elements */ { int c, c6; double halflength , p_norm, NormL; if(le == 0) { for(c = 0;c1) /* Required and optional fields */ { plhs[1] = mxCreateCellMatrix(0,0); /* No optional fields */ } } }