Reference documentation for deal.II version 8.5.1
|
#include <deal.II/base/parameter_handler.h>
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 OutputStyle style=Machine) const |
virtual PatternBase * | clone () const |
Public Member Functions inherited from Patterns::PatternBase | |
virtual | ~PatternBase () |
virtual std::size_t | memory_consumption () const |
Static Public Member Functions | |
static Double * | create (const std::string &description) |
Static Public Attributes | |
static const double | min_double_value = -std::numeric_limits<double>::max() |
static const double | max_double_value = std::numeric_limits<double>::max() |
Private Attributes | |
const double | lower_bound |
const double | upper_bound |
Static Private Attributes | |
static const char * | description_init = "[Double" |
Additional Inherited Members | |
Public Types inherited from Patterns::PatternBase | |
enum | OutputStyle { Machine, Text, LaTeX } |
Test for the string being a double
. If bounds are given to the constructor, then the integer given also needs to be within 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 every double precision number 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 244 of file parameter_handler.h.
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 entire set of double precision numbers is implied. The default values are chosen such that no bounds are enforced on parameters.
Definition at line 289 of file parameter_handler.cc.
|
virtual |
Return true
if the string is a number and its value is within the specified range.
Implements Patterns::PatternBase.
Definition at line 298 of file parameter_handler.cc.
|
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.
Definition at line 320 of file parameter_handler.cc.
|
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.
Definition at line 408 of file parameter_handler.cc.
|
static |
Creates a new object on the heap using new
if the given description
is a valid format (for example created by calling description() on an existing object), or NULL otherwise. Ownership of the returned object is transferred to the caller of this function, which should be freed using delete
.
Definition at line 415 of file parameter_handler.cc.
|
static |
Minimal double value used as default value, taken from std::numeric_limits
.
Definition at line 251 of file parameter_handler.h.
|
static |
Maximal double value used as default value, taken from std::numeric_limits
.
Definition at line 257 of file parameter_handler.h.
|
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 form a valid range.
Definition at line 305 of file parameter_handler.h.
|
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 form a valid range.
Definition at line 313 of file parameter_handler.h.
|
staticprivate |
Initial part of description
Definition at line 318 of file parameter_handler.h.