Changeset 7296219 in sasview for sansmodels/src/sans


Ignore:
Timestamp:
Nov 30, 2011 1:22:59 PM (13 years ago)
Author:
Mathieu Doucet <doucetm@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
01a870d
Parents:
72da06f
Message:

Re #5 fixing refl_adv compilation on MSVC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/c_extensions/refl_adv.c

    r890ac7f1 r7296219  
    1515double re_adv_kernel(double dp[], double q) { 
    1616        int n = dp[0]; 
    17         int i,j,fun_type[n+2]; 
     17        int i,j; 
    1818        double nsl; 
    1919 
     
    2525        double npts = dp[69]; //number of sub_layers in each interface 
    2626 
    27         double sld[n+2],sld_im[n+2],thick_inter[n+2],thick[n+2],fun_coef[n+2],total_thick; 
     27        double total_thick; 
    2828 
    2929  int n_s; 
     
    3131  double sign,erfunc; 
    3232  double pi; 
     33 
     34  int* fun_type; 
     35  double* sld; 
     36  double* sld_im 
     37  double* thick_inter; 
     38  double* thick; 
     39  double* fun_coef; 
     40  complex  inv_n,phi1,alpha,alpha2,kn,fnm,fnp,rn,Xn,nn,nn2,an,nnp1,one,zero,two,n_sub,n_sup,knp1,Xnp1; 
     41 
     42  fun_type = (int*)malloc(n+2); 
     43  sld = (double*)malloc(n+2); 
     44  sld_im = (double*)malloc(n+2); 
     45  thick_inter = (double*)malloc(n+2); 
     46  thick = (double*)malloc(n+2); 
     47  fun_coef = (double*)malloc(n+2); 
    3348 
    3449  fun_type[0] = dp[3]; 
     
    5772        nsl=npts;//21.0; //nsl = Num_sub_layer:  MUST ODD number in double //no other number works now 
    5873 
    59         complex  inv_n,phi1,alpha,alpha2,kn,fnm,fnp,rn,Xn,nn,nn2,an,nnp1,one,zero,two,n_sub,n_sup,knp1,Xnp1; 
    6074        pi = 4.0*atan(1.0); 
    6175    one = cassign(1.0,0.0); 
     
    138152    R += background; 
    139153 
     154    free(fun_type); 
     155    free(sld); 
     156    free(sld_im); 
     157    free(thick_inter); 
     158    free(thick); 
     159    free(fun_coef); 
     160 
    140161    return R; 
    141162 
Note: See TracChangeset for help on using the changeset viewer.