Changeset ba32cdd in sasmodels
- Timestamp:
- Mar 24, 2016 6:36:40 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:
- 5ff1b03
- Parents:
- 151f3bc
- Location:
- sasmodels
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernel_header.c
r380e8c9 rba32cdd 103 103 # define M_4PI_3 4.18879020478639 104 104 #endif 105 static inlinedouble square(double x) { return x*x; }106 static inlinedouble cube(double x) { return x*x*x; }107 static inlinedouble sinc(double x) { return x==0 ? 1.0 : sin(x)/x; }105 static double square(double x) { return x*x; } 106 static double cube(double x) { return x*x*x; } 107 static double sinc(double x) { return x==0 ? 1.0 : sin(x)/x; } 108 108 -
sasmodels/kernel_iq.c
r380e8c9 rba32cdd 74 74 75 75 #if MAX_PD > 0 76 77 printf("Entering polydispersity\n"); 76 //printf("Entering polydispersity\n"); 77 78 78 // Since we are no longer looping over the entire polydispersity hypercube 79 79 // for each q, we need to track the normalization values for each q in a … … 136 136 if (problem->pd_isvol[k]) partial_volweight *= wi; 137 137 } 138 printf("slow %d: ", loop_index);138 //printf("slow %d: ", loop_index); 139 139 for (int k=0; k < NPARS; k++) { 140 140 int coord = problem->par_coord[k]; … … 150 150 offset[k] = this_offset; 151 151 pvec[k] = values[this_offset]; 152 printf("p[%d]=v[%d]=%g ", k, offset[k], pvec[k]);153 } 154 printf("\n");152 //printf("p[%d]=v[%d]=%g ", k, offset[k], pvec[k]); 153 } 154 //printf("\n"); 155 155 weight = partial_weight * weights[problem->pd_offset[0]+pd_index[0]]; 156 156 if (problem->theta_par >= 0) { … … 168 168 weight = partial_weight*wi; 169 169 if (problem->pd_isvol[0]) vol_weight *= wi; 170 printf("fast %d: ", loop_index);170 //printf("fast %d: ", loop_index); 171 171 for (int k=0; k < problem->fast_coord_count; k++) { 172 172 const int pindex = problem->fast_coord_pars[k]; 173 173 pvec[pindex] = values[++offset[pindex]]; 174 printf("p[%d]=v[%d]=%g ", pindex, offset[pindex], pvec[pindex]);175 } 176 printf("\n");174 //printf("p[%d]=v[%d]=%g ", pindex, offset[pindex], pvec[pindex]); 175 } 176 //printf("\n"); 177 177 if (problem->theta_par == problem->pd_par[0]) { 178 178 weight *= fabs(cos(M_PI_180*pvec[problem->theta_par])); -
sasmodels/kernelcl.py
rfec69dd rba32cdd 48 48 harmless, albeit annoying. 49 49 """ 50 from __future__ import print_function 50 51 import os 51 52 import warnings … … 169 170 options = (get_fast_inaccurate_build_options(context.devices[0]) 170 171 if fast else []) 171 source = "\n".join(source )172 source = "\n".join(source_list) 172 173 program = cl.Program(context, source).build(options=options) 173 174 return program … … 439 440 """ 440 441 def __init__(self, kernel, model_info, q_vectors, dtype): 441 max_pd = self.info['max_pd']442 max_pd = model_info['max_pd'] 442 443 npars = len(model_info['parameters'])-2 443 444 q_input = GpuInput(q_vectors, dtype) -
sasmodels/models/lib/Si.c
re7678b2 rba32cdd 1 // integral of sin(x)/x Taylor series approximated to w/i 0.1% 1 2 double Si(double x); 2 3 3 // integral of sin(x)/x Taylor series approximated to w/i 0.1%4 4 double Si(double x) 5 5 { -
sasmodels/models/lib/polevl.c
r0b05c24 rba32cdd 51 51 */ 52 52 53 double polevl( double x, constant double *coef, int N ) { 53 double polevl( double x, constant double *coef, int N ); 54 double p1evl( double x, constant double *coef, int N ); 55 56 57 double polevl( double x, constant double *coef, int N ) 58 { 54 59 55 60 int i = 0; … … 70 75 */ 71 76 72 double p1evl( double x, constant double *coef, int N ) { 77 double p1evl( double x, constant double *coef, int N ) 78 { 73 79 int i=0; 74 80 double ans = x+coef[i]; -
sasmodels/models/lib/sas_J0.c
ra776125 rba32cdd 49 49 Copyright 1984, 1987, 1989, 2000 by Stephen L. Moshier 50 50 */ 51 52 double sas_J0(double x); 51 53 52 54 /* Note: all coefficients satisfy the relative error criterion … … 177 179 }; 178 180 179 double sas_J0(double x) { 181 double sas_J0(double x) 182 { 180 183 181 184 //Cephes single precission -
sasmodels/models/lib/sas_J1.c
r19b9005 rba32cdd 39 39 Copyright 1984, 1987, 1989, 2000 by Stephen L. Moshier 40 40 */ 41 double sas_J1(double x); 42 double sas_J1c(double x); 41 43 42 44 constant double RPJ1[8] = { … … 135 137 }; 136 138 137 double sas_J1(double x) { 139 double sas_J1(double x) 140 { 138 141 139 142 //Cephes double pression function -
sasmodels/models/lib/sas_JN.c
ra776125 rba32cdd 47 47 Copyright 1984, 1987, 2000 by Stephen L. Moshier 48 48 */ 49 50 49 double sas_JN( int n, double x ); 51 50 52 double sas_JN( int n, double x ) { 51 double sas_JN( int n, double x ) 52 { 53 53 54 54 const double MACHEP = 1.11022302462515654042E-16; -
sasmodels/models/lib/sph_j1c.c
re6f1410 rba32cdd 7 7 * using double precision that are the source. 8 8 */ 9 double sph_j1c(double q); 9 10 10 11 // The choice of the number of terms in the series and the cutoff value for … … 43 44 #endif 44 45 45 double sph_j1c(double q);46 46 double sph_j1c(double q) 47 47 { -
sasmodels/models/lib/sphere_form.c
rad90df9 rba32cdd 1 inline double 2 sphere_volume(double radius) 1 double sphere_volume(double radius); 2 double sphere_form(double q, double radius, double sld, double solvent_sld); 3 4 double sphere_volume(double radius) 3 5 { 4 6 return M_4PI_3*cube(radius); 5 7 } 6 8 7 inline double 8 sphere_form(double q, double radius, double sld, double solvent_sld) 9 double sphere_form(double q, double radius, double sld, double solvent_sld) 9 10 { 10 11 const double fq = sphere_volume(radius) * sph_j1c(q*radius); -
sasmodels/models/lib/wrc_cyl.c
re7678b2 rba32cdd 2 2 Functions for WRC implementation of flexible cylinders 3 3 */ 4 double Sk_WR(double q, double L, double b); 5 6 4 7 static double 5 8 AlphaSquare(double x) … … 363 366 } 364 367 365 double Sk_WR(double q, double L, double b);366 368 double Sk_WR(double q, double L, double b) 367 369 {
Note: See TracChangeset
for help on using the changeset viewer.