60 template<
int StateDim,
int InputDim,
int OutputDim>
68 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
77 bool extend_for_output =
false)
80 setup(extend_for_output);
106 if(extend_for_output &&
model_->D_.norm() > 0)
109 <<
"[InvariantSequentialExtension] Matrix D in state-space model must be zero when extending for output.\n"
124 A_seq_.template middleRows<StateDim>(i * StateDim) =
model_->Ad_;
128 (
A_seq_.template middleRows<StateDim>(i * StateDim)).noalias() =
129 model_->Ad_ *
A_seq_.template middleRows<StateDim>((i - 1) * StateDim);
133 for(
int j = 0; j <
seq_len_ - i; j++)
139 B_seq_.template block<StateDim, InputDim>(i * StateDim, 0) =
model_->Bd_;
143 B_seq_.template block<StateDim, InputDim>(i * StateDim, 0).noalias() =
144 model_->Ad_ *
B_seq_.template block<StateDim, InputDim>((i - 1) * StateDim, 0);
149 B_seq_.template block<StateDim, InputDim>((i + j) * StateDim, j * InputDim) =
150 B_seq_.template block<StateDim, InputDim>(i * StateDim, 0);
157 E_seq_.template segment<StateDim>(i * StateDim) =
model_->Ed_;
161 (
E_seq_.template segment<StateDim>(i * StateDim)).noalias() =
167 if(extend_for_output)
170 Eigen::MatrixXd C_seq = Eigen::MatrixXd::Zero(
seq_len_ * OutputDim,
seq_len_ * StateDim);
173 C_seq.template block<OutputDim, StateDim>(i * OutputDim, i * StateDim) =
model_->C_;
185 std::shared_ptr<_StateSpaceModel>
model_;
191 Eigen::Matrix<double, Eigen::Dynamic, StateDim>
A_seq_;