Changeset 20d91bd in sasview for sansmodels


Ignore:
Timestamp:
Jan 5, 2012 6:35:42 PM (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:
2b878d74
Parents:
82c11d3
Message:

Refactor Schulz

Location:
sansmodels/src
Files:
1 added
3 deleted
2 edited

Legend:

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

    r67424cd r20d91bd  
    11#if !defined(schulz_h) 
    22#define schulz_h 
     3#include "parameters.hh" 
    34 
    45/** Structure definition for Schulz parameters. 
     
    1617                                        R= x/center</text> 
    1718 */ 
    18 typedef struct { 
    19     /// Scale factor  
    20     //  [DEFAULT]=scale=1.0 
    21     double scale; 
    22     /// Standard deviation 
    23     //  [DEFAULT]=sigma=1  
    24     double sigma; 
    25     /// Center of the Schulz distribution 
    26     //  [DEFAULT]=center=0.0  
    27     double center; 
    28 } SchulzParameters; 
    2919 
    30 /// 1D scattering function 
    31 double schulz_analytical_1D(SchulzParameters *pars, double x); 
     20class Schulz{ 
     21public: 
     22  /// Scale factor 
     23  //  [DEFAULT]=scale=1.0 
     24  Parameter scale; 
     25  /// Standard deviation 
     26  //  [DEFAULT]=sigma=1 
     27  Parameter sigma; 
     28  /// Center of the Schulz distribution 
     29  //  [DEFAULT]=center=0.0 
     30  Parameter center; 
    3231 
    33 /// 2D scattering function 
    34 double schulz_analytical_2D(SchulzParameters *pars, double x, double phi); 
    35 double schulz_analytical_2DXY(SchulzParameters *pars, double x, double y); 
     32  // Constructor 
     33  Schulz(); 
     34 
     35  // Operators to get I(Q) 
     36  double operator()(double q); 
     37  double operator()(double qx, double qy); 
     38  double calculate_ER(); 
     39  double evaluate_rphi(double q, double phi); 
     40}; 
    3641 
    3742#endif 
  • sansmodels/src/c_models/c_models.cpp

    r82c11d3 r20d91bd  
    6969        void addCGaussian(PyObject *module); 
    7070        void addCLogNormal(PyObject *module); 
    71         void addCSchulz(PyObject *module); 
    7271} 
    7372void addCLorentzian(PyObject *module); 
     73void addCSchulz(PyObject *module); 
    7474 
    7575/** 
Note: See TracChangeset for help on using the changeset viewer.