Mantid
Loading...
Searching...
No Matches
DeltaFunction.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//----------------------------------------------------------------------
12#include <algorithm>
13
15
16using namespace CurveFitting;
17
18using namespace Kernel;
19
20using namespace API;
21
22DECLARE_FUNCTION(DeltaFunction)
23
25 declareParameter("Height", 1.0, "Scaling factor to be applied to the resolution.");
26 declareParameter("Centre", 0.0, "Shift along the x-axis to be applied to the resolution.");
27}
28
29void DeltaFunction::function1D(double *out, const double *xValues, const size_t nData) const {
30 UNUSED_ARG(xValues);
31 std::fill(out, out + nData, 0);
32}
33
34void DeltaFunction::functionDeriv1D(Jacobian *out, const double *xValues, const size_t nData) {
35 UNUSED_ARG(out);
36 UNUSED_ARG(xValues);
37 UNUSED_ARG(nData);
38 std::runtime_error("Cannot compute derivative of a delta function");
39}
40
41} // namespace Mantid::CurveFitting::Functions
#define DECLARE_FUNCTION(classname)
Macro for declaring a new type of function to be used with the FunctionFactory.
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Definition: System.h:64
An interface to a peak function, which extend the interface of IFunctionWithLocation by adding method...
Definition: IPeakFunction.h:51
Represents the Jacobian in IFitFunction::functionDeriv.
Definition: Jacobian.h:22
void function1D(double *out, const double *xValues, const size_t nData) const override
General implementation of the method for all peaks.
void functionDeriv1D(API::Jacobian *out, const double *xValues, const size_t nData) override
General implementation of the method for all peaks.