Bayes Filters Library
LinearStateModel.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 #include <Eigen/Dense>
11 
12 using namespace bfl;
13 using namespace Eigen;
14 
15 
16 void LinearStateModel::propagate(const Eigen::Ref<const Eigen::MatrixXd>& cur_states, Eigen::Ref<Eigen::MatrixXd> prop_states)
17 {
18  if (is_skipping() && (have_exogenous_model() && exogenous_model().is_skipping()))
19  {
20  prop_states = cur_states;
21  }
22  else if (!is_skipping() && (have_exogenous_model() && !exogenous_model().is_skipping()))
23  {
24  MatrixXd exogenous_state(cur_states.rows(), cur_states.cols());
25 
26  exogenous_model().propagate(cur_states, exogenous_state);
27 
28  prop_states = getStateTransitionMatrix() * cur_states + exogenous_state;
29  }
30  else if (!is_skipping())
31  {
32  prop_states = getStateTransitionMatrix() * cur_states;
33  }
34  else if (have_exogenous_model() && !exogenous_model().is_skipping())
35  {
36  exogenous_model().propagate(cur_states, prop_states);
37  }
38 }
bfl
Port of boost::any for C++11 compilers.
Definition: AdditiveMeasurementModel.h:13
LinearStateModel.h
bfl::LinearStateModel::propagate
virtual void propagate(const Eigen::Ref< const Eigen::MatrixXd > &cur_states, Eigen::Ref< Eigen::MatrixXd > prop_states) override
Definition: LinearStateModel.cpp:16