Zoltan2 Version of the Day
Public Member Functions
Zoltan2::IntegerRangeListValidator< Integral > Class Template Reference

A ParameterList validator for integer range lists. More...

#include <Zoltan2_IntegerRangeList.hpp>

List of all members.

Public Member Functions

 IntegerRangeListValidator (bool unsorted=false)
 Constructor: any Integral is valid.
 IntegerRangeListValidator (Integral validMin, Integral validMax, bool unsorted=false)
 Constructor: only Integrals in the specified range are valid.
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.
Integral getAllowedMaximum () const
 Return the maximum value permitted in the list.
bool inputListWillBeSorted () const
 Return whether the list is sorted or not.

Detailed Description

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

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:

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 389 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 532 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 538 of file Zoltan2_IntegerRangeList.hpp.


Member Function Documentation

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

Definition at line 549 of file Zoltan2_IntegerRangeList.hpp.

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

Definition at line 557 of file Zoltan2_IntegerRangeList.hpp.

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

Definition at line 573 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 579 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 632 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
Integral Zoltan2::IntegerRangeListValidator< Integral >::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 452 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
Integral Zoltan2::IntegerRangeListValidator< Integral >::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 459 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
bool Zoltan2::IntegerRangeListValidator< Integral >::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 467 of file Zoltan2_IntegerRangeList.hpp.


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