Mantid
|
Class to provide a consistent interface to an interpolation option on algorithms. More...
#include <InterpolationOption.h>
Public Types | |
enum class | Value : uint8_t { Linear , CSpline } |
Public Member Functions | |
void | applyInPlace (const HistogramData::Histogram &in, HistogramData::Histogram &out) const |
Apply the interpolation method to the output histogram. More... | |
void | applyInplace (HistogramData::Histogram &inOut, size_t stepSize) const |
Apply the interpolation method to the given histogram. More... | |
std::unique_ptr< Kernel::Property > | property () const |
Create a property suitable to attach to an algorithm to support interpolation. More... | |
std::string | propertyDoc () const |
void | set (const std::string &kind, const bool calculateErrors, const bool independentErrors) |
Set the interpolation option. More... | |
void | set (const Value &kind, const bool calculateErrors, const bool independentErrors) |
Set the interpolation option. More... | |
std::string | validateInputSize (const size_t size) const |
Validate the size of input histogram. More... | |
Private Attributes | |
bool | m_calculateErrors |
bool | m_independentErrors |
Value | m_value = Value::Linear |
Class to provide a consistent interface to an interpolation option on algorithms.
Definition at line 26 of file InterpolationOption.h.
|
strong |
Enumerator | |
---|---|
Linear | |
CSpline |
Definition at line 29 of file InterpolationOption.h.
void Mantid::Algorithms::InterpolationOption::applyInPlace | ( | const HistogramData::Histogram & | in, |
HistogramData::Histogram & | out | ||
) | const |
Apply the interpolation method to the output histogram.
in | A histogram from which to interpolate |
out | A histogram where to store the interpolated values |
runtime_error | Indicates unknown interpolatio method. |
Definition at line 132 of file InterpolationOption.cpp.
References CSpline, Linear, m_calculateErrors, m_independentErrors, and m_value.
Referenced by Mantid::Algorithms::DiscusMultipleScatteringCorrection::interpolateFromSparse(), and Mantid::Algorithms::MonteCarloAbsorption::interpolateFromSparse().
void Mantid::Algorithms::InterpolationOption::applyInplace | ( | HistogramData::Histogram & | inOut, |
size_t | stepSize | ||
) | const |
Apply the interpolation method to the given histogram.
inOut | A reference to a histogram to interpolate |
stepSize | The step size of calculated points |
Definition at line 112 of file InterpolationOption.cpp.
References CSpline, Linear, m_calculateErrors, m_independentErrors, and m_value.
Referenced by Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), and Mantid::Algorithms::DiscusMultipleScatteringCorrection::exec().
std::unique_ptr< Property > Mantid::Algorithms::InterpolationOption::property | ( | ) | const |
Create a property suitable to attach to an algorithm to support interpolation.
Definition at line 69 of file InterpolationOption.cpp.
std::string Mantid::Algorithms::InterpolationOption::propertyDoc | ( | ) | const |
Definition at line 79 of file InterpolationOption.cpp.
void Mantid::Algorithms::InterpolationOption::set | ( | const std::string & | kind, |
const bool | calculateErrors, | ||
const bool | independentErrors | ||
) |
Set the interpolation option.
kind | Set the type of interpolation on the call to apply |
calculateErrors | Whether to calculate the interpolation errors |
independentErrors | Sets whether the errors in the spectra should be considered to be independent or not when interpolating between them |
Definition at line 52 of file InterpolationOption.cpp.
References CSpline, kind, Linear, m_calculateErrors, m_independentErrors, and m_value.
void Mantid::Algorithms::InterpolationOption::set | ( | const Value & | kind, |
const bool | calculateErrors, | ||
const bool | independentErrors | ||
) |
Set the interpolation option.
kind | Set the type of interpolation on the call to apply |
calculateErrors | Whether to calculate the interpolation errors |
independentErrors | Sets whether the errors in the spectra should be considered to be independent or not when interpolating between them |
Definition at line 38 of file InterpolationOption.cpp.
References kind, m_calculateErrors, m_independentErrors, and m_value.
Referenced by Mantid::Algorithms::DiscusMultipleScatteringCorrection::exec(), Mantid::Algorithms::MonteCarloAbsorption::exec(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::validateInputs(), and Mantid::Algorithms::MonteCarloAbsorption::validateInputs().
std::string Mantid::Algorithms::InterpolationOption::validateInputSize | ( | const size_t | size | ) | const |
Validate the size of input histogram.
size | number of points in the input histogram |
Definition at line 88 of file InterpolationOption.cpp.
References CSpline, Linear, m_value, and std::to_string().
Referenced by Mantid::Algorithms::DiscusMultipleScatteringCorrection::validateInputs(), and Mantid::Algorithms::MonteCarloAbsorption::validateInputs().
|
private |
Definition at line 43 of file InterpolationOption.h.
Referenced by applyInPlace(), applyInplace(), and set().
|
private |
Definition at line 44 of file InterpolationOption.h.
Referenced by applyInPlace(), applyInplace(), and set().
|
private |
Definition at line 42 of file InterpolationOption.h.
Referenced by applyInPlace(), applyInplace(), set(), and validateInputSize().