| 1 | //---------------------------------------------------------------------- |
|---|
| 2 | // Includes |
|---|
| 3 | //---------------------------------------------------------------------- |
|---|
| 4 | #include "Muon_StaticKuboToyabe.h" |
|---|
| 5 | #include <cmath> |
|---|
| 6 | |
|---|
| 7 | namespace Mantid |
|---|
| 8 | { |
|---|
| 9 | namespace CurveFitting |
|---|
| 10 | { |
|---|
| 11 | |
|---|
| 12 | using namespace Kernel; |
|---|
| 13 | using namespace API; |
|---|
| 14 | |
|---|
| 15 | DECLARE_FUNCTION(Muon_StaticKuboToyabe) |
|---|
| 16 | |
|---|
| 17 | void Muon_StaticKuboToyabe::init() |
|---|
| 18 | { |
|---|
| 19 | declareParameter("A", 0.2); |
|---|
| 20 | declareParameter("Delta", 0.2); |
|---|
| 21 | } |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | void Muon_StaticKuboToyabe::functionLocal(double* out, const double* xValues, const int& nData)const |
|---|
| 25 | { |
|---|
| 26 | const double& A = getParameter("A"); |
|---|
| 27 | const double& G = getParameter("Delta"); |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | for (int i = 0; i < nData; i++) { |
|---|
| 31 | // double diff=xValues[i]-peakCentre; |
|---|
| 32 | // double e=pow(gs*xValues[i],2.0); |
|---|
| 33 | out[i] = A*(exp(-pow(G*xValues[i],2)/2)*(1-pow(G*xValues[i],2))*2./3.+1./3.); |
|---|
| 34 | } |
|---|
| 35 | } |
|---|
| 36 | void Muon_StaticKuboToyabe::functionDerivLocal(API::Jacobian* out, const double* xValues, const int& nData) |
|---|
| 37 | { |
|---|
| 38 | calNumericalDeriv(out, xValues, nData); |
|---|
| 39 | } |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | } // namespace CurveFitting |
|---|
| 45 | } // namespace Mantid |
|---|