Changeset 830622f in sasview for sansmodels/src/sans/models


Ignore:
Timestamp:
Nov 30, 2011 3:27:22 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:
2585545
Parents:
01a870d
Message:

Re #5 fixing spheresld compilation on MSVC

File:
1 edited

Legend:

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

    r890ac7f1 r830622f  
    2121        double background = dp[6]; 
    2222        double npts = dp[57]; //number of sub_layers in each interface 
    23  
    24         double sld[n+2],thick_inter[n+2],thick[n+2],fun_coef[n+2],total_thick; 
     23  double nsl=npts;//21.0; //nsl = Num_sub_layer:  MUST ODD number in double //no other number works now 
     24  int n_s; 
     25  int floor_nsl; 
     26 
     27  double sld_i,sld_f,dz,bes,fun,f,vol,vol_pre,vol_sub,qr,r,contr,f2; 
     28  double sign,slope=0.0; 
     29  double pi; 
     30  double r0 = 0.0, thick_inter_f; 
     31 
     32  int* fun_type; 
     33  double* sld; 
     34  double* thick_inter; 
     35  double* thick; 
     36  double* fun_coef; 
     37 
     38        double total_thick; 
     39 
     40        fun_type = (int*)malloc(n+2); 
     41  sld = (double*)malloc(n+2); 
     42  thick_inter = (double*)malloc(n+2); 
     43  thick = (double*)malloc(n+2); 
     44  fun_coef = (double*)malloc(n+2); 
     45 
    2546        fun_type[0] = dp[3]; 
    2647        fun_coef[0] = fabs(dp[58]); 
     
    4061        thick_inter[n+1] = 0.0; 
    4162        fun_coef[n+1] = 0.0; 
    42  
    43         double nsl=npts;//21.0; //nsl = Num_sub_layer:  MUST ODD number in double //no other number works now 
    44         int n_s; 
    45         int floor_nsl; 
    46  
    47   double sld_i,sld_f,dz,bes,fun,f,vol,vol_pre,vol_sub,qr,r,contr,f2; 
    48   double sign,slope=0.0; 
    49   double pi; 
    50   double r0 = 0.0, thick_inter_f; 
    5163 
    5264    pi = 4.0*atan(1.0); 
     
    144156        f2 *= scale; 
    145157        f2 += background; 
     158 
     159  free(fun_type); 
     160  free(sld); 
     161  free(sld_im); 
     162  free(thick_inter); 
     163  free(thick); 
     164  free(fun_coef); 
     165 
    146166    return (f2); 
    147167} 
Note: See TracChangeset for help on using the changeset viewer.