Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes

Patterns::Double Class Reference

Inheritance diagram for Patterns::Double:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Double (const double lower_bound=min_double_value, const double upper_bound=max_double_value)
virtual bool match (const std::string &test_string) const
virtual std::string description () const
virtual PatternBaseclone () const

Static Public Member Functions

static Doublecreate (const std::string &description)

Static Public Attributes

static const double min_double_value
static const double max_double_value

Private Attributes

const double lower_bound
const double upper_bound

Static Private Attributes

static const char * description_init

Detailed Description

Test for the string being a double. If bounds are given to the constructor, then the integer given also needs to be withing the interval specified by these bounds. Note that unlike common convention in the C++ standard library, both bounds of this interval are inclusive; the reason is that in practice in most cases, one needs closed intervals, but these can only be realized with inclusive bounds for non-integer values. We thus stay consistent by always using closed intervals.

If the upper bound given to the constructor is smaller than the lower bound, then the infinite interval is implied, i.e. every integer is allowed.

Giving bounds may be useful if for example a value can only be positive and less than a reasonable upper bound (for example damping parameters are frequently only reasonable if between zero and one), or in many other cases.

Definition at line 337 of file parameter_handler.h.


Constructor & Destructor Documentation

Patterns::Double::Double ( const double  lower_bound = min_double_value,
const double  upper_bound = max_double_value 
)

Constructor. Bounds can be specified within which a valid parameter has to be. If the upper bound is smaller than the lower bound, then the infinite interval is meant. The default values are chosen such that no bounds are enforced on parameters.


Member Function Documentation

virtual bool Patterns::Double::match ( const std::string &  test_string) const [virtual]

Return true if the string is a number and its value is within the specified range.

Implements Patterns::PatternBase.

virtual std::string Patterns::Double::description ( ) const [virtual]

Return a description of the pattern that valid strings are expected to match. If bounds were specified to the constructor, then include them into this description.

Implements Patterns::PatternBase.

virtual PatternBase* Patterns::Double::clone ( ) const [virtual]

Return a copy of the present object, which is newly allocated on the heap. Ownership of that object is transferred to the caller of this function.

Implements Patterns::PatternBase.

static Double* Patterns::Double::create ( const std::string &  description) [static]

Creates new object if the start of description matches description_init. Ownership of that object is transferred to the caller of this function.


Member Data Documentation

const double Patterns::Double::min_double_value [static]

Minimal double value. If the std::numeric_limits class is available use this information to obtain the extremal values, otherwise set it so that this class understands that all values are allowed.

Definition at line 350 of file parameter_handler.h.

const double Patterns::Double::max_double_value [static]

Maximal double value. If the numeric_limits class is available use this information to obtain the extremal values, otherwise set it so that this class understands that all values are allowed.

Definition at line 362 of file parameter_handler.h.

const double Patterns::Double::lower_bound [private]

Value of the lower bound. A number that satisfies the match operation of this class must be equal to this value or larger, if the bounds of the interval for a valid range.

Definition at line 430 of file parameter_handler.h.

const double Patterns::Double::upper_bound [private]

Value of the upper bound. A number that satisfies the match operation of this class must be equal to this value or less, if the bounds of the interval for a valid range.

Definition at line 442 of file parameter_handler.h.

const char* Patterns::Double::description_init [static, private]

Initial part of description

Definition at line 447 of file parameter_handler.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Mon May 21 2012 12:06:35 by doxygen 1.7.3