Changeset 8ff5cb3 in sasview for sansmodels/src/sans/models/c_extensions/libmultifunc/librefl.c
- Timestamp:
- Dec 14, 2011 3:26:29 PM (12 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:
- 96814e1
- Parents:
- 5d75d65a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_extensions/libmultifunc/librefl.c
rb9765ad r8ff5cb3 21 21 22 22 23 complex c add(x,y)23 complex cplx_add(x,y) 24 24 complex x,y; 25 25 { … … 40 40 } 41 41 42 complex c sub(x,y)42 complex cplx_sub(x,y) 43 43 complex x,y; 44 44 { … … 50 50 51 51 52 complex c mult(x,y)52 complex cplx_mult(x,y) 53 53 complex x,y; 54 54 { … … 59 59 } 60 60 61 complex c div(x,y)61 complex cplx_div(x,y) 62 62 complex x,y; 63 63 { … … 68 68 } 69 69 70 complex c exp(b)70 complex cplx_exp(b) 71 71 complex b; 72 72 { … … 81 81 82 82 83 complex c sqrt(z) //see Schaum`s Math Handbook p. 22, 6.6 and 6.1083 complex cplx_sqrt(z) //see Schaum`s Math Handbook p. 22, 6.6 and 6.10 84 84 complex z; 85 85 { … … 124 124 } 125 125 126 complex c cos(b)126 complex cplx_cos(b) 127 127 complex b; 128 128 { … … 131 131 two = cassign(2.0,0.0); 132 132 i = cassign(0.0,1.0); 133 bi = c mult(b,i);134 negbi = c sub(zero,bi);135 z = c div(cadd(cexp(bi),cexp(negbi)),two);133 bi = cplx_mult(b,i); 134 negbi = cplx_sub(zero,bi); 135 z = cplx_div(cplx_add(cplx_exp(bi),cplx_exp(negbi)),two); 136 136 return z; 137 137 }
Note: See TracChangeset
for help on using the changeset viewer.