Mantid
Loading...
Searching...
No Matches
IFunction1DSpectrum.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 +
8
9namespace Mantid::API {
10
11Kernel::Logger IFunction1DSpectrum::g_log("IFunction1DSpectrum");
12
14 try {
15 const auto &spectrumDomain = dynamic_cast<const FunctionDomain1DSpectrum &>(domain);
16 function1DSpectrum(spectrumDomain, values);
17 } catch (const std::bad_cast &) {
18 throw std::invalid_argument("Provided domain is not of type FunctionDomain1DSpectrum.");
19 }
20}
21
23 try {
24 const auto &spectrumDomain = dynamic_cast<const FunctionDomain1DSpectrum &>(domain);
25 functionDeriv1DSpectrum(spectrumDomain, jacobian);
26 } catch (const std::bad_cast &) {
27 throw std::invalid_argument("Provided domain is not of type FunctionDomain1DSpectrum.");
28 }
29}
30
32 calNumericalDeriv(domain, jacobian);
33}
34
35} // namespace Mantid::API
Specialization of FunctionDomain1DVector for spectra of MatrixWorkspaces.
Base class that represents the domain of a function.
A class to store values calculated by a function.
virtual void function1DSpectrum(const FunctionDomain1DSpectrum &domain, FunctionValues &values) const =0
Provide a concrete function in an implementation that operates on a FunctionDomain1DSpectrum.
void function(const FunctionDomain &domain, FunctionValues &values) const override
Evaluates the function for all arguments in the domain.
virtual void functionDeriv1DSpectrum(const FunctionDomain1DSpectrum &domain, Jacobian &jacobian)
Derivatives of the function.
void functionDeriv(const FunctionDomain &domain, Jacobian &jacobian) override
Derivatives of function with respect to active parameters.
void calNumericalDeriv(const FunctionDomain &domain, Jacobian &jacobian)
Calculate numerical derivatives.
Definition: IFunction.cpp:1031
Represents the Jacobian in IFitFunction::functionDeriv.
Definition: Jacobian.h:22