Changeset 0ba3b08 in sasview for sansmodels/src/c_models/sld_cal.cpp
- Timestamp:
- Jan 5, 2012 12:16:29 PM (13 years ago)
- 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:
- 011e0e4
- Parents:
- bbbed8c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/c_models/sld_cal.cpp
r67424cd r0ba3b08 6 6 7 7 #include <math.h> 8 #include "models.hh"9 8 #include "parameters.hh" 10 9 #include <stdio.h> 11 10 using namespace std; 11 #include "sld_cal.h" 12 12 13 13 extern "C" { 14 #include "sld_cal.h" 14 #include "libmultifunc/librefl.h" 15 } 16 17 // Convenience structure 18 typedef struct { 19 double fun_type; 20 double npts_inter; 21 double shell_num; 22 double nu_inter; 23 double sld_left; 24 double sld_right; 25 } SLDCalParameters; 26 27 /** 28 * Function to calculate sld 29 * @param pars: parameters 30 * @param x: independent param-value 31 * @return: sld value 32 */ 33 static double sld_cal_analytical_1D(SLDCalParameters *pars, double x) { 34 double fun, nsl, n_s, fun_coef, sld_l, sld_r, sld_out; 35 int fun_type; 36 37 fun = pars->fun_type; 38 nsl = pars->npts_inter; 39 n_s = pars->shell_num; 40 fun_coef = pars->nu_inter; 41 sld_l = pars-> sld_left; 42 sld_r = pars-> sld_right; 43 44 fun_type = floor(fun); 45 46 sld_out = intersldfunc(fun_type, nsl, n_s, fun_coef, sld_l, sld_r); 47 48 return sld_out; 15 49 } 16 50
Note: See TracChangeset
for help on using the changeset viewer.