32 template <
typename EntryBase,
typename EntryType>
36 bool supports_analytic_) :
39 supports_ad(supports_ad_),
40 supports_analytic(supports_analytic_)
44 template <
typename EntryBase,
typename EntryType>
50 template <
typename EntryBase,
typename EntryType>
58 template <
typename EntryBase,
typename EntryType>
66 template <
typename EntryBase,
typename EntryType>
71 return supports_analytic;
74 template <
typename EntryBase,
typename EntryType>
75 template <
class EvalType>
82 std::string evalTypeString = getTypeName<EvalType>();
86 if (it == family.end())
92 template <
typename EntryBase,
typename EntryType>
93 template <
class EvalType>
97 const bool allow_overwrite)
100 std::string evalTypeString = getTypeName<EvalType>();
103 iterator it = family.find(evalTypeString);
106 if (it == family.end()) {
107 family.insert(std::pair<std::string,
110 else if (allow_overwrite) {
111 (*it).second = entry;
120 template <
typename EntryBase,
typename EntryType>
121 template <
class EvalType>
127 std::string evalTypeString = getTypeName<EvalType>();
130 iterator it = family.find(evalTypeString);
133 std::string(
"Sacado::ParameterFamilyBase::getEntry(): ")
134 +
"Parameter entry " + name
135 +
" does not have a parameter of type"
142 std::string(
"Sacado::ParameterFamilyBase::getEntry(): ")
143 +
"Parameter entry " + name
144 +
" of type" + evalTypeString
145 +
" has incorrect entry type");
150 template <
typename EntryBase,
typename EntryType>
151 template <
class EvalType>
157 std::string evalTypeString = getTypeName<EvalType>();
163 std::string(
"Sacado::ParameterFamilyBase::getEntry(): ")
164 +
"Parameter entry " + name
165 +
" does not have a parameter of type"
172 std::string(
"Sacado::ParameterFamilyBase::getEntry(): ")
173 +
"Parameter entry " + name
174 +
" of type" + evalTypeString
175 +
" has incorrect entry type");
180 template <
typename EntryBase,
typename EntryType>
183 print(std::ostream& os,
bool print_values)
const
185 os <<
"\t" << name <<
": Supports AD = " << supports_ad
186 <<
", Supports_Analytic = " << supports_analytic << std::endl;
188 for (
const_iterator it = family.begin(); it != family.end(); it++) {
189 os <<
"\t\t" << (*it).first <<
" = ";
190 (*it).second->print(os);
197 template <
typename EntryBase,
typename EntryType>
198 template <
class EvalType>
202 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.