12 template <
typename EntryBase,
typename EntryType>
16 bool supports_analytic_) :
19 supports_ad(supports_ad_),
20 supports_analytic(supports_analytic_)
24 template <
typename EntryBase,
typename EntryType>
30 template <
typename EntryBase,
typename EntryType>
38 template <
typename EntryBase,
typename EntryType>
46 template <
typename EntryBase,
typename EntryType>
51 return supports_analytic;
54 template <
typename EntryBase,
typename EntryType>
55 template <
class EvalType>
62 std::string evalTypeString = getTypeName<EvalType>();
66 if (it == family.end())
72 template <
typename EntryBase,
typename EntryType>
73 template <
class EvalType>
77 const bool allow_overwrite)
80 std::string evalTypeString = getTypeName<EvalType>();
83 iterator it = family.find(evalTypeString);
86 if (it == family.end()) {
87 family.insert(std::pair<std::string,
90 else if (allow_overwrite) {
100 template <
typename EntryBase,
typename EntryType>
101 template <
class EvalType>
107 std::string evalTypeString = getTypeName<EvalType>();
110 iterator it = family.find(evalTypeString);
113 std::string(
"Sacado::ParameterFamilyBase::getEntry(): ")
114 +
"Parameter entry " + name
115 +
" does not have a parameter of type"
122 std::string(
"Sacado::ParameterFamilyBase::getEntry(): ")
123 +
"Parameter entry " + name
124 +
" of type" + evalTypeString
125 +
" has incorrect entry type");
130 template <
typename EntryBase,
typename EntryType>
131 template <
class EvalType>
137 std::string evalTypeString = getTypeName<EvalType>();
143 std::string(
"Sacado::ParameterFamilyBase::getEntry(): ")
144 +
"Parameter entry " + name
145 +
" does not have a parameter of type"
152 std::string(
"Sacado::ParameterFamilyBase::getEntry(): ")
153 +
"Parameter entry " + name
154 +
" of type" + evalTypeString
155 +
" has incorrect entry type");
160 template <
typename EntryBase,
typename EntryType>
163 print(std::ostream& os,
bool print_values)
const
165 os <<
"\t" << name <<
": Supports AD = " << supports_ad
166 <<
", Supports_Analytic = " << supports_analytic << std::endl;
168 for (
const_iterator it = family.begin(); it != family.end(); it++) {
169 os <<
"\t\t" << (*it).first <<
" = ";
170 (*it).second->print(os);
177 template <
typename EntryBase,
typename EntryType>
178 template <
class EvalType>
182 return typeid(EvalType).name();
ParameterFamilyBase(const std::string &name, bool supports_ad, bool supports_analytic)
Constructor.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual ~ParameterFamilyBase()
Destructor.
EvalMap::const_iterator const_iterator
Const iterator for EvalMap.
EvalMap::iterator iterator
Iterator for EvalMap.
std::string getTypeName() const
Returns a string representation of type EntryType.
std::string getName() const
Get the name of the family.
F::template apply< A1, A2, A3, A4, A5 >::type type
void print(std::ostream &os, bool print_values=false) const
Print the family.
bool addEntry(const Teuchos::RCP< typename Sacado::mpl::apply< EntryType, EvalType >::type > &entry, const bool allow_overwrite=false)
Add a new parameter using custom entry.
bool hasType() const
Determine if family has an entry for the given type EvalType.
Teuchos::RCP< typename Sacado::mpl::apply< EntryType, EvalType >::type > getEntry()
Gets the entry corresponding to type EvalType.
bool supportsAD() const
Indicates whether parameter supports AD derivatives.
bool supportsAnalytic() const
Indicates whether parameter supports analytic derivatives.