Bayes Filters Library
GaussianFilter.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2019 Istituto Italiano di Tecnologia (IIT)
3  *
4  * This software may be modified and distributed under the terms of the
5  * BSD 3-Clause license. See the accompanying LICENSE file for details.
6  */
7 
9 
10 using namespace bfl;
11 
12 
13 GaussianFilter::GaussianFilter(std::unique_ptr<GaussianPrediction> prediction, std::unique_ptr<GaussianCorrection> correction) noexcept :
14  prediction_(std::move(prediction)),
15  correction_(std::move(correction))
16 { }
17 
18 
19 bool GaussianFilter::skip(const std::string& what_step, const bool status)
20 {
21  if (what_step == "prediction" ||
22  what_step == "state" ||
23  what_step == "exogenous")
24  return prediction_->skip(what_step, status);
25 
26  if (what_step == "correction")
27  return correction_->skip(status);
28 
29  if (what_step == "all")
30  {
31  bool return_status = true;
32 
33  return_status &= prediction_->skip("prediction", status);
34 
35  return_status &= correction_->skip(status);
36 
37  return return_status;
38  }
39 
40  return false;
41 }
42 
43 
45 {
46  return *prediction_;
47 }
48 
49 
51 {
52  return *correction_;
53 }
GaussianFilter.h
bfl
Port of boost::any for C++11 compilers.
Definition: AdditiveMeasurementModel.h:13
bfl::GaussianFilter::GaussianFilter
GaussianFilter(std::unique_ptr< GaussianPrediction > prediction, std::unique_ptr< GaussianCorrection > correction) noexcept
Definition: GaussianFilter.cpp:13
bfl::GaussianFilter::correction_
std::unique_ptr< GaussianCorrection > correction_
Definition: GaussianFilter.h:48
bfl::GaussianFilter::prediction
GaussianPrediction & prediction()
Definition: GaussianFilter.cpp:44
bfl::GaussianFilter::prediction_
std::unique_ptr< GaussianPrediction > prediction_
Definition: GaussianFilter.h:46
bfl::GaussianPrediction
Definition: GaussianPrediction.h:23
bfl::GaussianFilter::skip
bool skip(const std::string &what_step, const bool status) override
Definition: GaussianFilter.cpp:19
bfl::GaussianCorrection
Definition: GaussianCorrection.h:21
bfl::GaussianFilter::correction
GaussianCorrection & correction()
Definition: GaussianFilter.cpp:50