Changeset 03cac08 in sasmodels for doc/developer
- Timestamp:
- Mar 20, 2016 9:44:11 PM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 303d8d6
- Parents:
- d5ac45f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/developer/calculator.rst
rd5ac45f r03cac08 7 7 - KERNEL declares a function to be available externally 8 8 - KERNEL_NAME is the name of the function being declared 9 - MAX_PD is the maximum depth of the polydispersity loop 9 10 - NPARS is the number of parameters in the kernel 10 11 - PARAMETER_TABLE is the declaration of the parameters to the kernel:: … … 29 30 double sld_solvent 30 31 31 - CALL_IQ(q, nq,i, pars) is the declaration of a call to the kernel::32 - CALL_IQ(q, i, pars) is the declaration of a call to the kernel:: 32 33 33 34 Cylinder: 34 35 35 #define CALL_IQ(q, nq, i, var) \ 36 Iq(q[i], \ 36 #define CALL_IQ(q, i, var) Iq(q[i], \ 37 37 var.length, \ 38 38 var.radius, \ … … 42 42 Multi-shell cylinder: 43 43 44 #define CALL_IQ(q, nq, i, var) \ 45 Iq(q[i], \ 44 #define CALL_IQ(q, i, var) Iq(q[i], \ 46 45 var.num_shells, \ 47 46 var.length, \ … … 50 49 var.sld_solvent) 51 50 51 Cylinder2D: 52 53 #define CALL_IQ(q, i, var) Iqxy(q[2*i], q[2*i+1], \ 54 var.length, \ 55 var.radius, \ 56 var.sld, \ 57 var.sld_solvent, \ 58 var.theta, \ 59 var.phi) 60 52 61 - CALL_VOLUME(var) is similar, but for calling the form volume:: 53 62 … … 69 78 inline bool constrained(p1, p2, p3) { return expression; } 70 79 #define INVALID(var) constrained(var.p1, var.p2, var.p3) 71 72 - IQ_FUNC could be Iq or Iqxy73 - IQ_PARS could be q[i] or q[2*i],q[2*i+1]74 80 75 81 Our design supports a limited number of polydispersity loops, wherein … … 200 206 201 207 TODO: cutoff 208 209 For accuracy we may want to introduce Kahan summation into the integration:: 210 211 212 double accumulated_error = 0.0; 213 ... 214 #if USE_KAHAN_SUMMATION 215 const double y = next - accumulated_error; 216 const double t = ret + y; 217 accumulated_error = (t - ret) - y; 218 ret = t; 219 #else 220 ret += next; 221 #endif
Note: See TracChangeset
for help on using the changeset viewer.