10 #ifndef ROL_SAMPLEDSCALAR_H
11 #define ROL_SAMPLEDSCALAR_H
15 template <
class Real,
class Key=std::vector<Real>>
27 void reset(
const bool flag =
true) {
29 typename std::map<Key, int>::iterator it;
31 flags_[it->second] =
false;
48 void update(
const bool flag =
true) {
55 bool get(Real &x,
const Key ¶m) {
60 typename std::map<Key, int>::iterator it =
indices_.find(param);
68 indices_.insert(std::pair<Key, int>(param, index));
70 scalars_.push_back(static_cast<Real>(0));
78 void set(
const Real &x,
const Key ¶m) {
82 typename std::map<Key, int>::iterator it =
indices_.find(param);
88 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.