ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change
on this file since 17a6843 was
17a6843,
checked in by Mathieu Doucet <doucetm@…>, 16 years ago
|
functor class for sans models
|
-
Property mode set to
100644
|
File size:
709 bytes
|
Line | |
---|
1 | /** |
---|
2 | * Scattering model classes |
---|
3 | * The classes use the IGOR library found in |
---|
4 | * sansmodels/src/libigor |
---|
5 | */ |
---|
6 | #include "models.h" |
---|
7 | #include <stdio.h> |
---|
8 | using namespace std; |
---|
9 | |
---|
10 | extern "C" { |
---|
11 | #include "libCylinder.h" |
---|
12 | } |
---|
13 | |
---|
14 | Cylinder :: Cylinder() { |
---|
15 | scale = 1.0; |
---|
16 | radius = 10.0; |
---|
17 | length = 400.0; |
---|
18 | contrast = 1.0; |
---|
19 | background = 0; |
---|
20 | } |
---|
21 | |
---|
22 | double Cylinder :: operator()(double q) { |
---|
23 | double dp[5]; |
---|
24 | // Fill paramater array |
---|
25 | dp[0] = scale; |
---|
26 | dp[1] = radius; |
---|
27 | dp[2] = length; |
---|
28 | dp[3] = contrast; |
---|
29 | dp[4] = background; |
---|
30 | |
---|
31 | // Call library function to evaluate model |
---|
32 | return CylinderForm(dp, q); |
---|
33 | } |
---|
34 | |
---|
35 | int main(void) |
---|
36 | { |
---|
37 | Cylinder c = Cylinder(); |
---|
38 | printf("I(Q=%g) = %g\n", 0.001, c(0.001)); |
---|
39 | return 0; |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.