Zoltan2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
Zoltan2::IntegerRangeListValidator< T > Class Template Reference

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 &paramName, std::string const &sublistName) const
 
void validateAndModify (std::string const &paramName, 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...
 

Detailed Description

template<typename T>
class Zoltan2::IntegerRangeListValidator< T >

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 83 of file Zoltan2_IntegerRangeList.hpp.

Constructor & Destructor Documentation

template<typename Integral >
Zoltan2::IntegerRangeListValidator< Integral >::IntegerRangeListValidator ( bool  unsorted = false)

Constructor: any Integral is valid.

Parameters
unsortednormally 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 537 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
Zoltan2::IntegerRangeListValidator< Integral >::IntegerRangeListValidator ( Integral  validMin,
Integral  validMax,
bool  unsorted = false 
)

Constructor: only Integrals in the specified range are valid.

Parameters
validMinall values implied by the integer range list must be bounded by this minimum.
validMaxall values implied by the integer range list must be bounded by this maximum.
unsortednormally 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 543 of file Zoltan2_IntegerRangeList.hpp.

Member Function Documentation

template<typename Integral >
const std::string Zoltan2::IntegerRangeListValidator< Integral >::getXMLTypeName ( ) const

Definition at line 554 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
void Zoltan2::IntegerRangeListValidator< Integral >::printDoc ( std::string const &  docString,
std::ostream &  out 
) const

Definition at line 562 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
ValidStringsList Zoltan2::IntegerRangeListValidator< Integral >::validStringValues ( ) const

Definition at line 578 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
void Zoltan2::IntegerRangeListValidator< Integral >::validate ( Teuchos::ParameterEntry const &  entry,
std::string const &  paramName,
std::string const &  sublistName 
) const

Definition at line 584 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
void Zoltan2::IntegerRangeListValidator< Integral >::validateAndModify ( std::string const &  paramName,
std::string const &  sublistName,
Teuchos::ParameterEntry *  entry 
) const

Definition at line 637 of file Zoltan2_IntegerRangeList.hpp.

template<typename T >
Integral Zoltan2::IntegerRangeListValidator< T >::getAllowedMinimum ( ) const
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 457 of file Zoltan2_IntegerRangeList.hpp.

template<typename T >
Integral Zoltan2::IntegerRangeListValidator< T >::getAllowedMaximum ( ) const
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 464 of file Zoltan2_IntegerRangeList.hpp.

template<typename T >
bool Zoltan2::IntegerRangeListValidator< T >::inputListWillBeSorted ( ) const
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 472 of file Zoltan2_IntegerRangeList.hpp.


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