Mantid
Loading...
Searching...
No Matches
Framework
API
src
ILatticeFunction.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
#include "
MantidAPI/ILatticeFunction.h
"
8
9
namespace
Mantid::API
{
10
11
using namespace
Geometry;
12
13
ILatticeFunction::ILatticeFunction
() :
FunctionParameterDecorator
() {}
14
24
void
ILatticeFunction::function
(
const
FunctionDomain
&domain,
FunctionValues
&values)
const
{
25
try
{
26
const
auto
&latticeDomain =
dynamic_cast<
const
LatticeDomain
&
>
(domain);
27
28
functionLattice
(latticeDomain, values);
29
}
catch
(
const
std::bad_cast &) {
30
throw
std::invalid_argument(
"ILatticeFunction expects domain of type LatticeDomain."
);
31
}
32
}
33
44
void
ILatticeFunction::functionDeriv
(
const
FunctionDomain
&domain,
Jacobian
&jacobian) {
45
try
{
46
const
auto
&latticeDomain =
dynamic_cast<
const
LatticeDomain
&
>
(domain);
47
48
functionDerivLattice
(latticeDomain, jacobian);
49
}
catch
(
const
std::bad_cast &) {
50
throw
std::invalid_argument(
"ILatticeFunction expects domain of type LatticeDomain."
);
51
}
catch
(
const
Kernel::Exception::NotImplementedError
&) {
52
calNumericalDeriv
(domain, jacobian);
53
}
54
}
55
57
void
ILatticeFunction::functionDerivLattice
(
const
LatticeDomain
&latticeDomain,
Jacobian
&jacobian) {
58
UNUSED_ARG
(latticeDomain);
59
UNUSED_ARG
(jacobian);
60
61
throw
Kernel::Exception::NotImplementedError
(
"FunctionLatticeDeriv is not implemented for this function."
);
62
}
63
64
}
// namespace Mantid::API
ILatticeFunction.h
UNUSED_ARG
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Definition
System.h:48
Mantid::API::FunctionDomain
Base class that represents the domain of a function.
Definition
FunctionDomain.h:31
Mantid::API::FunctionParameterDecorator
FunctionParameterDecorator.
Definition
FunctionParameterDecorator.h:28
Mantid::API::FunctionValues
A class to store values calculated by a function.
Definition
FunctionValues.h:25
Mantid::API::IFunction::calNumericalDeriv
void calNumericalDeriv(const FunctionDomain &domain, Jacobian &jacobian)
Calculate numerical derivatives.
Definition
IFunction.cpp:1106
Mantid::API::ILatticeFunction::ILatticeFunction
ILatticeFunction()
Definition
ILatticeFunction.cpp:13
Mantid::API::ILatticeFunction::functionDeriv
void functionDeriv(const FunctionDomain &domain, Jacobian &jacobian) override
Implementation of IFunction::functionDeriv.
Definition
ILatticeFunction.cpp:44
Mantid::API::ILatticeFunction::functionDerivLattice
virtual void functionDerivLattice(const LatticeDomain &latticeDomain, Jacobian &jacobian)
Default implementation, throws NotImplementedError.
Definition
ILatticeFunction.cpp:57
Mantid::API::ILatticeFunction::function
void function(const FunctionDomain &domain, FunctionValues &values) const override
Implementation of IFunction::function.
Definition
ILatticeFunction.cpp:24
Mantid::API::ILatticeFunction::functionLattice
virtual void functionLattice(const LatticeDomain &latticeDomain, FunctionValues &values) const =0
Function that should calculate d-values for the HKLs provided in the domain.
Mantid::API::Jacobian
Represents the Jacobian in IFitFunction::functionDeriv.
Definition
Jacobian.h:22
Mantid::API::LatticeDomain
LatticeDomain.
Definition
LatticeDomain.h:24
Mantid::Kernel::Exception::NotImplementedError
Marks code as not implemented yet.
Definition
Exception.h:138
Mantid::API
Definition
AbsorptionCorrection.h:20
Generated by
1.9.8