Changeset a8eab1c in sasview


Ignore:
Timestamp:
Jan 5, 2012 11:05:33 AM (13 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
37805e9
Parents:
dd60b45
Message:

refactor sphere model

Location:
sansmodels/src
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/c_extensions/sphere.h

    r67424cd ra8eab1c  
    11#if !defined(sphere_h) 
    22#define sphere_h 
     3#include "parameters.hh" 
    34 
    45/** 
     
    1920 //[ORIENTATION_PARAMS]= <text> </text> 
    2021 
    21 typedef struct { 
    22     /// Scale factor 
    23     //  [DEFAULT]=scale= 1.0 
    24     double scale; 
     22class SphereModel{ 
     23public: 
     24  // Model parameters 
     25  /// Scale factor 
     26  //  [DEFAULT]=scale= 1.0 
     27  Parameter scale; 
    2528 
    26     /// Radius of sphere [A] 
    27     //  [DEFAULT]=radius=60.0 [A] 
    28     double radius; 
     29  /// Radius of sphere [A] 
     30  //  [DEFAULT]=radius=60.0 [A] 
     31  Parameter radius; 
    2932 
    30     /// sldSph [1/A^(2)] 
    31     //  [DEFAULT]=sldSph= 2.0e-6 [1/A^(2)] 
    32     double sldSph; 
     33  /// sldSph [1/A^(2)] 
     34  //  [DEFAULT]=sldSph= 2.0e-6 [1/A^(2)] 
     35  Parameter sldSph; 
    3336 
    34     /// sldSolv [1/A^(2)] 
    35     //  [DEFAULT]=sldSolv= 1.0e-6 [1/A^(2)] 
    36     double sldSolv; 
     37  /// sldSolv [1/A^(2)] 
     38  //  [DEFAULT]=sldSolv= 1.0e-6 [1/A^(2)] 
     39  Parameter sldSolv; 
    3740 
    38         /// Incoherent Background [1/cm] 
    39         //  [DEFAULT]=background=0 [1/cm] 
    40         double background; 
    41 } SphereParameters; 
     41/// Incoherent Background [1/cm] 
     42//  [DEFAULT]=background=0 [1/cm] 
     43Parameter background; 
     44 
     45  // Constructor 
     46  SphereModel(); 
     47 
     48  // Operators to get I(Q) 
     49  double operator()(double q); 
     50  double operator()(double qx, double qy); 
     51  double calculate_ER(); 
     52  double evaluate_rphi(double q, double phi); 
     53}; 
    4254 
    4355 
    44  
    45 /// 1D scattering function 
    46 //double sphere_analytical_1D(SphereParameters *pars, double q); 
    47  
    48 /// 2D scattering function 
    49 //double sphere_analytical_2D(SphereParameters *pars, double q, double phi); 
    50 //double sphere_analytical_2DXY(SphereParameters *pars, double qx, double qy); 
    51  
    5256#endif 
  • sansmodels/src/c_models/models.hh

    rdd60b45 ra8eab1c  
    2929 
    3030 
    31  
    32 class SphereModel{ 
    33 public: 
    34         // Model parameters 
    35         Parameter radius; 
    36         Parameter scale; 
    37         Parameter sldSph; 
    38         Parameter sldSolv; 
    39         Parameter background; 
    40  
    41         // Constructor 
    42         SphereModel(); 
    43  
    44         // Operators to get I(Q) 
    45         double operator()(double q); 
    46         double operator()(double qx, double qy); 
    47         double calculate_ER(); 
    48         double evaluate_rphi(double q, double phi); 
    49 }; 
    5031 
    5132 
  • sansmodels/src/c_models/sphere.cpp

    r67424cd ra8eab1c  
    2525#include <stdio.h> 
    2626using namespace std; 
     27#include "sphere.h" 
    2728 
    2829extern "C" { 
    2930        #include "libSphere.h" 
    30         #include "sphere.h" 
    3131} 
    3232 
Note: See TracChangeset for help on using the changeset viewer.