Mantid
Loading...
Searching...
No Matches
Framework
CurveFitting
src
Functions
StaticKuboToyabe.cpp
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4
// NScD Oak Ridge National Laboratory, European Spallation Source,
5
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
//----------------------------------------------------------------------
8
// Includes
9
//----------------------------------------------------------------------
10
#include "
MantidCurveFitting/Functions/StaticKuboToyabe.h
"
11
#include "
MantidAPI/FunctionFactory.h
"
12
#include <cmath>
13
14
namespace
Mantid::CurveFitting::Functions
{
15
16
using namespace
CurveFitting;
17
18
using namespace
Kernel;
19
20
using namespace
API
;
21
22
DECLARE_FUNCTION
(StaticKuboToyabe)
23
24
void
StaticKuboToyabe
::init() {
25
declareParameter(
"A"
, 0.2,
"Amplitude at time 0"
);
26
declareParameter(
"Delta"
, 0.2,
"Decay rate"
);
27
}
28
29
void
StaticKuboToyabe::function1D
(
double
*out,
const
double
*xValues,
const
size_t
nData)
const
{
30
const
double
A =
getParameter
(
"A"
);
31
const
double
G =
getParameter
(
"Delta"
);
32
33
for
(
size_t
i = 0; i < nData; i++) {
34
out[i] = A * (exp(-pow(G * xValues[i], 2) / 2) * (1 - pow(G * xValues[i], 2)) * 2.0 / 3 + 1.0 / 3);
35
}
36
}
37
38
}
// namespace Mantid::CurveFitting::Functions
FunctionFactory.h
DECLARE_FUNCTION
#define DECLARE_FUNCTION(classname)
Macro for declaring a new type of function to be used with the FunctionFactory.
Definition
FunctionFactory.h:151
StaticKuboToyabe.h
Mantid::API::ParamFunction::getParameter
double getParameter(size_t i) const override
Get i-th parameter.
Definition
ParamFunction.cpp:62
Mantid::CurveFitting::Functions::StaticKuboToyabe
Provide static Kubo Toyabe fitting function.
Definition
StaticKuboToyabe.h:26
Mantid::CurveFitting::Functions::StaticKuboToyabe::function1D
void function1D(double *out, const double *xValues, const size_t nData) const override
Function you want to fit to.
Definition
StaticKuboToyabe.cpp:29
API
Definition
ChudleyElliotSQE.h:11
Mantid::CurveFitting::Functions
Definition
VesuvioCalculateGammaBackground.h:23
Generated by
1.9.8