8#include "MantidHistogramData/Interpolate.h"
16std::string PROP_NAME(
"Interpolation");
17std::string LINEAR_OPT(
"Linear");
18std::string CSPLINE_OPT(
"CSpline");
19std::vector<std::string> OPTIONS{LINEAR_OPT, CSPLINE_OPT};
23using HistogramData::interpolateCSplineInplace;
24using HistogramData::interpolateLinearInplace;
25using HistogramData::minSizeForCSplineInterpolation;
26using HistogramData::minSizeForLinearInterpolation;
27using Kernel::Property;
39 const bool independentErrors) {
53 if (
kind == LINEAR_OPT) {
55 }
else if (
kind == CSPLINE_OPT) {
58 throw std::invalid_argument(
"InterpolationOption::set() - Unknown interpolation method '" +
kind +
"'");
73 return std::make_unique<StringProperty>(PROP_NAME, LINEAR_OPT, std::make_shared<StringListValidator>(OPTIONS));
80 return "Method of interpolation used to compute unsimulated values.";
92 nMin = minSizeForLinearInterpolation();
94 return "Linear interpolation requires at least " +
std::to_string(nMin) +
" points.";
98 nMin = minSizeForCSplineInterpolation();
100 return "CSpline interpolation requires at least " +
std::to_string(nMin) +
" points.";
104 return std::string();
121 throw std::runtime_error(
"InterpolationOption::applyInplace() - "
122 "Unimplemented interpolation method.");
141 throw std::runtime_error(
"InterpolationOption::applyInplace() - "
142 "Unimplemented interpolation method.");
Kind kind
The kind of the point: either openning or closing the range.
std::unique_ptr< Kernel::Property > property() const
Create a property suitable to attach to an algorithm to support interpolation.
std::string validateInputSize(const size_t size) const
Validate the size of input histogram.
void applyInPlace(const HistogramData::Histogram &in, HistogramData::Histogram &out) const
Apply the interpolation method to the output histogram.
void set(const Value &kind, const bool calculateErrors, const bool independentErrors)
Set the interpolation option.
std::string propertyDoc() const
void applyInplace(HistogramData::Histogram &inOut, size_t stepSize) const
Apply the interpolation method to the given histogram.
ListValidator is a validator that requires the value of a property to be one of a defined list of pos...
The concrete, templated class for properties.
Helper class which provides the Collimation Length for SANS instruments.
std::string to_string(const wide_integer< Bits, Signed > &n)