BioDynaMo
v1.05.120-25dc9790
|
Go to the documentation of this file.
14 #ifndef CORE_ANALYSIS_TIME_SERIES_H_
15 #define CORE_ANALYSIS_TIME_SERIES_H_
18 #include <unordered_map>
28 namespace experimental {
44 std::vector<real_t>& new_x_values)
const = 0;
46 std::vector<real_t>& new_y_values)
const = 0;
48 const std::vector<real_t>& old_y_error_low,
49 std::vector<real_t>& new_y_error_low)
const = 0;
51 const std::vector<real_t>& old_y_error_high,
52 std::vector<real_t>& new_y_error_high)
const = 0;
76 std::vector<real_t>& new_x_values)
const final;
82 std::vector<real_t>& new_y_values)
const final;
89 std::vector<real_t>& new_y_error_low)
const final;
96 std::vector<real_t>& new_y_error_high)
const final;
151 static void Load(
const std::string& full_filepath,
TimeSeries** restored);
186 TimeSeries* merged,
const std::vector<TimeSeries>& time_series,
187 const std::function<
void(
const std::vector<real_t>&,
real_t*,
real_t*,
248 void Add(
const std::string&
id,
const std::vector<real_t>& x_values,
249 const std::vector<real_t>& y_values);
251 void Add(
const std::string&
id,
const std::vector<real_t>& x_values,
252 const std::vector<real_t>& y_values,
253 const std::vector<real_t>& y_error);
255 void Add(
const std::string&
id,
const std::vector<real_t>& x_values,
256 const std::vector<real_t>& y_values,
257 const std::vector<real_t>& y_error_low,
258 const std::vector<real_t>& y_error_high);
273 const std::string& transformed_id,
280 bool Contains(
const std::string&
id)
const;
281 uint64_t
Size()
const;
282 const std::vector<real_t>&
GetXValues(
const std::string&
id)
const;
283 const std::vector<real_t>&
GetYValues(
const std::string&
id)
const;
284 const std::vector<real_t>&
GetYErrorLow(
const std::string&
id)
const;
285 const std::vector<real_t>&
GetYErrorHigh(
const std::string&
id)
const;
291 void Save(
const std::string& full_filepath)
const;
294 void SaveJson(
const std::string& full_filepath)
const;
297 std::unordered_map<std::string, Data>
data_;
304 #if (!defined(__CLING__) || defined(__ROOTCLING__)) && defined(USE_DICT)
308 inline void TimeSeries::Data::Streamer(TBuffer& R__b) {
309 if (R__b.IsReading()) {
310 R__b.ReadClassBuffer(TimeSeries::Data::Class(),
this);
317 R__b.WriteClassBuffer(TimeSeries::Data::Class(),
this);
318 Long64_t l =
reinterpret_cast<Long64_t
>(this->
ycollector);
320 l =
reinterpret_cast<Long64_t
>(this->
xcollector);
325 #endif // !defined(__CLING__) || defined(__ROOTCLING__)
330 #endif // CORE_ANALYSIS_TIME_SERIES_H_
static real_t ComputeError(const TimeSeries &ts1, const TimeSeries &ts2)
Computes the mean squared error between ts1 and ts2
TimeSeries & operator=(TimeSeries &&other) noexcept
const std::vector< real_t > & GetYErrorHigh(const std::string &id) const
std::vector< real_t > y_error_high
real_t(* xcollector)(Simulation *)
void Save(const std::string &full_filepath) const
Saves a root file to disk.
const std::vector< real_t > & GetYErrorLow(const std::string &id) const
void Update()
Adds a new data point to all time series with a collector.
void AddTransformedData(const std::string &old_id, const std::string &transformed_id, const DataTransformer &transformer)
BDM_CLASS_DEF_NV(Data, 1)
std::vector< real_t > y_values
std::unordered_map< std::string, Data > data_
void ListEntries() const
Print all time series entry names to stdout.
Data & operator=(const Data &other)
std::vector< real_t > x_values
const std::vector< real_t > & GetYValues(const std::string &id) const
const std::vector< real_t > & GetXValues(const std::string &id) const
Reducer< real_t > * y_reducer_collector
static void Merge(TimeSeries *merged, const std::vector< TimeSeries > &time_series, const std::function< void(const std::vector< real_t > &, real_t *, real_t *, real_t *)> &merger)
void Add(const std::string &id, const std::vector< real_t > &x_values, const std::vector< real_t > &y_values)
BDM_CLASS_DEF_NV(TimeSeries, 1)
void AddCollector(const std::string &id, real_t(*ycollector)(Simulation *), real_t(*xcollector)(Simulation *)=nullptr)
std::vector< real_t > y_error_low
bool Contains(const std::string &id) const
Returns whether a times series with given id exists in this object.
void SaveJson(const std::string &full_filepath) const
Saves a json representation to disk.
static void Load(const std::string &full_filepath, TimeSeries **restored)
real_t(* ycollector)(Simulation *)