12 : m_allowEmpty(allowEmpty), m_allowRange(allowRange) {}
26 return "Enter values for this property";
33 return "When giving a range the second value must be larger than the "
38 if (
value.size() % 2 == 0) {
39 return "The number of bin boundary parameters provided must be odd";
44 return "Cannot have a zero bin width";
46 for (
size_t i = 1; i <
value.size(); i += 2) {
47 if (
value[i] == 0.0) {
48 return "Cannot have a zero bin width";
54 double previous =
value[0];
55 for (
size_t i = 2; i <
value.size(); i += 2) {
56 if ((
value[i - 1] < 0) && (previous <= 0)) {
57 return "Bin boundaries must be positive for logarithmic binning";
59 if (
value[i] <= previous) {
60 return "Bin boundary values must be given in order of increasing value";
double value
The value of the point.
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::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.