/
DeltaFunction.h
61 lines (54 loc) · 2.2 KB
/
DeltaFunction.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/IPeakFunction.h"
#include "MantidCurveFitting/DllConfig.h"
#include "MantidKernel/System.h"
#include <cmath>
namespace Mantid {
namespace CurveFitting {
namespace Functions {
/**
Delta function. Makes sence in Convolution only.
@author Roman Tolchenov, Tessella plc
@date 02/09/2010
*/
class MANTID_CURVEFITTING_DLL DeltaFunction : public API::IPeakFunction {
public:
/// Constructor
DeltaFunction();
/// overwrite IPeakFunction base class methods
double centre() const override { return getParameter("Centre"); }
double height() const override { return getParameter("Height"); }
double fwhm() const override { return 0; }
void setCentre(const double c) override { setParameter("Centre", c); }
void setHeight(const double h) override { setParameter("Height", h); }
void setFwhm(const double w) override { UNUSED_ARG(w); }
virtual double HeightPrefactor() const { return 1.0; } // modulates the Height of the Delta function
/// overwrite IFunction base class methods
std::string name() const override { return "DeltaFunction"; }
const std::string category() const override { return "Peak"; }
protected:
void function1D(double *out, const double *xValues, const size_t nData) const override;
void functionDeriv1D(API::Jacobian *out, const double *xValues, const size_t nData) override;
void functionLocal(double *out, const double *xValues, const size_t nData) const override {
UNUSED_ARG(out);
UNUSED_ARG(xValues);
UNUSED_ARG(nData);
}
void functionDerivLocal(API::Jacobian *out, const double *xValues, const size_t nData) override {
UNUSED_ARG(out);
UNUSED_ARG(xValues);
UNUSED_ARG(nData);
}
};
} // namespace Functions
} // namespace CurveFitting
} // namespace Mantid