14 : m_allowEmpty(allowEmpty), m_allowRange(allowRange) {}
28 std::string
error =
"";
29 size_t numParams =
value.size();
33 error =
"Enter values for this property";
37 if (
value[0] == 0.0) {
38 error =
"Cannot have a zero bin width";
44 error =
"When giving a range the second value must be larger than the first";
47 error =
"The number of bin boundary parameters provided must be odd";
52 if (
value.size() % 2 == 0) {
53 error =
"The number of bin boundary parameters provided must be odd";
55 std::size_t numBins = 0;
58 }
catch (std::runtime_error &e) {
62 std::size_t binSpaceInBytes = numBins *
sizeof(double);
double value
The value of the point.
This class is responsible for memory statistics.
std::string checkAvailableMemory(std::size_t const requestedMemoryBytes) const
Check if there is enough space in memory to hold the requested amount of memory.
IValidator_sptr clone() const override
std::string checkValidity(const std::vector< double > &value) const override
Check on the inputed bin boundaries and widths.
RebinParamsValidator(bool allowEmpty=false, bool allowRange=false)
std::size_t MANTID_KERNEL_DLL estimateNumberOfBins(std::vector< double > const ¶ms, double const power=-1)
Returns a size_t with the estimated number of bins that would be needed for a rebinning operation.
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.