45 #ifndef ROL_SAMPLEDSCALAR_H 46 #define ROL_SAMPLEDSCALAR_H 62 void reset(
const bool flag =
true) {
64 typename std::map<std::vector<Real>,
int>::iterator it;
65 for (it = indices_.begin(); it != indices_.end(); ++it) {
66 flags_[it->second] =
false;
75 : maxIndex_(0), updated_(false) {
83 void update(
const bool flag =
true) {
91 const std::vector<Real> ¶m) {
92 int count = indices_.count(param);
96 typename std::map<std::vector<Real>,
int>::iterator it
97 = indices_.find(param);
106 std::pair<std::vector<Real>,
int>(param, index));
107 flags_.push_back(
false);
108 scalars_.push_back(static_cast<Real>(0));
116 void set(
const Real &x,
117 const std::vector<Real> ¶m) {
118 int count = indices_.count(param);
121 typename std::map<std::vector<Real>,
int>::iterator it
122 = indices_.find(param);
124 flags_[index] =
true;
129 std::pair<std::vector<Real>,
int>(param, index));
130 flags_.push_back(
true);
131 scalars_.push_back(x);
void update(const bool flag=true)
Update for SampledScalar storage.
void reset(const bool flag=true)
std::vector< Real > scalars_
std::vector< bool > flags_
SampledScalar(void)
Constructor.
std::map< std::vector< Real >, int > indices_