Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
Mantid::Algorithms::InterpolationOption Class Reference

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::Propertyproperty () 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
 

Detailed Description

Class to provide a consistent interface to an interpolation option on algorithms.

Definition at line 26 of file InterpolationOption.h.

Member Enumeration Documentation

◆ Value

Enumerator
Linear 
CSpline 

Definition at line 29 of file InterpolationOption.h.

Member Function Documentation

◆ applyInPlace()

void Mantid::Algorithms::InterpolationOption::applyInPlace ( const HistogramData::Histogram &  in,
HistogramData::Histogram &  out 
) const

Apply the interpolation method to the output histogram.

Parameters
inA histogram from which to interpolate
outA histogram where to store the interpolated values
Exceptions
runtime_errorIndicates 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().

◆ applyInplace()

void Mantid::Algorithms::InterpolationOption::applyInplace ( HistogramData::Histogram &  inOut,
size_t  stepSize 
) const

Apply the interpolation method to the given histogram.

Parameters
inOutA reference to a histogram to interpolate
stepSizeThe 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().

◆ property()

std::unique_ptr< Property > Mantid::Algorithms::InterpolationOption::property ( ) const

Create a property suitable to attach to an algorithm to support interpolation.

Returns
A new Property containing the valid list of interpolation methods

Definition at line 69 of file InterpolationOption.cpp.

◆ propertyDoc()

std::string Mantid::Algorithms::InterpolationOption::propertyDoc ( ) const
Returns
The documentation string for the property

Definition at line 79 of file InterpolationOption.cpp.

◆ set() [1/2]

void Mantid::Algorithms::InterpolationOption::set ( const std::string &  kind,
const bool  calculateErrors,
const bool  independentErrors 
)

Set the interpolation option.

Parameters
kindSet the type of interpolation on the call to apply
calculateErrorsWhether to calculate the interpolation errors
independentErrorsSets 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.

◆ set() [2/2]

void Mantid::Algorithms::InterpolationOption::set ( const Value kind,
const bool  calculateErrors,
const bool  independentErrors 
)

Set the interpolation option.

Parameters
kindSet the type of interpolation on the call to apply
calculateErrorsWhether to calculate the interpolation errors
independentErrorsSets 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().

◆ validateInputSize()

std::string Mantid::Algorithms::InterpolationOption::validateInputSize ( const size_t  size) const

Validate the size of input histogram.

Parameters
sizenumber of points in the input histogram
Returns
an error message if there was one, otherwise an empty string

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().

Member Data Documentation

◆ m_calculateErrors

bool Mantid::Algorithms::InterpolationOption::m_calculateErrors
private

Definition at line 43 of file InterpolationOption.h.

Referenced by applyInPlace(), applyInplace(), and set().

◆ m_independentErrors

bool Mantid::Algorithms::InterpolationOption::m_independentErrors
private

Definition at line 44 of file InterpolationOption.h.

Referenced by applyInPlace(), applyInplace(), and set().

◆ m_value

Value Mantid::Algorithms::InterpolationOption::m_value = Value::Linear
private

Definition at line 42 of file InterpolationOption.h.

Referenced by applyInPlace(), applyInplace(), set(), and validateInputSize().


The documentation for this class was generated from the following files: