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
12 try {
13 const auto &spectrumDomain = dynamic_cast<const FunctionDomain1DSpectrum &>(domain);
14 function1DSpectrum(spectrumDomain, values);
15 } catch (const std::bad_cast &) {
16 throw std::invalid_argument("Provided domain is not of type FunctionDomain1DSpectrum.");
17 }
18}
19
21 try {
22 const auto &spectrumDomain = dynamic_cast<const FunctionDomain1DSpectrum &>(domain);
23 functionDeriv1DSpectrum(spectrumDomain, jacobian);
24 } catch (const std::bad_cast &) {
25 throw std::invalid_argument("Provided domain is not of type FunctionDomain1DSpectrum.");
26 }
27}
28
32
33} // 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.
Represents the Jacobian in IFitFunction::functionDeriv.
Definition Jacobian.h:22