Zoltan2
|
A ParameterList validator for integer range lists. More...
#include <Zoltan2_IntegerRangeList.hpp>
Inherits ParameterEntryValidator.
Public Member Functions | |
IntegerRangeListValidator (bool unsorted=false) | |
Constructor: any Integral is valid. More... | |
IntegerRangeListValidator (Integral validMin, Integral validMax, bool unsorted=false) | |
Constructor: only Integrals in the specified range are valid. More... | |
const std::string | getXMLTypeName () const |
void | printDoc (std::string const &docString, std::ostream &out) const |
ValidStringsList | validStringValues () const |
void | validate (Teuchos::ParameterEntry const &entry, std::string const ¶mName, std::string const &sublistName) const |
void | validateAndModify (std::string const ¶mName, std::string const &sublistName, Teuchos::ParameterEntry *entry) const |
Integral | getAllowedMinimum () const |
Return the minimum value permitted in the list. More... | |
Integral | getAllowedMaximum () const |
Return the maximum value permitted in the list. More... | |
bool | inputListWillBeSorted () const |
Return whether the list is sorted or not. More... | |
A ParameterList validator for integer range lists.
An integer range list is a concise way to provide a list of integers. It is set as a string. Valid values are:
Examples:
A constructor flag determines how the list is processed at validateAndModify() time. Either the list is sorted and duplicates are removed, or the list remains as it was entered by the user. For example, if the list is to be modified:
- "1,5,2,1" becomes "1,2,5" - "1-10,9-15" becomes 1-15"
Typical use cases for an integer range list are:
At the call to validateAndModify(), the integer range list parameter value is changed from a string to an Array<Integral> which encodes the meaning of the string. (The last value in the array specifies whether the values are listed, whether the user requested "all", or whether the first and last value of a range is provided.)
Helper functions for interpreting the integer range list after it has been validated are:
The template parameter is the data type of the values in the list.
Definition at line 47 of file Zoltan2_IntegerRangeList.hpp.
Zoltan2::IntegerRangeListValidator< Integral >::IntegerRangeListValidator | ( | bool | unsorted = false | ) |
Constructor: any Integral is valid.
unsorted | normally the input integers will be sorted and duplicates will be removed. If this is not the desired behavior, then set unsorted to true. |
Definition at line 501 of file Zoltan2_IntegerRangeList.hpp.
Zoltan2::IntegerRangeListValidator< Integral >::IntegerRangeListValidator | ( | Integral | validMin, |
Integral | validMax, | ||
bool | unsorted = false |
||
) |
Constructor: only Integrals in the specified range are valid.
validMin | all values implied by the integer range list must be bounded by this minimum. |
validMax | all values implied by the integer range list must be bounded by this maximum. |
unsorted | normally the input integers will be sorted and duplicates will be removed.. If this is not the desired behavior, then set unsorted to true. |
Definition at line 507 of file Zoltan2_IntegerRangeList.hpp.
const std::string Zoltan2::IntegerRangeListValidator< Integral >::getXMLTypeName | ( | ) | const |
Definition at line 518 of file Zoltan2_IntegerRangeList.hpp.
void Zoltan2::IntegerRangeListValidator< Integral >::printDoc | ( | std::string const & | docString, |
std::ostream & | out | ||
) | const |
Definition at line 526 of file Zoltan2_IntegerRangeList.hpp.
ValidStringsList Zoltan2::IntegerRangeListValidator< Integral >::validStringValues | ( | ) | const |
Definition at line 542 of file Zoltan2_IntegerRangeList.hpp.
void Zoltan2::IntegerRangeListValidator< Integral >::validate | ( | Teuchos::ParameterEntry const & | entry, |
std::string const & | paramName, | ||
std::string const & | sublistName | ||
) | const |
Definition at line 548 of file Zoltan2_IntegerRangeList.hpp.
void Zoltan2::IntegerRangeListValidator< Integral >::validateAndModify | ( | std::string const & | paramName, |
std::string const & | sublistName, | ||
Teuchos::ParameterEntry * | entry | ||
) | const |
Definition at line 601 of file Zoltan2_IntegerRangeList.hpp.
|
inline |
Return the minimum value permitted in the list.
If getAllowedMinimum() > getAllowedMaximum(), then there are no limits on the integer values in the list.
Definition at line 421 of file Zoltan2_IntegerRangeList.hpp.
|
inline |
Return the maximum value permitted in the list.
If getAllowedMinimum() > getAllowedMaximum(), then there are no limits on the integer values in the list.
Definition at line 428 of file Zoltan2_IntegerRangeList.hpp.
|
inline |
Return whether the list is sorted or not.
By default, when the parameter value (a list of integers and integer ranges), is processed it is sorted and duplicates are removed. A constructor argument can be set so that the list is not sorted and duplicates are not removed.
Definition at line 436 of file Zoltan2_IntegerRangeList.hpp.