Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
|
A list of parameters of arbitrary type. More...
#include <Teuchos_ParameterList.hpp>
Classes | |
class | PrintOptions |
Utility class for setting and passing in print options. More... | |
Private Types | |
typedef StringIndexedOrderedValueObjectContainer < ParameterEntry > | params_t |
Internal data-structure. More... | |
typedef params_t::Iterator | Iterator |
Parameter container iterator typedef. More... | |
Private Member Functions | |
Iterator | nonconstBegin () |
An iterator pointing to the first entry. More... | |
Iterator | nonconstEnd () |
An iterator pointing beyond the last entry. More... | |
ParameterEntry & | nonconstEntry (Iterator i) |
Access to ParameterEntry (i.e., returns i->second) More... | |
void | validateEntryExists (const std::string &funcName, const std::string &name, const ParameterEntry *entry) const |
Validate that a parameter exists. More... | |
template<typename T > | |
void | validateEntryType (const std::string &funcName, const std::string &name, const ParameterEntry &entry) const |
Validate that a type is the same. More... | |
void | validateEntryIsList (const std::string &name, const ParameterEntry &entry) const |
Validate a sublist param is indeed a sublist. More... | |
void | validateMissingSublistMustExist (const std::string &baselist_name, const std::string &sublist_name, const bool mustAlreadyExist) const |
Throw a sublist does not exist exception. More... | |
void | updateSubListNames (int depth=0) |
Update sublist names recursively. More... | |
Private Attributes | |
std::string | name_ |
Name of the (sub)list. More... | |
params_t | params_ |
Parameter list. More... | |
bool | disableRecursiveValidation_ |
Validate into list or not. More... | |
Related Functions | |
(Note that these are not member functions.) | |
enum | EValidateUsed { VALIDATE_USED_ENABLED, VALIDATE_USED_DISABLED } |
Validation used enum. More... | |
enum | EValidateDefaults { VALIDATE_DEFAULTS_ENABLED, VALIDATE_DEFAULTS_DISABLED } |
Validation defaults enum. More... | |
RCP< ParameterList > | parameterList () |
Nonmember constructor. More... | |
RCP< ParameterList > | parameterList (const std::string &name) |
Nonmember constructor. More... | |
RCP< ParameterList > | parameterList (const ParameterList &source) |
Nonmember constructor. More... | |
RCP< ParameterList > | createParameterList () |
Nonmember constructor. More... | |
RCP< ParameterList > | createParameterList (const std::string &name) |
Nonmember constructor. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT bool | operator== (const ParameterList &list1, const ParameterList &list2) |
Returns true if two parameter lists are the same. More... | |
bool | operator!= (const ParameterList &list1, const ParameterList &list2) |
Returns true if two parameter lists are not the same. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT bool | haveSameValues (const ParameterList &list1, const ParameterList &list2, bool verbose=false) |
Returns true if two parameter lists have the same values. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT bool | haveSameValuesSorted (const ParameterList &list1, const ParameterList &list2, bool verbose=false) |
Returns true if two parameter lists have the same values independent of ordering. More... | |
template<typename T > | |
T & | getParameter (ParameterList &l, const std::string &name) |
A templated helper function for getting a parameter from a non-const list. This helper function prevents the need for giving a nominal value of the specific template type. More... | |
template<typename T > | |
T & | get (ParameterList &l, const std::string &name) |
A shorter name for getParameter() . More... | |
template<typename T > | |
const T & | getParameter (const ParameterList &l, const std::string &name) |
A templated helper function for getting a parameter from a const list. This helper function prevents the need for giving a nominal value of the specific template type. More... | |
template<typename T > | |
T * | getParameterPtr (ParameterList &l, const std::string &name) |
A templated helper function for getting a pointer to a parameter from a non-const list, if it exists. This helper function prevents the need for giving a nominal value of the specific template type. More... | |
template<typename T > | |
const T * | getParameterPtr (const ParameterList &l, const std::string &name) |
A templated helper function for getting a pointer to a parameter from a non-const list, if it exists. This helper function prevents the need for giving a nominal value of the specific template type. More... | |
template<typename T > | |
bool | isParameterType (ParameterList &l, const std::string &name) |
A templated helper function for determining the type of a parameter entry for a non-const list. This helper function avoids the need for giving a nominal value of the specific template type. More... | |
template<typename T > | |
bool | isParameterType (const ParameterList &l, const std::string &name) |
A templated helper function for determining the type of a parameter entry for a const list. This helper function avoids the need for giving a nominal value of the specific template type. More... | |
template<typename T > | |
void | setStringParameterFromArray (const std::string ¶mName, const Array< T > &array, ParameterList *paramList) |
Set a std::string parameter representation of an array. More... | |
template<typename T > | |
Array< T > | getArrayFromStringParameter (const ParameterList ¶mList, const std::string ¶mName, const int arrayDim=-1, const bool mustExist=true) |
Get an Array object (with entries of type T ) from a parameter holding a std::string representation of the array. More... | |
RCP< ParameterList > | sublist (const RCP< ParameterList > ¶mList, const std::string &name, bool mustAlreadyExist=false, const std::string &docString="") |
Return a RCP to a sublist in another RCP-ed parameter list. More... | |
RCP< const ParameterList > | sublist (const RCP< const ParameterList > ¶mList, const std::string &name) |
Return a RCP to a sublist in another RCP-ed parameter list. More... | |
std::ostream & | operator<< (std::ostream &os, const ParameterList &l) |
Output stream operator for handling the printing of the parameter list. More... | |
template<class IntegralType > | |
void | setStringToIntegralParameter (std::string const ¶mName, std::string const &defaultValue, std::string const &docString, ArrayView< const std::string > const &strings, ParameterList *paramList) |
Set up a std::string parameter that will use an embedded validator to allow the extraction of an integral value. More... | |
template<class IntegralType > | |
void | setStringToIntegralParameter (std::string const ¶mName, std::string const &defaultValue, std::string const &docString, ArrayView< const std::string > const &strings, ArrayView< const IntegralType > const &integralValues, ParameterList *paramList) |
Set up a std::string parameter that will use an embedded validator to allow the extraction of an integral value from a list of integral values. More... | |
template<class IntegralType > | |
void | setStringToIntegralParameter (std::string const ¶mName, std::string const &defaultValue, std::string const &docString, ArrayView< const std::string > const &strings, ArrayView< const std::string > const &stringsDocs, ArrayView< const IntegralType > const &integralValues, ParameterList *paramList) |
Set up a std::string parameter with documentation strings for each valid value that will use an embedded validator to allow the extraction of an integral value from a list of integral values. More... | |
template<class IntegralType > | |
IntegralType | getIntegralValue (ParameterList const ¶mList, std::string const ¶mName) |
Get an integral value for a parameter that is assumed to already be set. More... | |
template<class IntegralType > | |
std::string | getStringValue (ParameterList const ¶mList, std::string const ¶mName) |
Get a std::string value for a parameter that is assumed to already be set. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | setIntParameter (std::string const ¶mName, int const value, std::string const &docString, ParameterList *paramList, AnyNumberParameterEntryValidator::AcceptedTypes const &acceptedTypes=AnyNumberParameterEntryValidator::AcceptedTypes()) |
Set an integer parameter that allows for (nearly) any input parameter type that is convertible to an int. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | setLongLongParameter (std::string const ¶mName, long long const value, std::string const &docString, ParameterList *paramList, AnyNumberParameterEntryValidator::AcceptedTypes const &acceptedTypes=AnyNumberParameterEntryValidator::AcceptedTypes()) |
Set an integer parameter that allows for (nearly) any input parameter type that is convertible to an int. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | setDoubleParameter (std::string const ¶mName, double const &value, std::string const &docString, ParameterList *paramList, AnyNumberParameterEntryValidator::AcceptedTypes const &acceptedTypes=AnyNumberParameterEntryValidator::AcceptedTypes()) |
Set an double parameter that allows for (nearly) any input parameter type that is convertible to a double. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | setNumericStringParameter (std::string const ¶mName, std::string const &value, std::string const &docString, ParameterList *paramList, AnyNumberParameterEntryValidator::AcceptedTypes const &acceptedTypes=AnyNumberParameterEntryValidator::AcceptedTypes()) |
Set an numeric parameter preferred as a std::string that allows for (nearly) any input parameter type that is convertible to a std::string. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT int | getIntParameter (ParameterList const ¶mList, std::string const ¶mName) |
Get an integer parameter. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT long long | getLongLongParameter (ParameterList const ¶mList, std::string const ¶mName) |
Get a long long parameter. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT double | getDoubleParameter (ParameterList const ¶mList, std::string const ¶mName) |
Get double integer parameter. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT std::string | getNumericStringParameter (ParameterList const ¶mList, std::string const ¶mName) |
Get std::string numeric parameter. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | updateParametersFromXmlFile (const std::string &xmlFileName, const Ptr< ParameterList > ¶mList) |
Reads XML parameters from a file and updates those already in the given parameter list. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< ParameterList > | getParametersFromXmlFile (const std::string &xmlFileName) |
Reads XML parameters from a file and return them in a new parameter list. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< ParameterList > | getParametersFromXmlFile (const std::string &xmlFileName, RCP< DependencySheet > depSheet) |
Reads XML parameters from a file and return them in a new parameter list. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | updateParametersFromXmlString (const std::string &xmlStr, const Ptr< ParameterList > ¶mList, bool overwrite=true) |
Reads XML parameters from a std::string and updates those already in the given parameter list. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< ParameterList > | getParametersFromXmlString (const std::string &xmlStr) |
Reads XML parameters from a std::string and return them in a new parameter list. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< ParameterList > | getParametersFromXmlString (const std::string &xmlStr, RCP< DependencySheet > depSheet) |
Reads XML parameters from a std::string and return them in a new parameter list. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | writeParameterListToXmlOStream (const ParameterList ¶mList, std::ostream &xmlOut, RCP< const DependencySheet > depSheet=null) |
Write parameters and sublists in XML format to an std::ostream. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | writeParameterListToXmlFile (const ParameterList ¶mList, const std::string &xmlFileName, RCP< const DependencySheet > depSheet=null) |
Write parameters and sublist to an XML file. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | updateParametersFromYamlFile (const std::string &yamlFileName, const Ptr< ParameterList > ¶mList) |
Reads Yaml parameters from a file and updates those already in the given parameter list. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< ParameterList > | getParametersFromYamlFile (const std::string &yamlFileName) |
Reads Yaml parameters from a file and return them in a new parameter list. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | updateParametersFromYamlString (const std::string &yamlStr, const Ptr< ParameterList > ¶mList, bool overwrite, const std::string &name="") |
Reads Yaml parameters from a std::string and updates those already in the given parameter list. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< ParameterList > | getParametersFromYamlString (const std::string &yamlStr) |
Reads Yaml parameters from a std::string and return them in a new parameter list. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | writeParameterListToYamlOStream (const ParameterList ¶mList, std::ostream &yamlOut) |
Write parameters and sublists in Yaml format to an std::ostream. More... | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | writeParameterListToYamlFile (const ParameterList ¶mList, const std::string &yamlFileName) |
Write parameters and sublist to an Yaml file. More... | |
TEUCHOSCOMM_LIB_DLL_EXPORT void | updateParametersAndBroadcast (const Ptr< ParameterList > &inParamList, const Ptr< ParameterList > &ParamList, const Comm< int > &comm, int root, bool overwrite=true) |
On processor rank = root, broadcast the inParamList to all other processors. Then update the given parameter list with these values. More... | |
TEUCHOSCOMM_LIB_DLL_EXPORT void | updateParametersFromXmlFileAndBroadcast (const std::string &xmlFileName, const Ptr< ParameterList > ¶mList, const Comm< int > &comm, bool overwrite=true) |
On processor rank = 0, reads XML parameters from a file and broadcasts them to all other processors. Then updates the given parameter list with these values. More... | |
TEUCHOSCOMM_LIB_DLL_EXPORT void | updateParametersFromYamlFileAndBroadcast (const std::string &yamlFileName, const Teuchos::Ptr< Teuchos::ParameterList > ¶mList, const Teuchos::Comm< int > &comm, bool overwrite=true) |
On processor rank = 0, reads Yaml parameters from a file and broadcasts them to all other processors. Then updates the given parameter list with these values. More... | |
Public types | |
typedef params_t::ConstIterator | ConstIterator |
Parameter container const iterator typedef. More... | |
Constructors/Destructor/Info. | |
ParameterList () | |
Constructor. More... | |
ParameterList (const std::string &name) | |
Constructor that names the entire parameter list. More... | |
ParameterList (const ParameterList &source) | |
Copy constructor. More... | |
virtual | ~ParameterList () |
Destructor. More... | |
Ordinal | numParams () const |
Get the number of stored parameters. More... | |
Set Functions | |
ParameterList & | setName (const std::string &name) |
Set the name of *this list. More... | |
ParameterList & | operator= (const ParameterList &source) |
Replace the current parameter list with source . More... | |
ParameterList & | setParameters (const ParameterList &source) |
ParameterList & | setParametersNotAlreadySet (const ParameterList &source) |
ParameterList & | disableRecursiveValidation () |
template<typename T > | |
ParameterList & | set (std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null) |
Set a parameter whose value has type T. More... | |
ParameterList & | set (std::string const &name, char value[], std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null) |
Specialization of set() for a parameter which is a char[] . More... | |
ParameterList & | set (std::string const &name, const char value[], std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null) |
Specialization of set() for a parameter which is a const char[] . More... | |
ParameterList & | set (std::string const &name, ParameterList const &value, std::string const &docString="") |
Specialization of set() for a parameter which is itself a ParameterList. More... | |
ParameterList & | setEntry (const std::string &name, const ParameterEntry &entry) |
Set a parameter directly as a ParameterEntry. More... | |
Get Functions | |
template<typename T > | |
T & | get (const std::string &name, T def_value) |
Return the parameter's value, or the default value if it is not there. More... | |
std::string & | get (const std::string &name, char def_value[]) |
Specialization of get(), where the nominal value is a character string. Both char* and std::string are stored as strings and return std::string values. More... | |
std::string & | get (const std::string &name, const char def_value[]) |
Specialization of get(), where the nominal value is a character string. Both char* and std::string are stored as strings and return std::string values. More... | |
template<typename T > | |
T & | get (const std::string &name) |
Get a nonconst reference to the parameter. More... | |
template<typename T > | |
const T & | get (const std::string &name) const |
Get a const reference to the parameter. More... | |
template<typename T > | |
T * | getPtr (const std::string &name) |
Retrieves the pointer for parameter name of type T from a list. A null pointer is returned if this parameter doesn't exist or is the wrong type. More... | |
template<typename T > | |
const T * | getPtr (const std::string &name) const |
Retrieves the pointer for parameter name of type T from a constant list. A null pointer is returned if this parameter doesn't exist or is the wrong type. More... | |
ParameterEntry & | getEntry (const std::string &name) |
Retrieves an entry with the name name . More... | |
const ParameterEntry & | getEntry (const std::string &name) const |
Retrieves a const entry with the name name . More... | |
ParameterEntry * | getEntryPtr (const std::string &name) |
Retrieves the pointer for an entry with the name name if it exists. More... | |
const ParameterEntry * | getEntryPtr (const std::string &name) const |
Retrieves the pointer for a constant entry with the name name if it exists. More... | |
RCP< ParameterEntry > | getEntryRCP (const std::string &name) |
Retrieves the RCP for an entry with the name name if it exists. More... | |
RCP< const ParameterEntry > | getEntryRCP (const std::string &name) const |
Retrieves the RCP for a constant entry with the name name if it exists. More... | |
Parameter removal functions | |
bool | remove (std::string const &name, bool throwIfNotExists=true) |
Remove a parameter (does not depend on the type of the parameter). More... | |
Sublist Functions | |
ParameterList & | sublist (const std::string &name, bool mustAlreadyExist=false, const std::string &docString="") |
Creates an empty sublist and returns a reference to the sublist name . If the list already exists, returns reference to that sublist. If the name exists but is not a sublist, an std::exception is thrown. More... | |
const ParameterList & | sublist (const std::string &name) const |
Return a const reference to an existing sublist name . If the list does not already exist or the name exists but is not a sublist, an std::exception is thrown. More... | |
Attribute Functions | |
const std::string & | name () const |
The name of this ParameterList. More... | |
bool | isParameter (const std::string &name) const |
Whether the given parameter exists in this list. More... | |
bool | isSublist (const std::string &name) const |
Whether the given sublist exists in this list. More... | |
template<typename T > | |
bool | isType (const std::string &name) const |
Whether the given parameter exists in this list and has type T. More... | |
I/O Functions | |
void | print () const |
Print function to use in debugging in a debugger. More... | |
std::ostream & | print (std::ostream &os, const PrintOptions &printOptions) const |
Printing method for parameter lists which takes an print options object. More... | |
std::ostream & | print (std::ostream &os, int indent=0, bool showTypes=false, bool showFlags=true) const |
Printing method for parameter lists. Indenting is used to indicate parameter list hierarchies. More... | |
void | unused (std::ostream &os) const |
Print out unused parameters in the ParameterList. More... | |
std::string | currentParametersString () const |
Create a single formated std::string of all of the zero-level parameters in this list. More... | |
Read-only access to the iterator | |
ConstIterator | begin () const |
An iterator pointing to the first entry. More... | |
ConstIterator | end () const |
An iterator pointing beyond the last entry. More... | |
const std::string & | name (ConstIterator i) const |
Access to name (i.e., returns i->first) More... | |
const ParameterEntry & | entry (ConstIterator i) const |
Access to ParameterEntry (i.e., returns i->second) More... | |
Validation Functions | |
void | validateParameters (ParameterList const &validParamList, int const depth=1000, EValidateUsed const validateUsed=VALIDATE_USED_ENABLED, EValidateDefaults const validateDefaults=VALIDATE_DEFAULTS_ENABLED) const |
Validate the parameters in this list given valid selections in the input list. More... | |
void | validateParametersAndSetDefaults (ParameterList const &validParamList, int const depth=1000) |
Validate the parameters in this list given valid selections in the input list and set defaults for those not set. More... | |
A list of parameters of arbitrary type.
A ParameterList is a map from parameter name (a string) to its value. The value may have any type with value semantics (see explanation and examples below). This includes another ParameterList, which allows a ParameterList to encode a hierarchy of parameters. Different entries in the same ParameterList may have values of different types.
Users may add a parameter using one of the get() methods, and retrieve its value (given the parameter's name) using one of the set() methods. If the compiler gets confused when you use one of the templated methods, you might have to help it by specifying the type explicitly, or by casting the input object (using e.g., static_cast
). There are also methods for iterating through all the parameters in a list, and for validating parameters using validators that you may define for each parameter.
A type has value semantics when it can be passed around as a value. This means that it has an assignment operator and a copy constructor, and that the latter creates "new objects" (rather than references that modify a single object). Types with value semantics include double
, float
, int
, std::string
, and similar types.
Paradoxically, pointers like double*
also have value semantics. While the pointer is a reference to an object (e.g., an array of double
), the pointer itself is a value (an address in memory). The same holds for Teuchos' reference-counted pointer and array classes (RCP resp. ArrayRCP). While it is valid to store pointers ("raw" or reference-counted) in a ParameterList, be aware that this hinders serialization. For example, a double*
could encode a single double
or an array of double
. The pointer itself does not encode the length of the array. A ParameterList serializer has no way to know what the double*
means. ParameterList does not forbid you from storing objects that cannot be correctly serialized, so you have to know whether or not this concerns you.
Definition at line 132 of file Teuchos_ParameterList.hpp.
|
private |
Internal data-structure.
Definition at line 135 of file Teuchos_ParameterList.hpp.
|
private |
Parameter container iterator typedef.
Definition at line 138 of file Teuchos_ParameterList.hpp.
Parameter container const iterator typedef.
Definition at line 146 of file Teuchos_ParameterList.hpp.
Teuchos::ParameterList::ParameterList | ( | ) |
Constructor.
Definition at line 80 of file Teuchos_ParameterList.cpp.
Teuchos::ParameterList::ParameterList | ( | const std::string & | name | ) |
Constructor that names the entire parameter list.
Definition at line 85 of file Teuchos_ParameterList.cpp.
Teuchos::ParameterList::ParameterList | ( | const ParameterList & | source | ) |
Copy constructor.
Definition at line 90 of file Teuchos_ParameterList.cpp.
|
virtual |
Destructor.
Definition at line 98 of file Teuchos_ParameterList.cpp.
Ordinal Teuchos::ParameterList::numParams | ( | ) | const |
Get the number of stored parameters.
Definition at line 102 of file Teuchos_ParameterList.cpp.
|
inline |
Set the name of *this
list.
Definition at line 834 of file Teuchos_ParameterList.hpp.
ParameterList & Teuchos::ParameterList::operator= | ( | const ParameterList & | source | ) |
Replace the current parameter list with source
.
this->name()
Definition at line 108 of file Teuchos_ParameterList.cpp.
ParameterList & Teuchos::ParameterList::setParameters | ( | const ParameterList & | source | ) |
Set the parameters in source
.
This function will set the parameters and sublists from source
into *this
, but will not remove parameters from *this
. Parameters in *this
with the same names as those in source
will be overwritten.
Definition at line 119 of file Teuchos_ParameterList.cpp.
ParameterList & Teuchos::ParameterList::setParametersNotAlreadySet | ( | const ParameterList & | source | ) |
Set the parameters in source
that are not already set in *this
.
Note, this function will set the parameters and sublists from source
into *this
but will not result in parameters being removed from *this
or in parameters already set in *this
being overrided. Parameters in *this
with the same names as those in source
will not be overwritten.
Definition at line 137 of file Teuchos_ParameterList.cpp.
ParameterList & Teuchos::ParameterList::disableRecursiveValidation | ( | ) |
Disallow recusive validation when this sublist is used in a valid parameter list.
This function should be called when setting a sublist in a valid parameter list which is broken off to be passed to another object. The other object should validate its own list.
Definition at line 162 of file Teuchos_ParameterList.cpp.
|
inline |
Set a parameter whose value has type T.
name | [in] The parameter's name. |
value | [in] The parameter's value. This determines the template parameter T. In most cases, you will not need to specify the type T explicitly; the compiler will infer it from this argument. |
docString | [in] Documentation string for the parameter. |
validator | [in] Validator for the parameter. If not specified, it defaults to null , the trivial validator (every value passes validation). |
Definition at line 846 of file Teuchos_ParameterList.hpp.
|
inline |
Specialization of set() for a parameter which is a char[]
.
This version of set() copies the given character array to an std::string
and stores it that way in the ParameterList.
Definition at line 879 of file Teuchos_ParameterList.hpp.
ParameterList& Teuchos::ParameterList::set | ( | std::string const & | name, |
const char | value[], | ||
std::string const & | docString = "" , |
||
RCP< const ParameterEntryValidator > const & | validator = null |
||
) |
Specialization of set() for a parameter which is a const char[]
.
This version of set() copies the given character array to an std::string
and stores it that way in the ParameterList.
|
inline |
Specialization of set() for a parameter which is itself a ParameterList.
We call the input ParameterList a sublist of *this
.
Definition at line 895 of file Teuchos_ParameterList.hpp.
|
inline |
Set a parameter directly as a ParameterEntry.
Definition at line 905 of file Teuchos_ParameterList.hpp.
T & Teuchos::ParameterList::get | ( | const std::string & | name, |
T | def_value | ||
) |
Return the parameter's value, or the default value if it is not there.
If the parameter with the given name exists in this ParameterList and has type T, return the parameter's value. If the parameter exists but does not have type T, throw an exception. Otherwise, if the parameter does not exist, add it to the list with value def_value
, and return def_value
.
name
exists, but is not of type T
. Definition at line 916 of file Teuchos_ParameterList.hpp.
|
inline |
Specialization of get(), where the nominal value is a character string. Both char* and std::string are stored as strings and return std::string values.
Definition at line 931 of file Teuchos_ParameterList.hpp.
std::string& Teuchos::ParameterList::get | ( | const std::string & | name, |
const char | def_value[] | ||
) |
Specialization of get(), where the nominal value is a character string. Both char* and std::string are stored as strings and return std::string values.
T & Teuchos::ParameterList::get | ( | const std::string & | name | ) |
Get a nonconst reference to the parameter.
name | [in] The name of the parameter. |
If the given parameter is not in the list at all, this method throws Exceptions::InvalidParameter. If the parameter is in the list but does not have type T, this method throws Exceptions::InvalidParameterType. Both exceptions are subclasses of Exceptions::InvalidParameter.
You may use the returned reference to modify the parameter's value in the list directly.
When you call this method, you must specify the type T explicitly. For example:
If the type T is itself a template parameter in your code, you must use the template
keyword. For example:
Definition at line 941 of file Teuchos_ParameterList.hpp.
const T & Teuchos::ParameterList::get | ( | const std::string & | name | ) | const |
Get a const reference to the parameter.
name | [in] The name of the parameter. |
If the given parameter is not in the list at all, this method throws Exceptions::InvalidParameter. If the parameter is in the list but does not have type T, this method throws Exceptions::InvalidParameterType. Both exceptions are subclasses of Exceptions::InvalidParameter.
When you call this method, you must specify the type T explicitly. For example:
If the type T is itself a template parameter in your code, you must use the template
keyword. For example:
Definition at line 951 of file Teuchos_ParameterList.hpp.
|
inline |
Retrieves the pointer for parameter name
of type T
from a list. A null pointer is returned if this parameter doesn't exist or is the wrong type.
list.template getPtr<int>( "Iters" )
Definition at line 962 of file Teuchos_ParameterList.hpp.
|
inline |
Retrieves the pointer for parameter name
of type T
from a constant list. A null pointer is returned if this parameter doesn't exist or is the wrong type.
list.template getPtr<int>( "Iters" )
Definition at line 983 of file Teuchos_ParameterList.hpp.
|
inline |
Retrieves an entry with the name name
.
Throws Exceptions::InvalidParameterName
if this parameter does not exist.
Definition at line 1000 of file Teuchos_ParameterList.hpp.
|
inline |
Retrieves a const entry with the name name
.
Throws Exceptions::InvalidParameterName
if this parameter does not exist.
Definition at line 1009 of file Teuchos_ParameterList.hpp.
|
inline |
Retrieves the pointer for an entry with the name name
if it exists.
Definition at line 1019 of file Teuchos_ParameterList.hpp.
|
inline |
Retrieves the pointer for a constant entry with the name name
if it exists.
Definition at line 1032 of file Teuchos_ParameterList.hpp.
|
inline |
Retrieves the RCP for an entry with the name name
if it exists.
Definition at line 1044 of file Teuchos_ParameterList.hpp.
|
inline |
Retrieves the RCP for a constant entry with the name name
if it exists.
Definition at line 1056 of file Teuchos_ParameterList.hpp.
bool Teuchos::ParameterList::remove | ( | std::string const & | name, |
bool | throwIfNotExists = true |
||
) |
Remove a parameter (does not depend on the type of the parameter).
[in] | name | The name of the parameter to remove |
[in] | throwIfNotExists | If true then if the parameter with the name name does not exist then a std::exception will be thrown! |
true
if the parameter was removed, and false
if the parameter was not removed (false
return value possible only if throwIfNotExists==false
). Definition at line 220 of file Teuchos_ParameterList.cpp.
ParameterList & Teuchos::ParameterList::sublist | ( | const std::string & | name, |
bool | mustAlreadyExist = false , |
||
const std::string & | docString = "" |
||
) |
Creates an empty sublist and returns a reference to the sublist name
. If the list already exists, returns reference to that sublist. If the name exists but is not a sublist, an std::exception is thrown.
Definition at line 239 of file Teuchos_ParameterList.cpp.
const ParameterList & Teuchos::ParameterList::sublist | ( | const std::string & | name | ) | const |
Return a const reference to an existing sublist name
. If the list does not already exist or the name exists but is not a sublist, an std::exception is thrown.
Definition at line 275 of file Teuchos_ParameterList.cpp.
|
inline |
The name of this ParameterList.
Definition at line 1071 of file Teuchos_ParameterList.hpp.
bool Teuchos::ParameterList::isParameter | ( | const std::string & | name | ) | const |
Whether the given parameter exists in this list.
Return true if a parameter with name name
exists in this list, else return false.
Definition at line 209 of file Teuchos_ParameterList.cpp.
bool Teuchos::ParameterList::isSublist | ( | const std::string & | name | ) | const |
Whether the given sublist exists in this list.
Return true if a parameter with name name
exists in this list, and is itself a ParameterList. Otherwise, return false.
Definition at line 198 of file Teuchos_ParameterList.cpp.
bool Teuchos::ParameterList::isType | ( | const std::string & | name | ) | const |
Whether the given parameter exists in this list and has type T.
Return true if a parameter with name name
exists in this list and has type T. Otherwise, return false.
Definition at line 1092 of file Teuchos_ParameterList.hpp.
void Teuchos::ParameterList::print | ( | ) | const |
Print function to use in debugging in a debugger.
Prints to *VerboseObjectBase::getDefaultOStream() so it will print well in parallel.
Definition at line 291 of file Teuchos_ParameterList.cpp.
std::ostream & Teuchos::ParameterList::print | ( | std::ostream & | os, |
const PrintOptions & | printOptions | ||
) | const |
Printing method for parameter lists which takes an print options object.
Definition at line 297 of file Teuchos_ParameterList.cpp.
std::ostream & Teuchos::ParameterList::print | ( | std::ostream & | os, |
int | indent = 0 , |
||
bool | showTypes = false , |
||
bool | showFlags = true |
||
) | const |
Printing method for parameter lists. Indenting is used to indicate parameter list hierarchies.
Definition at line 353 of file Teuchos_ParameterList.cpp.
void Teuchos::ParameterList::unused | ( | std::ostream & | os | ) | const |
Print out unused parameters in the ParameterList.
Definition at line 169 of file Teuchos_ParameterList.cpp.
std::string Teuchos::ParameterList::currentParametersString | ( | ) | const |
Create a single formated std::string of all of the zero-level parameters in this list.
Definition at line 180 of file Teuchos_ParameterList.cpp.
|
inline |
An iterator pointing to the first entry.
Definition at line 1101 of file Teuchos_ParameterList.hpp.
|
inline |
An iterator pointing beyond the last entry.
Definition at line 1107 of file Teuchos_ParameterList.hpp.
|
inline |
Access to name (i.e., returns i->first)
Definition at line 1113 of file Teuchos_ParameterList.hpp.
|
inline |
Access to ParameterEntry (i.e., returns i->second)
Definition at line 1119 of file Teuchos_ParameterList.hpp.
void Teuchos::ParameterList::validateParameters | ( | ParameterList const & | validParamList, |
int const | depth = 1000 , |
||
EValidateUsed const | validateUsed = VALIDATE_USED_ENABLED , |
||
EValidateDefaults const | validateDefaults = VALIDATE_DEFAULTS_ENABLED |
||
) | const |
Validate the parameters in this list given valid selections in the input list.
validParamList | [in] This is the list that the parameters and sublist in *this are compared against. |
depth | [in] Determines the number of levels of depth that the validation will recurse into. A value of depth=0 means that only the top level parameters and sublists will be checked. Default: depth = large number . |
validateUsed | [in] Determines if parameters that have been used are checked against those in validParamList . Default: validateDefaults = VALIDATE_DEFAULTS_ENABLED . |
validateDefaults | [in] Determines if parameters set at their default values using get(name,defaultVal) are checked against those in validParamList . Default: validateDefaults = VALIDATE_DEFAULTS_ENABLED . |
If a parameter in *this
is not found in validParamList
then an std::exception
of type Exceptions::InvalidParameterName
will be thrown which will contain an excellent error message returned by excpt.what()
. If the parameter exists but has the wrong type, then an std::exception type Exceptions::InvalidParameterType
will be thrown. If the parameter exists and has the right type, but the value is not valid then an std::exception type Exceptions::InvalidParameterValue
will be thrown.
Recursive validation stops when:
The maxinum depth
is reached
A sublist note in validParamList
has been marked with the disableRecursiveValidation()
function, or
There are not more parameters or sublists left in *this
A breath-first search is performed to validate all of the parameters in one sublist before moving into nested subslist.
Definition at line 359 of file Teuchos_ParameterList.cpp.
void Teuchos::ParameterList::validateParametersAndSetDefaults | ( | ParameterList const & | validParamList, |
int const | depth = 1000 |
||
) |
Validate the parameters in this list given valid selections in the input list and set defaults for those not set.
validParamList | [in] This is the list that the parameters and sublist in *this are compared against. |
depth | [in] Determines the number of levels of depth that the validation will recurse into. A value of depth=0 means that only the top level parameters and sublists will be checked. Default: depth = large number . |
If a parameter in *this
is not found in validParamList
then an std::exception of type Exceptions::InvalidParameterName
will be thrown which will contain an excellent error message returned by excpt.what()
. If the parameter exists but has the wrong type, then an std::exception type Exceptions::InvalidParameterType
will be thrown. If the parameter exists and has the right type, but the value is not valid then an std::exception type Exceptions::InvalidParameterValue
will be thrown. If a parameter in validParamList
does not exist in *this
, then it will be set at its default value as determined by validParamList
.
Recursive validation stops when:
The maxinum depth
is reached
A sublist note in validParamList
has been marked with the disableRecursiveValidation()
function, or
There are not more parameters or sublists left in *this
A breath-first search is performed to validate all of the parameters in one sublist before moving into nested subslist.
Definition at line 460 of file Teuchos_ParameterList.cpp.
|
inlineprivate |
An iterator pointing to the first entry.
Definition at line 1128 of file Teuchos_ParameterList.hpp.
|
inlineprivate |
An iterator pointing beyond the last entry.
Definition at line 1134 of file Teuchos_ParameterList.hpp.
|
inlineprivate |
Access to ParameterEntry (i.e., returns i->second)
Definition at line 1140 of file Teuchos_ParameterList.hpp.
|
private |
Validate that a parameter exists.
Definition at line 599 of file Teuchos_ParameterList.cpp.
|
inlineprivate |
Validate that a type is the same.
Definition at line 1148 of file Teuchos_ParameterList.hpp.
|
private |
Validate a sublist param is indeed a sublist.
Definition at line 614 of file Teuchos_ParameterList.cpp.
|
private |
Throw a sublist does not exist exception.
Definition at line 625 of file Teuchos_ParameterList.cpp.
|
private |
Update sublist names recursively.
Definition at line 582 of file Teuchos_ParameterList.cpp.
|
related |
Validation used enum.
Definition at line 68 of file Teuchos_ParameterList.hpp.
|
related |
Validation defaults enum.
Definition at line 80 of file Teuchos_ParameterList.hpp.
|
related |
Nonmember constructor.
Definition at line 718 of file Teuchos_ParameterList.hpp.
|
related |
Nonmember constructor.
Definition at line 729 of file Teuchos_ParameterList.hpp.
|
related |
Nonmember constructor.
Definition at line 740 of file Teuchos_ParameterList.hpp.
|
related |
Nonmember constructor.
Definition at line 751 of file Teuchos_ParameterList.hpp.
|
related |
Nonmember constructor.
Definition at line 762 of file Teuchos_ParameterList.hpp.
|
related |
Returns true if two parameter lists are the same.
|
related |
Returns true if two parameter lists are not the same.
Definition at line 793 of file Teuchos_ParameterList.hpp.
|
related |
Returns true if two parameter lists have the same values.
Two parameter lists may have the same values but may not be identical. For example, two parameters can have the same values but not have the same documentation strings or the same validators.
|
related |
Returns true if two parameter lists have the same values independent of ordering.
Two parameter lists may have the same values but may not be identical. For example, two parameters can have the same values but not have the same documentation strings or the same validators.
|
related |
A templated helper function for getting a parameter from a non-const list. This helper function prevents the need for giving a nominal value of the specific template type.
getParameter<int>( list, "Iters" )
Definition at line 1174 of file Teuchos_ParameterList.hpp.
|
related |
A shorter name for getParameter()
.
get<int>( list, "Iters" )
Definition at line 1187 of file Teuchos_ParameterList.hpp.
|
related |
A templated helper function for getting a parameter from a const list. This helper function prevents the need for giving a nominal value of the specific template type.
getParameter<int>( list, "Iters" )
Definition at line 1200 of file Teuchos_ParameterList.hpp.
|
related |
A templated helper function for getting a pointer to a parameter from a non-const list, if it exists. This helper function prevents the need for giving a nominal value of the specific template type.
getParameterPtr<int>(list,"Iters")
Definition at line 1215 of file Teuchos_ParameterList.hpp.
|
related |
A templated helper function for getting a pointer to a parameter from a non-const list, if it exists. This helper function prevents the need for giving a nominal value of the specific template type.
getParameterPtr<int>(list,"Iters")
Definition at line 1230 of file Teuchos_ParameterList.hpp.
|
related |
A templated helper function for determining the type of a parameter entry for a non-const list. This helper function avoids the need for giving a nominal value of the specific template type.
isParameterType<int>( list, "Iters" )
Definition at line 1244 of file Teuchos_ParameterList.hpp.
|
related |
A templated helper function for determining the type of a parameter entry for a const list. This helper function avoids the need for giving a nominal value of the specific template type.
isParameterType<int>( list, "Iters" )
Definition at line 1258 of file Teuchos_ParameterList.hpp.
|
related |
Set a std::string parameter representation of an array.
paramName | [in] The name of the parameter containing the std::string representation of the array. |
array | [in] The array that will be set as a std::string parameter. |
paramList | [in/out] The parameter list that the array will be set on. |
Definition at line 1276 of file Teuchos_ParameterList.hpp.
|
related |
Get an Array object (with entries of type T
) from a parameter holding a std::string representation of the array.
paramList | [in] The parameter list to extract the parameter array from. |
paramName | [in] The name of the parameter containing the std::string representation of the array. |
arrayDim | [in] If arrayDim >= 0 , then the read in array must be equal to this dimension, or an std::exception will be thrown. If arrayDim < 0 , then an array of any dimension will be returned. The default is -1 and therefore no array length validation will be performed. |
mustExist | [in] If mustExist==true , then the parameter paramName must exist and must contain a valid array, or an std::exception is thrown. If mustExist==false , and if the parameter paramName does not exist or contains an empty array std::string value, then an empty array object will be returned. |
mustExist==false
and the parameter does not exist, then an empty array object will be returned. If mustExist==true
and arrayDim < 0
, then if the parameter paramName
exists and its array value is valid, then the converted array, of any size, will be returned. If mustExist==true
and arrayDim >= 0
then an array of dimension arrayDim
will be returned if an std::exception is not thrown.Exceptions::InvalidParameterName
will be thrown if mustExist==true
and the parameter paramName
does not exist in paramList
Exceptions::InvalidParameterType
will be thrown if the parameter exists but does not have a value type of std::string
.
Exceptions::InvalidParameterValue
will be thrown in the following cases:
paramName
exists but the array in std::string form is not formated correctly. arrayDim >= 0
and the read in array dimension dies not equal arrayDim
Detailed Description:
This function allows Array<T>
objects to be read in from a parameter with a std::string representation of the array. The templated function Teuchos::fromStringToArray()
(see documentation for Teuchos::Array
) is used to parse the std::string representation and return the array object (see this function's documentation for details on what the formatting of the array std::string must be and what can be handled and what can not be handled.
Definition at line 1352 of file Teuchos_ParameterList.hpp.
|
related |
Return a RCP to a sublist in another RCP-ed parameter list.
Definition at line 1406 of file Teuchos_ParameterList.hpp.
|
related |
Return a RCP to a sublist in another RCP-ed parameter list.
Definition at line 1420 of file Teuchos_ParameterList.hpp.
|
related |
Output stream operator for handling the printing of the parameter list.
Definition at line 1432 of file Teuchos_ParameterList.hpp.
|
related |
Set up a std::string parameter that will use an embedded validator to allow the extraction of an integral value.
The function getIntegralValue()
can then be used to extract the integral value of the std::string parameter. In this case, the integral value return will just be the zero-based index of the std::string value in the list strings
.
|
related |
Set up a std::string parameter that will use an embedded validator to allow the extraction of an integral value from a list of integral values.
The function getIntegralValue()
can then be used to extract the integral value of the std::string parameter. In this case, the integral value return will just be the zero-based index of the std::string value in the list strings
.
|
related |
Set up a std::string parameter with documentation strings for each valid value that will use an embedded validator to allow the extraction of an integral value from a list of integral values.
The function getIntegralValue()
can then be used to extract the integral value of the std::string parameter. In this case, the integral value return will just be the zero-based index of the std::string value in the list strings
.
|
related |
Get an integral value for a parameter that is assumed to already be set.
This function does a dynamic cast to get the underlying valiator of type StringToIntegralParameterEntryValidator<IntegralType>. If this dynamic cast failes then an Exceptions::InvalidParameterType
std::exception is thrown with an excellent error message.
|
related |
Get a std::string value for a parameter that is assumed to already be set.
This function does a dynamic cast to get the underlying valiator of type StringToIntegralParameterEntryValidator<IntegralValue>. The default type for IntegralValue is int. If this dynamic cast failes then an Exceptions::InvalidParameterType
std::exception is thrown with an excellent error message.
|
related |
Set an integer parameter that allows for (nearly) any input parameter type that is convertible to an int.
|
related |
Set an integer parameter that allows for (nearly) any input parameter type that is convertible to an int.
|
related |
Set an double parameter that allows for (nearly) any input parameter type that is convertible to a double.
|
related |
Set an numeric parameter preferred as a std::string that allows for (nearly) any input parameter type that is convertible to a std::string.
|
related |
Get an integer parameter.
If the underlying parameter type is already an integer, then all is good. However, if it is not, then a AnyNumberParameterEntryValidator object is looked for to extract the type correctly. If no validator is attached to the entry, then a new AnyNumberParameterEntryValidator object will be created that that will allow the conversion from any supported type.
The parameter must exist or an Exceptions::InvalidParameterName
object will be thrown. The parameters type must be acceptable, or an Exceptions::InvalidParameterType
object will be thown.
|
related |
Get a long long parameter.
If the underlying parameter type is already a long long, then all is good. However, if it is not, then a AnyNumberParameterEntryValidator object is looked for to extract the type correctly. If no validator is attached to the entry, then a new AnyNumberParameterEntryValidator object will be created that that will allow the conversion from any supported type.
The parameter must exist or an Exceptions::InvalidParameterName
object will be thrown. The parameters type must be acceptable, or an Exceptions::InvalidParameterType
object will be thown.
|
related |
Get double integer parameter.
If the underlying parameter type is already a double, then all is good. However, if it is not, then a AnyNumberParameterEntryValidator object is looked for to extract the type correctly. If no validator is attached to the entry, then a new AnyNumberParameterEntryValidator object will be created that that will allow the conversion from any supported type.
The parameter must exist or an Exceptions::InvalidParameterName
object will be thrown. The parameters type must be acceptable, or an Exceptions::InvalidParameterType
object will be thown.
|
related |
Get std::string numeric parameter.
If the underlying parameter type is already a std::string, then all is good. However, if it is not, then a AnyNumberParameterEntryValidator object is looked for to extract the type correctly. If no validator is attached to the entry, then a new AnyNumberParameterEntryValidator object will be created that that will allow the conversion from any supported type.
The parameter must exist or an Exceptions::InvalidParameterName
object will be thrown. The parameters type must be acceptable, or an Exceptions::InvalidParameterType
object will be thown.
|
related |
Reads XML parameters from a file and updates those already in the given parameter list.
xmlFileName | [in] The file name containing XML parameter list specification. |
paramList | [in/out] On input, *paramList may be empty or contain some parameters and sublists. On output, parameters and sublist from the file xmlFileName will be set or overide those in *paramList . |
|
related |
Reads XML parameters from a file and return them in a new parameter list.
xmlFileName | [in] The file name containing XML parameter list specification. |
|
related |
Reads XML parameters from a file and return them in a new parameter list.
xmlFileName | [in] The file name containing XML parameter list specification. |
depSheet | [out] The Dependency Sheet into which Dependencies should be placed. |
|
related |
Reads XML parameters from a std::string and updates those already in the given parameter list.
xmlStr | [in] String containing XML parameter list specification. |
paramList | [in/out] On input, *paramList may be empty or contain some parameters and sublists. On output, parameters and sublist from the file xmlStr will be set or override (or not) those in *paramList depending on the overwrite parameter. |
overwrite | [in] If true, parameters and sublists in the xmlStr will override those in paramList . If false, any value set in paramList will be kept, only values not set will be updated. |
|
related |
Reads XML parameters from a std::string and return them in a new parameter list.
xmlStr | [in] String containing XML parameter list specification. |
|
related |
Reads XML parameters from a std::string and return them in a new parameter list.
xmlStr | [in] String containing XML parameter list specification. |
depSheet | [in] The Dependency Sheet into which Dependencies should be placed. |
|
related |
Write parameters and sublists in XML format to an std::ostream.
paramList | [in] Contains the parameters and sublists that will be written to file. |
xmlOut | [in] The stream that will get the XML output. |
depSheet | [in] The Dependency Sheet which should be written out. |
|
related |
Write parameters and sublist to an XML file.
paramList | [in] Contains the parameters and sublists that will be written to file. |
xmlFileName | [in] The file name that will be create to contain the XML version of the parameter list specification. |
depSheet | [in] The Dependency Sheet which should be written out. |
|
related |
Reads Yaml parameters from a file and updates those already in the given parameter list.
yamlFileName | [in] The file name containing Yaml parameter list specification. |
paramList | [in/out] On input, *paramList may be empty or contain some parameters and sublists. On output, parameters and sublist from the file yamlFileName will be set or overide those in *paramList . |
Definition at line 964 of file Teuchos_YamlParser.cpp.
|
related |
Reads Yaml parameters from a file and return them in a new parameter list.
yamlFileName | [in] The file name containing Yaml parameter list specification. |
Definition at line 1013 of file Teuchos_YamlParser.cpp.
|
related |
Reads Yaml parameters from a std::string and updates those already in the given parameter list.
yamlStr | [in] String containing Yaml parameter list specification. |
paramList | [in/out] On input, *paramList may be empty or contain some parameters and sublists. On output, parameters and sublist from the file yamlStr will be set or override (or not) those in *paramList depending on the overwrite parameter. |
overwrite | [in] If true, parameters and sublists in the yamlStr will override those in paramList . If false, any value set in paramList will be kept, only values not set will be updated. |
Definition at line 994 of file Teuchos_YamlParser.cpp.
|
related |
Reads Yaml parameters from a std::string and return them in a new parameter list.
yamlStr | [in] String containing Yaml parameter list specification. |
Definition at line 1018 of file Teuchos_YamlParser.cpp.
|
related |
Write parameters and sublists in Yaml format to an std::ostream.
paramList | [in] Contains the parameters and sublists that will be written to file. |
yamlOut | [in] The stream that will get the Yaml output. |
Definition at line 1024 of file Teuchos_YamlParser.cpp.
|
related |
Write parameters and sublist to an Yaml file.
paramList | [in] Contains the parameters and sublists that will be written to file. |
yamlFileName | [in] The file name that will be create to contain the Yaml version of the parameter list specification. |
Definition at line 1032 of file Teuchos_YamlParser.cpp.
|
related |
On processor rank = root, broadcast the inParamList to all other processors. Then update the given parameter list with these values.
inParamList | [in] On input, *inParamList may be empty or contain some parameters and sublists. This list is only used on rank = root. |
paramList | [in/out] On input, *paramList may be empty or contain some parameters and sublists. On output, parameters and sublist from rank = root will be set or override (or not) those in *paramList depending on the overwrite parameter. |
comm | [in] A Comm object used to broadcast the xml. |
root | [in] The rank which will broadcast the list. |
overwrite | [in] If true, parameters and sublists in the inParamList will override those in paramList . If false, any value set in paramList will be kept, only values not set will be updated. |
|
related |
On processor rank = 0, reads XML parameters from a file and broadcasts them to all other processors. Then updates the given parameter list with these values.
xmlFileName | [in] The file name containing XML parameter list specification. |
paramList | [in/out] On input, *paramList may be empty or contain some parameters and sublists. On output, parameters and sublist from the file xmlFileName will be set or override (or not) those in *paramList depending on the overwrite parameter. |
comm | [in] A Comm object used to broadcast the xml. |
overwrite | [in] If true, parameters and sublists in the xmlStr will override those in paramList . If false, any value set in paramList will be kept, only values not set will be updated. |
|
related |
On processor rank = 0, reads Yaml parameters from a file and broadcasts them to all other processors. Then updates the given parameter list with these values.
xmlFileName | [in] The file name containing Yaml parameter list specification. |
paramList | [in/out] On input, *paramList may be empty or contain some parameters and sublists. On output, parameters and sublist from the file xmlFileName will be set or override (or not) those in *paramList depending on the overwrite parameter. |
comm | [in] A Comm object used to broadcast the xml. |
overwrite | [in] If true, parameters and sublists in the xmlStr will override those in paramList . If false, any value set in paramList will be kept, only values not set will be updated. |
|
private |
Name of the (sub)list.
Definition at line 694 of file Teuchos_ParameterList.hpp.
|
private |
Parameter list.
Definition at line 702 of file Teuchos_ParameterList.hpp.
|
private |
Validate into list or not.
Definition at line 708 of file Teuchos_ParameterList.hpp.