Changeset 1b758b3 in sasview
- Timestamp:
- Jan 6, 2012 12:15:18 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:
- ee0f3fc
- Parents:
- 886dde6b
- Location:
- sansmodels/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/c_models/librefl.c
r101065a r1b758b3 151 151 // ind = x position: 0 to max 152 152 // nu = max x to integration 153 double err_mod_func(n_sub, ind, nu) 154 double n_sub,nu, ind; 153 double err_mod_func(double n_sub, double ind, double nu) 155 154 { 156 155 double center, func; … … 177 176 return func; 178 177 } 179 double linearfunc(n_sub, ind, nu) 180 double n_sub,nu, ind; 178 double linearfunc(double n_sub, double ind, double nu) 181 179 { 182 180 double bin_size, func; … … 192 190 } 193 191 // use the right hand side from the center of power func 194 double power_r(n_sub, ind, nu) 195 double n_sub, nu, ind; 192 double power_r(double n_sub, double ind, double nu) 196 193 { 197 194 double bin_size,func; … … 209 206 } 210 207 // use the left hand side from the center of power func 211 double power_l(n_sub, ind, nu) 212 double n_sub, nu, ind; 208 double power_l(double n_sub, double ind, double nu) 213 209 { 214 210 double bin_size, func; … … 226 222 } 227 223 // use 1-exp func from x=0 to x=1 228 double exp_r(n_sub, ind, nu) 229 double n_sub, nu, ind; 224 double exp_r(double n_sub, double ind, double nu) 230 225 { 231 226 double bin_size, func; … … 247 242 248 243 // use the left hand side mirror image of exp func 249 double exp_l(n_sub, ind, nu) 250 double n_sub, nu, ind; 244 double exp_l(double n_sub, double ind, double nu) 251 245 { 252 246 double bin_size, func; … … 269 263 // To select function called 270 264 // At nu = 0 (singular point), call line function 271 double intersldfunc(fun_type, n_sub, i, nu, sld_l, sld_r) 272 double n_sub, nu, sld_l, sld_r,i; 273 int fun_type; 265 double intersldfunc(int fun_type, double n_sub, double i, double nu, double sld_l, double sld_r) 274 266 { 275 267 double sld_i, func; … … 315 307 316 308 // used by refl.c 317 double interfunc(fun_type, n_sub, i, sld_l, sld_r) 318 double n_sub, sld_l, sld_r, i; 319 int fun_type; 309 double interfunc(int fun_type, double n_sub, double i, double sld_l, double sld_r) 320 310 { 321 311 double sld_i, func; -
sansmodels/src/python_wrapper/WrapperGenerator.py
r101065a r1b758b3 323 323 (par, self.params[par]) 324 324 325 param_str += " // Initialize dispersion / averaging parameter dict\n" 326 param_str += " DispersionVisitor* visitor = new DispersionVisitor();\n" 327 param_str += " PyObject * disp_dict;\n" 328 for par in self.disp_params: 329 par = par.strip() 330 param_str += " disp_dict = PyDict_New();\n" 331 param_str += " self->model->%s.dispersion->accept_as_source(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par) 332 param_str += " PyDict_SetItemString(self->dispersion, \"%s\", disp_dict);\n" % par 325 if len(self.disp_params)>0: 326 param_str += " // Initialize dispersion / averaging parameter dict\n" 327 param_str += " DispersionVisitor* visitor = new DispersionVisitor();\n" 328 param_str += " PyObject * disp_dict;\n" 329 for par in self.disp_params: 330 par = par.strip() 331 param_str += " disp_dict = PyDict_New();\n" 332 param_str += " self->model->%s.dispersion->accept_as_source(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par) 333 param_str += " PyDict_SetItemString(self->dispersion, \"%s\", disp_dict);\n" % par 333 334 334 335 # Initialize dispersion object dictionnary … … 345 346 (par, par) 346 347 347 param_str += " // Read in dispersion parameters\n" 348 param_str += " PyObject* disp_dict;\n" 349 param_str += " DispersionVisitor* visitor = new DispersionVisitor();\n" 350 for par in self.disp_params: 351 par = par.strip() 352 param_str += " disp_dict = PyDict_GetItemString(self->dispersion, \"%s\");\n" % par 353 param_str += " self->model->%s.dispersion->accept_as_destination(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par) 348 if len(self.disp_params)>0: 349 param_str += " // Read in dispersion parameters\n" 350 param_str += " PyObject* disp_dict;\n" 351 param_str += " DispersionVisitor* visitor = new DispersionVisitor();\n" 352 for par in self.disp_params: 353 par = par.strip() 354 param_str += " disp_dict = PyDict_GetItemString(self->dispersion, \"%s\");\n" % par 355 param_str += " self->model->%s.dispersion->accept_as_destination(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par) 354 356 355 357 newline = self.replaceToken(newline, "[READDICTIONARY]", param_str)
Note: See TracChangeset
for help on using the changeset viewer.