30 #ifndef SACADO_PARAMETERVECTORBASE_HPP 31 #define SACADO_PARAMETERVECTORBASE_HPP 35 #include "Teuchos_Array.hpp" 46 template <
typename FamilyType,
typename BaseValueType>
61 Entry(
const Teuchos::RCP<FamilyType>& f, BaseValueType bv) :
74 typedef typename EntryVector::iterator
iterator;
94 void addParam(
const Teuchos::RCP<FamilyType>& family,
95 BaseValueType baseValue) {
96 params.push_back(Entry(family, baseValue));
125 std::vector<int>& index_ad,
126 std::vector<int>& index_analytic,
127 std::vector<int>& index_other) {
129 index_analytic.resize(0);
130 index_other.resize(0);
132 typename EntryVector::iterator it;
134 for (it =
params.begin(), i=0; it !=
params.end(); ++it, ++i) {
135 if ((*it).family->supportsAD()) {
137 index_ad.push_back(i);
139 else if ((*it).family->supportsAnalytic()) {
140 analytic.
params.push_back(*it);
141 index_analytic.push_back(i);
144 other.
params.push_back(*it);
145 index_other.push_back(i);
iterator begin()
Iterator pointing at beginning of vector.
ParameterVectorBase(const ParameterVectorBase &source)
Copy constructor.
void filterParameters(ParameterVectorBase &ad, ParameterVectorBase &analytic, ParameterVectorBase &other, std::vector< int > &index_ad, std::vector< int > &index_analytic, std::vector< int > &index_other)
Filter vector into types.
const_iterator end() const
Iterator pointing at end of vector.
BaseValueType baseValue
Base value of parameter family.
virtual ~ParameterVectorBase()
Destructor.
ParameterVectorBase()
Default constructor.
EntryVector::iterator iterator
Iterator typename.
EntryVector::const_iterator const_iterator
Const iterator typename.
Teuchos::RCP< FamilyType > family
Pointer to family.
void addParam(const Teuchos::RCP< FamilyType > &family, BaseValueType baseValue)
Add entry.
Container for parameter entries.
Entry & operator[](int i)
Element access.
EntryVector params
Parameter vector.
const_iterator begin() const
Iterator pointing at beginning of vector.
ParameterVectorBase & operator=(const ParameterVectorBase &source)
Assignment.
Teuchos::Array< Entry > EntryVector
Vector of all parameter families.
A class to store the active parameters in a code in an ordered fashion, along with their "base" value...
iterator end()
Iterator pointing at end of vector.
Entry(const Teuchos::RCP< FamilyType > &f, BaseValueType bv)
Constructor.
unsigned int size() const
Return number of parameters in vector.