45 #ifndef ROL_SAMPLEDSCALAR_H
46 #define ROL_SAMPLEDSCALAR_H
50 template <
class Real,
class Key=std::vector<Real>>
62 void reset(
const bool flag =
true) {
64 typename std::map<Key, int>::iterator it;
66 flags_[it->second] =
false;
83 void update(
const bool flag =
true) {
90 bool get(Real &x,
const Key ¶m) {
95 typename std::map<Key, int>::iterator it =
indices_.find(param);
103 indices_.insert(std::pair<Key, int>(param, index));
105 scalars_.push_back(static_cast<Real>(0));
113 void set(
const Real &x,
const Key ¶m) {
117 typename std::map<Key, int>::iterator it =
indices_.find(param);
123 indices_.insert(std::pair<Key, int>(param, index));
SampledScalar(void)
Constructor.
std::map< Key, int > indices_
void set(const Real &x, const Key ¶m)
Set vector corresponding to input parameter.
std::vector< Real > scalars_
void reset(const bool flag=true)
std::vector< bool > flags_
void update(const bool flag=true)
Update for SampledScalar storage.