本文整理汇总了C++中Observations::update方法的典型用法代码示例。如果您正苦于以下问题:C++ Observations::update方法的具体用法?C++ Observations::update怎么用?C++ Observations::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Observations
的用法示例。
在下文中一共展示了Observations::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_run
int RunStorage::get_run(int run_id, Parameters &pars, Observations &obs, string &info_txt, double &info_value, bool clear_old)
{
vector<double> par_data;
vector<double> obs_data;
int status = get_run(run_id, par_data, obs_data, info_txt, info_value);
if (clear_old)
{
pars.update(par_names, par_data);
obs.update(obs_names, obs_data);
}
else
{
pars.update_without_clear(par_names, par_data);
obs.update_without_clear(obs_names, obs_data);
}
return status;
}
示例2: get_observations
int RunStorage::get_observations(int run_id, Observations &obs)
{
std::int8_t r_status;
vector<char> info_txt_buf;
info_txt_buf.resize(info_txt_length, '\0');
double info_value;
check_rec_id(run_id);
size_t n_par = par_names.size();
size_t n_obs = obs_names.size();
vector<double> obs_data;
obs_data.resize(n_obs);
buf_stream.seekg(get_stream_pos(run_id), ios_base::beg);
buf_stream.read(reinterpret_cast<char*>(&r_status), sizeof(r_status));
buf_stream.read(reinterpret_cast<char*>(&info_txt_buf[0]), sizeof(char)*info_txt_length);
buf_stream.read(reinterpret_cast<char*>(&info_value), sizeof(double));
buf_stream.seekg(n_par*sizeof(double), ios_base::cur);
buf_stream.read(reinterpret_cast<char*>(obs_data.data()), n_obs*sizeof(double));
int status = r_status;
obs.update(obs_names, obs_data);
return status;
}