69 template<
int StateDim,
template<
class,
class...>
class ListType = std::vector>
77 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
84 bool extend_for_output =
false)
87 setup(extend_for_output);
113 if(extend_for_output)
117 if(model->D_.norm() > 0)
120 <<
"[VariantSequentialExtension] Matrix D in state-space model must be zero when extending for output.\n"
144 int accum_input_dim = 0;
145 for(
size_t i = 0; i < seq_len; i++)
147 int current_input_dim =
model_list_[i]->inputDim();
156 (
A_seq_.template middleRows<StateDim>(i * StateDim)).noalias() =
161 for(
size_t j = i; j < seq_len; j++)
165 B_seq_.block(j * StateDim, accum_input_dim, StateDim, current_input_dim) =
model_list_[i]->Bd_;
169 (
B_seq_.block(j * StateDim, accum_input_dim, StateDim, current_input_dim)).noalias() =
170 model_list_[j]->Ad_ *
B_seq_.block((j - 1) * StateDim, accum_input_dim, StateDim, current_input_dim);
181 (
E_seq_.segment<StateDim>(i * StateDim)).noalias() =
185 accum_input_dim += current_input_dim;
189 if(extend_for_output)
193 int accum_output_dim = 0;
194 for(
size_t i = 0; i < seq_len; i++)
196 int current_output_dim =
model_list_[i]->outputDim();
198 C_seq.block(accum_output_dim, i * StateDim, current_output_dim, StateDim) =
model_list_[i]->C_;
200 accum_output_dim += current_output_dim;
224 Eigen::Matrix<double, Eigen::Dynamic, StateDim>
A_seq_;