Changeset b523c0e in sasview
- Timestamp:
- May 6, 2016 2:19:24 PM (9 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:
- f567f92f
- Parents:
- 4c29e4d
- Location:
- src/sas/sascalc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/calculator/c_extensions/sld2i.cpp
r9e531f2 rb523c0e 164 164 //Assume that pixel volumes are given in vol_pix in A^3 unit 165 165 // Loop over q-values and multiply apply matrix 166 for( size_t i=0; i<npoints; i++){166 for(int i=0; i<npoints; i++){ 167 167 sumj =0.0; 168 for( size_t j=0; j<n_pix; j++){168 for(int j=0; j<n_pix; j++){ 169 169 //Isotropic: Assumes all slds are real (no magnetic) 170 170 //Also assumes there is no polarization: No dependency on spin … … 183 183 //full calculation 184 184 //pragma omp parallel for 185 for( size_t k=0; k<n_pix; k++){185 for(int k=0; k<n_pix; k++){ 186 186 sld_j = sldn_val[j] * sldn_val[k] * vol_pix[j] * vol_pix[k]; 187 187 qr = (x_val[j]-x_val[k])*(x_val[j]-x_val[k])+ -
src/sas/sascalc/calculator/c_extensions/sld2i_module.cpp
r9e531f2 rb523c0e 153 153 initsld2i(void) 154 154 { 155 PyObject* m; 156 157 m = Py_InitModule3("sld2i", module_methods, 158 "Sld2i module"); 155 Py_InitModule3("sld2i", module_methods, "Sld2i module"); 159 156 } -
src/sas/sascalc/pr/c_extensions/Cinvertor.c
rb699768 rb523c0e 115 115 116 116 //self->params.x = data; 117 self->params.npoints = ndata;117 self->params.npoints = (int)ndata; 118 118 return Py_BuildValue("i", self->params.npoints); 119 119 } … … 180 180 181 181 //self->params.y = data; 182 self->params.ny = ndata;182 self->params.ny = (int)ndata; 183 183 return Py_BuildValue("i", self->params.ny); 184 184 } … … 245 245 246 246 //self->params.err = data; 247 self->params.nerr = ndata;247 self->params.nerr = (int)ndata; 248 248 return Py_BuildValue("i", self->params.nerr); 249 249 } … … 523 523 residuals = PyList_New(self->params.npoints); 524 524 525 regterm = reg_term(pars, self->params.d_max, npars, nslice);525 regterm = reg_term(pars, self->params.d_max, (int)npars, nslice); 526 526 527 527 for(i=0; i<self->params.npoints; i++) { 528 diff = self->params.y[i] - iq(pars, self->params.d_max, npars, self->params.x[i]);528 diff = self->params.y[i] - iq(pars, self->params.d_max, (int)npars, self->params.x[i]); 529 529 residual = diff*diff / (self->params.err[i]*self->params.err[i]); 530 530 … … 573 573 residuals = PyList_New(self->params.npoints); 574 574 575 regterm = reg_term(pars, self->params.d_max, npars, nslice);575 regterm = reg_term(pars, self->params.d_max, (int)npars, nslice); 576 576 577 577 578 578 for(i=0; i<self->params.npoints; i++) { 579 diff = self->params.y[i] - pr(pars, self->params.d_max, npars, self->params.x[i]);579 diff = self->params.y[i] - pr(pars, self->params.d_max, (int)npars, self->params.x[i]); 580 580 residual = diff*diff / (self->params.err[i]*self->params.err[i]); 581 581 … … 611 611 OUTVECTOR(data_obj,pars,npars); 612 612 613 iq_value = iq(pars, self->params.d_max, npars, q);613 iq_value = iq(pars, self->params.d_max, (int)npars, q); 614 614 return Py_BuildValue("f", iq_value); 615 615 } … … 636 636 OUTVECTOR(data_obj,pars,npars); 637 637 638 iq_value = iq_smeared(pars, self->params.d_max, npars,638 iq_value = iq_smeared(pars, self->params.d_max, (int)npars, 639 639 self->params.slit_height, self->params.slit_width, 640 640 q, 21); … … 661 661 OUTVECTOR(data_obj,pars,npars); 662 662 663 pr_value = pr(pars, self->params.d_max, npars, r);663 pr_value = pr(pars, self->params.d_max, (int)npars, r); 664 664 return Py_BuildValue("f", pr_value); 665 665 } … … 689 689 690 690 if (err_obj == Py_None) { 691 pr_value = pr(pars, self->params.d_max, npars, r);691 pr_value = pr(pars, self->params.d_max, (int)npars, r); 692 692 pr_err_value = 0.0; 693 693 } else { 694 694 OUTVECTOR(err_obj,pars_err,npars2); 695 pr_err(pars, pars_err, self->params.d_max, npars, r, &pr_value, &pr_err_value);695 pr_err(pars, pars_err, self->params.d_max, (int)npars, r, &pr_value, &pr_err_value); 696 696 } 697 697 return Py_BuildValue("ff", pr_value, pr_err_value); … … 728 728 OUTVECTOR(data_obj,pars,npars); 729 729 730 oscill = reg_term(pars, self->params.d_max, npars, 100);731 norm = int_p2(pars, self->params.d_max, npars, 100);730 oscill = reg_term(pars, self->params.d_max, (int)npars, 100); 731 norm = int_p2(pars, self->params.d_max, (int)npars, 100); 732 732 return Py_BuildValue("f", sqrt(oscill/norm)/acos(-1.0)*self->params.d_max ); 733 733 … … 749 749 OUTVECTOR(data_obj,pars,npars); 750 750 751 count = npeaks(pars, self->params.d_max, npars, 100);751 count = npeaks(pars, self->params.d_max, (int)npars, 100); 752 752 753 753 return Py_BuildValue("i", count ); … … 770 770 OUTVECTOR(data_obj,pars,npars); 771 771 772 fraction = positive_integral(pars, self->params.d_max, npars, 100);772 fraction = positive_integral(pars, self->params.d_max, (int)npars, 100); 773 773 774 774 return Py_BuildValue("f", fraction ); … … 795 795 OUTVECTOR(err_obj,pars_err,npars2); 796 796 797 fraction = positive_errors(pars, pars_err, self->params.d_max, npars, 51);797 fraction = positive_errors(pars, pars_err, self->params.d_max, (int)npars, 51); 798 798 799 799 return Py_BuildValue("f", fraction ); … … 815 815 OUTVECTOR(data_obj,pars,npars); 816 816 817 value = rg(pars, self->params.d_max, npars, 101);817 value = rg(pars, self->params.d_max, (int)npars, 101); 818 818 819 819 return Py_BuildValue("f", value ); … … 835 835 OUTVECTOR(data_obj,pars,npars); 836 836 837 value = 4.0*acos(-1.0)*int_pr(pars, self->params.d_max, npars, 101);837 value = 4.0*acos(-1.0)*int_pr(pars, self->params.d_max, (int)npars, 101); 838 838 839 839 return Py_BuildValue("f", value );
Note: See TracChangeset
for help on using the changeset viewer.