37 #define MATRIX_SIZE_3x3 9 89 for (
int i = 0; i < N; i++)
94 for (
int i = 0; i < N-1; i++)
130 mx9[0] = sqrt (mx9[0]);
134 mx9[4] = sqrt(mx9[4] - mx9[1]*mx9[1]);
138 mx9[5] = (mx9[5] - mx9[2]*mx9[1])/mx9[4];
139 mx9[8] = sqrt(mx9[8] - mx9[5]*mx9[5] - mx9[2]*mx9[2]);
161 result[0] = i2P * B[0]*B[0] + i2Q[0];
162 result[4] = i2P * B[1]*B[1] + i2Q[1];
163 result[8] = i2P * B[2]*B[2] + i2Q[2];
166 result[1] = i2P * B[0]*B[1];
167 result[2] = i2P * B[0]*B[2];
168 result[5] = i2P * B[1]*B[2];
184 iQAT[1] = A3 * i2Q[1];
185 iQAT[2] = A6 * i2Q[2];
187 iQAT[5] = A3 * i2Q[2];
209 result[2] +=
iQAT[2];
215 result[5] +=
iQAT[5];
220 result[8] +=
iQAT[8];
244 ecLc[0] = -
iQAT[0] / ecLp[0];
245 ecLc[4] = -
iQAT[4] / ecLp[4];
246 ecLc[8] = -
iQAT[8] / ecLp[8];
249 ecLc[3] = (-
iQAT[1] - ecLc[0]*ecLp[1]) / ecLp[4];
250 ecLc[7] = (-
iQAT[5] - ecLc[4]*ecLp[5]) / ecLp[8];
253 ecLc[6] = (-
iQAT[2] - ecLc[0]*ecLp[2] - ecLc[3]*ecLp[5]) / ecLp[8];
272 ecLc[0] -= ecLp[0]*ecLp[0] + ecLp[3]*ecLp[3] + ecLp[6]*ecLp[6];
273 ecLc[4] -= ecLp[4]*ecLp[4] + ecLp[7]*ecLp[7];
274 ecLc[8] -= ecLp[8]*ecLp[8];
276 ecLc[1] -= ecLp[3]*ecLp[4] + ecLp[6]*ecLp[7];
277 ecLc[2] -= ecLp[6]*ecLp[8];
278 ecLc[5] -= ecLp[7]*ecLp[8];
305 for (i = 1; i < ppar.
N; i++)
336 int i = start_ind, j = start_ind;
358 for (; i < N; ++i, ++j)
418 for (i = N-2; i >= 0 ; i--)
#define SMPC_NUM_STATE_VAR
Number of state variables.
void form_L_diag(const double *, double *)
Forms a 3x3 matrix L(k+1, k+1), which lies on the main diagonal of L.
void form_iQBiPB(const double *, const double *, const double, double *)
Forms matrix iQBiPB = 0.5 * inv(Q) + 0.5 * B * inv(P) * B.
void form_AiQATiQBiPB(const problem_parameters &, const state_parameters &, double *)
Forms matrix AiQATiQBiPB = A * inv(Q) * A' + 0.5 * inv(Q) + 0.5 * B * inv(P) * B.
A set of problem parameters.
void chol_dec(double *)
Performs Cholesky decomposition of 3x3 matrix.
void form_iQAT(const double, const double, const double *)
Forms matrix iQAT = 0.5 * inv (Q) * A'.
void form(const problem_parameters &)
Builds matrix L.
void solve_forward(const int, double *, const int start_ind=0) const
Solve system ecL * x = b using forward substitution.
void form_L_non_diag(const double *, double *)
Forms a 3x3 matrix L(k+1, k), which lies below the diagonal of L.
void solve_backward(const int, double *) const
Solve system ecL' * x = b using backward substitution.