Changeset 98f3053 in sasmodels
- Timestamp:
- Feb 8, 2016 5:27:39 AM (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:
- ec2ca99
- Parents:
- 9aac25d (diff), 216fa6d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- sasmodels
- Files:
-
- 11 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
rd07c883 rd5e650d 539 539 if Ncomp > 0 and Nbase > 0: 540 540 plt.subplot(133) 541 if '-abs' in opts:541 if not opts['rel_err']: 542 542 err, errstr, errview = resid, "abs err", "linear" 543 543 else: … … 545 545 #err,errstr = base/comp,"ratio" 546 546 plot_theory(data, None, resid=err, view=errview, use_data=False) 547 if view == 'linear': 548 plt.xscale('linear') 547 549 plt.title("max %s = %.3g"%(errstr, max(abs(err)))) 548 550 #cbar_title = errstr if errview=="linear" else "log "+errstr -
sasmodels/convert.py
r5054e80 r3964f92 14 14 'be_polyelectrolyte', 15 15 'correlation_length', 16 'binary_hard_sphere' 16 17 ] 17 18 -
sasmodels/kernel_template.c
rcaf768d r840b859 16 16 using namespace std; 17 17 #if defined(_MSC_VER) 18 #include <limits> 18 19 #include <float.h> 19 20 #define kernel extern "C" __declspec( dllexport ) … … 22 23 inline double fmax(double x, double y) { return x<y ? y : x; } 23 24 inline double isnan(double x) { return _isnan(x); } 25 #define NAN (std::numeric_limits<double>::quiet_NaN()) // non-signalling NaN 26 static double cephes_expm1(double x) { 27 // Adapted from the cephes math library. 28 // Copyright 1984 - 1992 by Stephen L. Moshier 29 if (x != x || x == 0.0) { 30 return x; // NaN and +/- 0 31 } else if (x < -0.5 || x > 0.5) { 32 return exp(x) - 1.0; 33 } else { 34 const double xsq = x*x; 35 const double p = ((( 36 +1.2617719307481059087798E-4)*xsq 37 +3.0299440770744196129956E-2)*xsq 38 +9.9999999999999999991025E-1); 39 const double q = (((( 40 +3.0019850513866445504159E-6)*xsq 41 +2.5244834034968410419224E-3)*xsq 42 +2.2726554820815502876593E-1)*xsq 43 +2.0000000000000000000897E0); 44 double r = x * p; 45 r = r / (q - r); 46 return r+r; 47 } 48 } 49 #define expm1 cephes_expm1 24 50 #else 25 51 #define kernel extern "C" -
sasmodels/models/bcc.c
r7ed702f r9aac25d 40 40 } 41 41 42 double _sphereform(double q, double radius, double sld, double solvent_sld){43 const double qr = q*radius;44 double sn, cn;45 SINCOS(qr, sn, cn);46 const double bes = (qr == 0.0 ? 1.0 : 3.0*(sn-qr*cn)/(qr*qr*qr));47 const double fq = bes * (sld - solvent_sld)*form_volume(radius);48 return 1.0e-4*fq*fq;49 }50 42 51 43 double form_volume(double radius){ … … 87 79 88 80 answer = (vb-va)/2.0*summ; 89 answer = answer* _sphereform(q,radius,sld,solvent_sld)*latticescale;81 answer = answer*sphere_form(q,radius,sld,solvent_sld)*latticescale; 90 82 91 83 return answer; … … 174 166 175 167 // Use SphereForm directly from libigor 176 answer = _sphereform(q,radius,sld,solvent_sld)*Zq*latticescale;168 answer = sphere_form(q,radius,sld,solvent_sld)*Zq*latticescale; 177 169 178 170 return answer; -
sasmodels/models/bcc.py
r13ed84c r9aac25d 132 132 # pylint: enable=bad-whitespace, line-too-long 133 133 134 source = ["lib/J1.c", "lib/gauss150.c", " bcc.c"]134 source = ["lib/J1.c", "lib/gauss150.c", "lib/sphere_form.c", "bcc.c"] 135 135 136 136 # parameters for demo -
sasmodels/models/fcc.c
reeb8bac r9aac25d 7 7 double _FCC_Integrand(double q, double dnn, double d_factor, double theta, double phi); 8 8 double _FCCeval(double Theta, double Phi, double temp1, double temp3); 9 double _sphereform(double q, double radius, double sld, double solvent_sld);10 9 11 10 … … 39 38 40 39 return (result); 41 }42 43 double _sphereform(double q, double radius, double sld, double solvent_sld){44 const double qr = q*radius;45 double sn, cn;46 SINCOS(qr, sn, cn);47 const double bes = (qr == 0.0 ? 1.0 : 3.0*(sn-qr*cn)/(qr*qr*qr));48 const double fq = bes * (sld - solvent_sld)*form_volume(radius);49 return 1.0e-4*fq*fq;50 40 } 51 41 … … 88 78 89 79 answer = (vb-va)/2.0*summ; 90 answer = answer* _sphereform(q,radius,sld,solvent_sld)*latticescale;80 answer = answer*sphere_form(q,radius,sld,solvent_sld)*latticescale; 91 81 92 82 return answer; … … 175 165 176 166 // Use SphereForm directly from libigor 177 answer = _sphereform(q,radius,sld,solvent_sld)*Zq*latticescale;167 answer = sphere_form(q,radius,sld,solvent_sld)*Zq*latticescale; 178 168 179 169 return answer; -
sasmodels/models/fcc.py
r13ed84c r9aac25d 125 125 ] 126 126 127 source = ["lib/J1.c", "lib/gauss150.c", " fcc.c"]127 source = ["lib/J1.c", "lib/gauss150.c", "lib/sphere_form.c", "fcc.c"] 128 128 129 129 # parameters for demo
Note: See TracChangeset
for help on using the changeset viewer.