#include "live.h" namespace { #define DIM 22 #define EDIM 21 #define MEDIM 21 typedef void (*Hfun)(double *, double *, double *); const static double MAHA_THRESH_4 = 7.814727903251177; const static double MAHA_THRESH_9 = 7.814727903251177; const static double MAHA_THRESH_10 = 7.814727903251177; const static double MAHA_THRESH_12 = 7.814727903251177; const static double MAHA_THRESH_35 = 7.814727903251177; const static double MAHA_THRESH_32 = 9.487729036781154; const static double MAHA_THRESH_13 = 7.814727903251177; const static double MAHA_THRESH_14 = 7.814727903251177; const static double MAHA_THRESH_33 = 7.814727903251177; /****************************************************************************** * Code generated with SymPy 1.14.0 * * * * See http://www.sympy.org/ for more information. * * * * This file is part of 'ekf' * ******************************************************************************/ void H(double *in_vec, double *out_6746369553526897517) { out_6746369553526897517[0] = 0; out_6746369553526897517[1] = -sin(in_vec[1])*sin(in_vec[2])*in_vec[4] - sin(in_vec[1])*cos(in_vec[2])*in_vec[3] - cos(in_vec[1])*in_vec[5]; out_6746369553526897517[2] = -sin(in_vec[2])*cos(in_vec[1])*in_vec[3] + cos(in_vec[1])*cos(in_vec[2])*in_vec[4]; out_6746369553526897517[3] = cos(in_vec[1])*cos(in_vec[2]); out_6746369553526897517[4] = sin(in_vec[2])*cos(in_vec[1]); out_6746369553526897517[5] = -sin(in_vec[1]); out_6746369553526897517[6] = (sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]))*in_vec[3] + (-sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]))*in_vec[4] + cos(in_vec[0])*cos(in_vec[1])*in_vec[5]; out_6746369553526897517[7] = -sin(in_vec[0])*sin(in_vec[1])*in_vec[5] + sin(in_vec[0])*sin(in_vec[2])*cos(in_vec[1])*in_vec[4] + sin(in_vec[0])*cos(in_vec[1])*cos(in_vec[2])*in_vec[3]; out_6746369553526897517[8] = (-sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) - cos(in_vec[0])*cos(in_vec[2]))*in_vec[3] + (sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]))*in_vec[4]; out_6746369553526897517[9] = sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]); out_6746369553526897517[10] = sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) + cos(in_vec[0])*cos(in_vec[2]); out_6746369553526897517[11] = sin(in_vec[0])*cos(in_vec[1]); out_6746369553526897517[12] = (-sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) - cos(in_vec[0])*cos(in_vec[2]))*in_vec[4] + (-sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) + sin(in_vec[2])*cos(in_vec[0]))*in_vec[3] - sin(in_vec[0])*cos(in_vec[1])*in_vec[5]; out_6746369553526897517[13] = -sin(in_vec[1])*cos(in_vec[0])*in_vec[5] + sin(in_vec[2])*cos(in_vec[0])*cos(in_vec[1])*in_vec[4] + cos(in_vec[0])*cos(in_vec[1])*cos(in_vec[2])*in_vec[3]; out_6746369553526897517[14] = (sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]))*in_vec[4] + (sin(in_vec[0])*cos(in_vec[2]) - sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]))*in_vec[3]; out_6746369553526897517[15] = sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]); out_6746369553526897517[16] = -sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]); out_6746369553526897517[17] = cos(in_vec[0])*cos(in_vec[1]); } void err_fun(double *nom_x, double *delta_x, double *out_2356689388845686605) { out_2356689388845686605[0] = delta_x[0] + nom_x[0]; out_2356689388845686605[1] = delta_x[1] + nom_x[1]; out_2356689388845686605[2] = delta_x[2] + nom_x[2]; out_2356689388845686605[3] = -0.5*delta_x[3]*nom_x[4] - 0.5*delta_x[4]*nom_x[5] - 0.5*delta_x[5]*nom_x[6] + 1.0*nom_x[3]; out_2356689388845686605[4] = 0.5*delta_x[3]*nom_x[3] + 0.5*delta_x[4]*nom_x[6] - 0.5*delta_x[5]*nom_x[5] + 1.0*nom_x[4]; out_2356689388845686605[5] = -0.5*delta_x[3]*nom_x[6] + 0.5*delta_x[4]*nom_x[3] + 0.5*delta_x[5]*nom_x[4] + 1.0*nom_x[5]; out_2356689388845686605[6] = 0.5*delta_x[3]*nom_x[5] - 0.5*delta_x[4]*nom_x[4] + 0.5*delta_x[5]*nom_x[3] + 1.0*nom_x[6]; out_2356689388845686605[7] = delta_x[6] + nom_x[7]; out_2356689388845686605[8] = delta_x[7] + nom_x[8]; out_2356689388845686605[9] = delta_x[8] + nom_x[9]; out_2356689388845686605[10] = delta_x[9] + nom_x[10]; out_2356689388845686605[11] = delta_x[10] + nom_x[11]; out_2356689388845686605[12] = delta_x[11] + nom_x[12]; out_2356689388845686605[13] = delta_x[12] + nom_x[13]; out_2356689388845686605[14] = delta_x[13] + nom_x[14]; out_2356689388845686605[15] = delta_x[14] + nom_x[15]; out_2356689388845686605[16] = delta_x[15] + nom_x[16]; out_2356689388845686605[17] = delta_x[16] + nom_x[17]; out_2356689388845686605[18] = delta_x[17] + nom_x[18]; out_2356689388845686605[19] = delta_x[18] + nom_x[19]; out_2356689388845686605[20] = delta_x[19] + nom_x[20]; out_2356689388845686605[21] = delta_x[20] + nom_x[21]; } void inv_err_fun(double *nom_x, double *true_x, double *out_7416532235122030660) { out_7416532235122030660[0] = -nom_x[0] + true_x[0]; out_7416532235122030660[1] = -nom_x[1] + true_x[1]; out_7416532235122030660[2] = -nom_x[2] + true_x[2]; out_7416532235122030660[3] = 2*nom_x[3]*true_x[4] - 2*nom_x[4]*true_x[3] + 2*nom_x[5]*true_x[6] - 2*nom_x[6]*true_x[5]; out_7416532235122030660[4] = 2*nom_x[3]*true_x[5] - 2*nom_x[4]*true_x[6] - 2*nom_x[5]*true_x[3] + 2*nom_x[6]*true_x[4]; out_7416532235122030660[5] = 2*nom_x[3]*true_x[6] + 2*nom_x[4]*true_x[5] - 2*nom_x[5]*true_x[4] - 2*nom_x[6]*true_x[3]; out_7416532235122030660[6] = -nom_x[7] + true_x[7]; out_7416532235122030660[7] = -nom_x[8] + true_x[8]; out_7416532235122030660[8] = -nom_x[9] + true_x[9]; out_7416532235122030660[9] = -nom_x[10] + true_x[10]; out_7416532235122030660[10] = -nom_x[11] + true_x[11]; out_7416532235122030660[11] = -nom_x[12] + true_x[12]; out_7416532235122030660[12] = -nom_x[13] + true_x[13]; out_7416532235122030660[13] = -nom_x[14] + true_x[14]; out_7416532235122030660[14] = -nom_x[15] + true_x[15]; out_7416532235122030660[15] = -nom_x[16] + true_x[16]; out_7416532235122030660[16] = -nom_x[17] + true_x[17]; out_7416532235122030660[17] = -nom_x[18] + true_x[18]; out_7416532235122030660[18] = -nom_x[19] + true_x[19]; out_7416532235122030660[19] = -nom_x[20] + true_x[20]; out_7416532235122030660[20] = -nom_x[21] + true_x[21]; } void H_mod_fun(double *state, double *out_7744797074742978621) { out_7744797074742978621[0] = 1.0; out_7744797074742978621[1] = 0; out_7744797074742978621[2] = 0; out_7744797074742978621[3] = 0.0; out_7744797074742978621[4] = 0.0; out_7744797074742978621[5] = 0.0; out_7744797074742978621[6] = 0.0; out_7744797074742978621[7] = 0.0; out_7744797074742978621[8] = 0.0; out_7744797074742978621[9] = 0.0; out_7744797074742978621[10] = 0.0; out_7744797074742978621[11] = 0.0; out_7744797074742978621[12] = 0.0; out_7744797074742978621[13] = 0.0; out_7744797074742978621[14] = 0.0; out_7744797074742978621[15] = 0.0; out_7744797074742978621[16] = 0.0; out_7744797074742978621[17] = 0.0; out_7744797074742978621[18] = 0.0; out_7744797074742978621[19] = 0.0; out_7744797074742978621[20] = 0.0; out_7744797074742978621[21] = 0; out_7744797074742978621[22] = 1.0; out_7744797074742978621[23] = 0; out_7744797074742978621[24] = 0.0; out_7744797074742978621[25] = 0.0; out_7744797074742978621[26] = 0.0; out_7744797074742978621[27] = 0.0; out_7744797074742978621[28] = 0.0; out_7744797074742978621[29] = 0.0; out_7744797074742978621[30] = 0.0; out_7744797074742978621[31] = 0.0; out_7744797074742978621[32] = 0.0; out_7744797074742978621[33] = 0.0; out_7744797074742978621[34] = 0.0; out_7744797074742978621[35] = 0.0; out_7744797074742978621[36] = 0.0; out_7744797074742978621[37] = 0.0; out_7744797074742978621[38] = 0.0; out_7744797074742978621[39] = 0.0; out_7744797074742978621[40] = 0.0; out_7744797074742978621[41] = 0.0; out_7744797074742978621[42] = 0; out_7744797074742978621[43] = 0; out_7744797074742978621[44] = 1.0; out_7744797074742978621[45] = 0.0; out_7744797074742978621[46] = 0.0; out_7744797074742978621[47] = 0.0; out_7744797074742978621[48] = 0.0; out_7744797074742978621[49] = 0.0; out_7744797074742978621[50] = 0.0; out_7744797074742978621[51] = 0.0; out_7744797074742978621[52] = 0.0; out_7744797074742978621[53] = 0.0; out_7744797074742978621[54] = 0.0; out_7744797074742978621[55] = 0.0; out_7744797074742978621[56] = 0.0; out_7744797074742978621[57] = 0.0; out_7744797074742978621[58] = 0.0; out_7744797074742978621[59] = 0.0; out_7744797074742978621[60] = 0.0; out_7744797074742978621[61] = 0.0; out_7744797074742978621[62] = 0.0; out_7744797074742978621[63] = 0.0; out_7744797074742978621[64] = 0.0; out_7744797074742978621[65] = 0.0; out_7744797074742978621[66] = -0.5*state[4]; out_7744797074742978621[67] = -0.5*state[5]; out_7744797074742978621[68] = -0.5*state[6]; out_7744797074742978621[69] = 0.0; out_7744797074742978621[70] = 0.0; out_7744797074742978621[71] = 0.0; out_7744797074742978621[72] = 0.0; out_7744797074742978621[73] = 0.0; out_7744797074742978621[74] = 0.0; out_7744797074742978621[75] = 0.0; out_7744797074742978621[76] = 0.0; out_7744797074742978621[77] = 0.0; out_7744797074742978621[78] = 0.0; out_7744797074742978621[79] = 0.0; out_7744797074742978621[80] = 0.0; out_7744797074742978621[81] = 0.0; out_7744797074742978621[82] = 0.0; out_7744797074742978621[83] = 0.0; out_7744797074742978621[84] = 0.0; out_7744797074742978621[85] = 0.0; out_7744797074742978621[86] = 0.0; out_7744797074742978621[87] = 0.5*state[3]; out_7744797074742978621[88] = 0.5*state[6]; out_7744797074742978621[89] = -0.5*state[5]; out_7744797074742978621[90] = 0.0; out_7744797074742978621[91] = 0.0; out_7744797074742978621[92] = 0.0; out_7744797074742978621[93] = 0.0; out_7744797074742978621[94] = 0.0; out_7744797074742978621[95] = 0.0; out_7744797074742978621[96] = 0.0; out_7744797074742978621[97] = 0.0; out_7744797074742978621[98] = 0.0; out_7744797074742978621[99] = 0.0; out_7744797074742978621[100] = 0.0; out_7744797074742978621[101] = 0.0; out_7744797074742978621[102] = 0.0; out_7744797074742978621[103] = 0.0; out_7744797074742978621[104] = 0.0; out_7744797074742978621[105] = 0.0; out_7744797074742978621[106] = 0.0; out_7744797074742978621[107] = 0.0; out_7744797074742978621[108] = -0.5*state[6]; out_7744797074742978621[109] = 0.5*state[3]; out_7744797074742978621[110] = 0.5*state[4]; out_7744797074742978621[111] = 0.0; out_7744797074742978621[112] = 0.0; out_7744797074742978621[113] = 0.0; out_7744797074742978621[114] = 0.0; out_7744797074742978621[115] = 0.0; out_7744797074742978621[116] = 0.0; out_7744797074742978621[117] = 0.0; out_7744797074742978621[118] = 0.0; out_7744797074742978621[119] = 0.0; out_7744797074742978621[120] = 0.0; out_7744797074742978621[121] = 0.0; out_7744797074742978621[122] = 0.0; out_7744797074742978621[123] = 0.0; out_7744797074742978621[124] = 0.0; out_7744797074742978621[125] = 0.0; out_7744797074742978621[126] = 0.0; out_7744797074742978621[127] = 0.0; out_7744797074742978621[128] = 0.0; out_7744797074742978621[129] = 0.5*state[5]; out_7744797074742978621[130] = -0.5*state[4]; out_7744797074742978621[131] = 0.5*state[3]; out_7744797074742978621[132] = 0.0; out_7744797074742978621[133] = 0.0; out_7744797074742978621[134] = 0.0; out_7744797074742978621[135] = 0.0; out_7744797074742978621[136] = 0.0; out_7744797074742978621[137] = 0.0; out_7744797074742978621[138] = 0.0; out_7744797074742978621[139] = 0.0; out_7744797074742978621[140] = 0.0; out_7744797074742978621[141] = 0.0; out_7744797074742978621[142] = 0.0; out_7744797074742978621[143] = 0.0; out_7744797074742978621[144] = 0.0; out_7744797074742978621[145] = 0.0; out_7744797074742978621[146] = 0.0; out_7744797074742978621[147] = 0.0; out_7744797074742978621[148] = 0.0; out_7744797074742978621[149] = 0.0; out_7744797074742978621[150] = 0.0; out_7744797074742978621[151] = 0.0; out_7744797074742978621[152] = 0.0; out_7744797074742978621[153] = 1.0; out_7744797074742978621[154] = 0; out_7744797074742978621[155] = 0; out_7744797074742978621[156] = 0; out_7744797074742978621[157] = 0; out_7744797074742978621[158] = 0; out_7744797074742978621[159] = 0; out_7744797074742978621[160] = 0; out_7744797074742978621[161] = 0; out_7744797074742978621[162] = 0; out_7744797074742978621[163] = 0; out_7744797074742978621[164] = 0; out_7744797074742978621[165] = 0; out_7744797074742978621[166] = 0; out_7744797074742978621[167] = 0; out_7744797074742978621[168] = 0.0; out_7744797074742978621[169] = 0.0; out_7744797074742978621[170] = 0.0; out_7744797074742978621[171] = 0.0; out_7744797074742978621[172] = 0.0; out_7744797074742978621[173] = 0.0; out_7744797074742978621[174] = 0; out_7744797074742978621[175] = 1.0; out_7744797074742978621[176] = 0; out_7744797074742978621[177] = 0; out_7744797074742978621[178] = 0; out_7744797074742978621[179] = 0; out_7744797074742978621[180] = 0; out_7744797074742978621[181] = 0; out_7744797074742978621[182] = 0; out_7744797074742978621[183] = 0; out_7744797074742978621[184] = 0; out_7744797074742978621[185] = 0; out_7744797074742978621[186] = 0; out_7744797074742978621[187] = 0; out_7744797074742978621[188] = 0; out_7744797074742978621[189] = 0.0; out_7744797074742978621[190] = 0.0; out_7744797074742978621[191] = 0.0; out_7744797074742978621[192] = 0.0; out_7744797074742978621[193] = 0.0; out_7744797074742978621[194] = 0.0; out_7744797074742978621[195] = 0; out_7744797074742978621[196] = 0; out_7744797074742978621[197] = 1.0; out_7744797074742978621[198] = 0; out_7744797074742978621[199] = 0; out_7744797074742978621[200] = 0; out_7744797074742978621[201] = 0; out_7744797074742978621[202] = 0; out_7744797074742978621[203] = 0; out_7744797074742978621[204] = 0; out_7744797074742978621[205] = 0; out_7744797074742978621[206] = 0; out_7744797074742978621[207] = 0; out_7744797074742978621[208] = 0; out_7744797074742978621[209] = 0; out_7744797074742978621[210] = 0.0; out_7744797074742978621[211] = 0.0; out_7744797074742978621[212] = 0.0; out_7744797074742978621[213] = 0.0; out_7744797074742978621[214] = 0.0; out_7744797074742978621[215] = 0.0; out_7744797074742978621[216] = 0; out_7744797074742978621[217] = 0; out_7744797074742978621[218] = 0; out_7744797074742978621[219] = 1.0; out_7744797074742978621[220] = 0; out_7744797074742978621[221] = 0; out_7744797074742978621[222] = 0; out_7744797074742978621[223] = 0; out_7744797074742978621[224] = 0; out_7744797074742978621[225] = 0; out_7744797074742978621[226] = 0; out_7744797074742978621[227] = 0; out_7744797074742978621[228] = 0; out_7744797074742978621[229] = 0; out_7744797074742978621[230] = 0; out_7744797074742978621[231] = 0.0; out_7744797074742978621[232] = 0.0; out_7744797074742978621[233] = 0.0; out_7744797074742978621[234] = 0.0; out_7744797074742978621[235] = 0.0; out_7744797074742978621[236] = 0.0; out_7744797074742978621[237] = 0; out_7744797074742978621[238] = 0; out_7744797074742978621[239] = 0; out_7744797074742978621[240] = 0; out_7744797074742978621[241] = 1.0; out_7744797074742978621[242] = 0; out_7744797074742978621[243] = 0; out_7744797074742978621[244] = 0; out_7744797074742978621[245] = 0; out_7744797074742978621[246] = 0; out_7744797074742978621[247] = 0; out_7744797074742978621[248] = 0; out_7744797074742978621[249] = 0; out_7744797074742978621[250] = 0; out_7744797074742978621[251] = 0; out_7744797074742978621[252] = 0.0; out_7744797074742978621[253] = 0.0; out_7744797074742978621[254] = 0.0; out_7744797074742978621[255] = 0.0; out_7744797074742978621[256] = 0.0; out_7744797074742978621[257] = 0.0; out_7744797074742978621[258] = 0; out_7744797074742978621[259] = 0; out_7744797074742978621[260] = 0; out_7744797074742978621[261] = 0; out_7744797074742978621[262] = 0; out_7744797074742978621[263] = 1.0; out_7744797074742978621[264] = 0; out_7744797074742978621[265] = 0; out_7744797074742978621[266] = 0; out_7744797074742978621[267] = 0; out_7744797074742978621[268] = 0; out_7744797074742978621[269] = 0; out_7744797074742978621[270] = 0; out_7744797074742978621[271] = 0; out_7744797074742978621[272] = 0; out_7744797074742978621[273] = 0.0; out_7744797074742978621[274] = 0.0; out_7744797074742978621[275] = 0.0; out_7744797074742978621[276] = 0.0; out_7744797074742978621[277] = 0.0; out_7744797074742978621[278] = 0.0; out_7744797074742978621[279] = 0; out_7744797074742978621[280] = 0; out_7744797074742978621[281] = 0; out_7744797074742978621[282] = 0; out_7744797074742978621[283] = 0; out_7744797074742978621[284] = 0; out_7744797074742978621[285] = 1.0; out_7744797074742978621[286] = 0; out_7744797074742978621[287] = 0; out_7744797074742978621[288] = 0; out_7744797074742978621[289] = 0; out_7744797074742978621[290] = 0; out_7744797074742978621[291] = 0; out_7744797074742978621[292] = 0; out_7744797074742978621[293] = 0; out_7744797074742978621[294] = 0.0; out_7744797074742978621[295] = 0.0; out_7744797074742978621[296] = 0.0; out_7744797074742978621[297] = 0.0; out_7744797074742978621[298] = 0.0; out_7744797074742978621[299] = 0.0; out_7744797074742978621[300] = 0; out_7744797074742978621[301] = 0; out_7744797074742978621[302] = 0; out_7744797074742978621[303] = 0; out_7744797074742978621[304] = 0; out_7744797074742978621[305] = 0; out_7744797074742978621[306] = 0; out_7744797074742978621[307] = 1.0; out_7744797074742978621[308] = 0; out_7744797074742978621[309] = 0; out_7744797074742978621[310] = 0; out_7744797074742978621[311] = 0; out_7744797074742978621[312] = 0; out_7744797074742978621[313] = 0; out_7744797074742978621[314] = 0; out_7744797074742978621[315] = 0.0; out_7744797074742978621[316] = 0.0; out_7744797074742978621[317] = 0.0; out_7744797074742978621[318] = 0.0; out_7744797074742978621[319] = 0.0; out_7744797074742978621[320] = 0.0; out_7744797074742978621[321] = 0; out_7744797074742978621[322] = 0; out_7744797074742978621[323] = 0; out_7744797074742978621[324] = 0; out_7744797074742978621[325] = 0; out_7744797074742978621[326] = 0; out_7744797074742978621[327] = 0; out_7744797074742978621[328] = 0; out_7744797074742978621[329] = 1.0; out_7744797074742978621[330] = 0; out_7744797074742978621[331] = 0; out_7744797074742978621[332] = 0; out_7744797074742978621[333] = 0; out_7744797074742978621[334] = 0; out_7744797074742978621[335] = 0; out_7744797074742978621[336] = 0.0; out_7744797074742978621[337] = 0.0; out_7744797074742978621[338] = 0.0; out_7744797074742978621[339] = 0.0; out_7744797074742978621[340] = 0.0; out_7744797074742978621[341] = 0.0; out_7744797074742978621[342] = 0; out_7744797074742978621[343] = 0; out_7744797074742978621[344] = 0; out_7744797074742978621[345] = 0; out_7744797074742978621[346] = 0; out_7744797074742978621[347] = 0; out_7744797074742978621[348] = 0; out_7744797074742978621[349] = 0; out_7744797074742978621[350] = 0; out_7744797074742978621[351] = 1.0; out_7744797074742978621[352] = 0; out_7744797074742978621[353] = 0; out_7744797074742978621[354] = 0; out_7744797074742978621[355] = 0; out_7744797074742978621[356] = 0; out_7744797074742978621[357] = 0.0; out_7744797074742978621[358] = 0.0; out_7744797074742978621[359] = 0.0; out_7744797074742978621[360] = 0.0; out_7744797074742978621[361] = 0.0; out_7744797074742978621[362] = 0.0; out_7744797074742978621[363] = 0; out_7744797074742978621[364] = 0; out_7744797074742978621[365] = 0; out_7744797074742978621[366] = 0; out_7744797074742978621[367] = 0; out_7744797074742978621[368] = 0; out_7744797074742978621[369] = 0; out_7744797074742978621[370] = 0; out_7744797074742978621[371] = 0; out_7744797074742978621[372] = 0; out_7744797074742978621[373] = 1.0; out_7744797074742978621[374] = 0; out_7744797074742978621[375] = 0; out_7744797074742978621[376] = 0; out_7744797074742978621[377] = 0; out_7744797074742978621[378] = 0.0; out_7744797074742978621[379] = 0.0; out_7744797074742978621[380] = 0.0; out_7744797074742978621[381] = 0.0; out_7744797074742978621[382] = 0.0; out_7744797074742978621[383] = 0.0; out_7744797074742978621[384] = 0; out_7744797074742978621[385] = 0; out_7744797074742978621[386] = 0; out_7744797074742978621[387] = 0; out_7744797074742978621[388] = 0; out_7744797074742978621[389] = 0; out_7744797074742978621[390] = 0; out_7744797074742978621[391] = 0; out_7744797074742978621[392] = 0; out_7744797074742978621[393] = 0; out_7744797074742978621[394] = 0; out_7744797074742978621[395] = 1.0; out_7744797074742978621[396] = 0; out_7744797074742978621[397] = 0; out_7744797074742978621[398] = 0; out_7744797074742978621[399] = 0.0; out_7744797074742978621[400] = 0.0; out_7744797074742978621[401] = 0.0; out_7744797074742978621[402] = 0.0; out_7744797074742978621[403] = 0.0; out_7744797074742978621[404] = 0.0; out_7744797074742978621[405] = 0; out_7744797074742978621[406] = 0; out_7744797074742978621[407] = 0; out_7744797074742978621[408] = 0; out_7744797074742978621[409] = 0; out_7744797074742978621[410] = 0; out_7744797074742978621[411] = 0; out_7744797074742978621[412] = 0; out_7744797074742978621[413] = 0; out_7744797074742978621[414] = 0; out_7744797074742978621[415] = 0; out_7744797074742978621[416] = 0; out_7744797074742978621[417] = 1.0; out_7744797074742978621[418] = 0; out_7744797074742978621[419] = 0; out_7744797074742978621[420] = 0.0; out_7744797074742978621[421] = 0.0; out_7744797074742978621[422] = 0.0; out_7744797074742978621[423] = 0.0; out_7744797074742978621[424] = 0.0; out_7744797074742978621[425] = 0.0; out_7744797074742978621[426] = 0; out_7744797074742978621[427] = 0; out_7744797074742978621[428] = 0; out_7744797074742978621[429] = 0; out_7744797074742978621[430] = 0; out_7744797074742978621[431] = 0; out_7744797074742978621[432] = 0; out_7744797074742978621[433] = 0; out_7744797074742978621[434] = 0; out_7744797074742978621[435] = 0; out_7744797074742978621[436] = 0; out_7744797074742978621[437] = 0; out_7744797074742978621[438] = 0; out_7744797074742978621[439] = 1.0; out_7744797074742978621[440] = 0; out_7744797074742978621[441] = 0.0; out_7744797074742978621[442] = 0.0; out_7744797074742978621[443] = 0.0; out_7744797074742978621[444] = 0.0; out_7744797074742978621[445] = 0.0; out_7744797074742978621[446] = 0.0; out_7744797074742978621[447] = 0; out_7744797074742978621[448] = 0; out_7744797074742978621[449] = 0; out_7744797074742978621[450] = 0; out_7744797074742978621[451] = 0; out_7744797074742978621[452] = 0; out_7744797074742978621[453] = 0; out_7744797074742978621[454] = 0; out_7744797074742978621[455] = 0; out_7744797074742978621[456] = 0; out_7744797074742978621[457] = 0; out_7744797074742978621[458] = 0; out_7744797074742978621[459] = 0; out_7744797074742978621[460] = 0; out_7744797074742978621[461] = 1.0; } void f_fun(double *state, double dt, double *out_8063025216892748525) { out_8063025216892748525[0] = dt*state[7] + state[0]; out_8063025216892748525[1] = dt*state[8] + state[1]; out_8063025216892748525[2] = dt*state[9] + state[2]; out_8063025216892748525[3] = dt*(-0.5*state[4]*state[10] - 0.5*state[5]*state[11] - 0.5*state[6]*state[12]) + state[3]; out_8063025216892748525[4] = dt*(0.5*state[3]*state[10] + 0.5*state[5]*state[12] - 0.5*state[6]*state[11]) + state[4]; out_8063025216892748525[5] = dt*(0.5*state[3]*state[11] - 0.5*state[4]*state[12] + 0.5*state[6]*state[10]) + state[5]; out_8063025216892748525[6] = dt*(0.5*state[3]*state[12] + 0.5*state[4]*state[11] - 0.5*state[5]*state[10]) + state[6]; out_8063025216892748525[7] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[18] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[17] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[16]) + state[7]; out_8063025216892748525[8] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[18] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[16] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[17]) + state[8]; out_8063025216892748525[9] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[17] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]) + state[9]; out_8063025216892748525[10] = state[10]; out_8063025216892748525[11] = state[11]; out_8063025216892748525[12] = state[12]; out_8063025216892748525[13] = state[13]; out_8063025216892748525[14] = state[14]; out_8063025216892748525[15] = state[15]; out_8063025216892748525[16] = state[16]; out_8063025216892748525[17] = state[17]; out_8063025216892748525[18] = state[18]; out_8063025216892748525[19] = state[19]; out_8063025216892748525[20] = state[20]; out_8063025216892748525[21] = state[21]; } void F_fun(double *state, double dt, double *out_1924980074135776075) { out_1924980074135776075[0] = 1; out_1924980074135776075[1] = 0; out_1924980074135776075[2] = 0; out_1924980074135776075[3] = 0; out_1924980074135776075[4] = 0; out_1924980074135776075[5] = 0; out_1924980074135776075[6] = dt; out_1924980074135776075[7] = 0; out_1924980074135776075[8] = 0; out_1924980074135776075[9] = 0; out_1924980074135776075[10] = 0; out_1924980074135776075[11] = 0; out_1924980074135776075[12] = 0; out_1924980074135776075[13] = 0; out_1924980074135776075[14] = 0; out_1924980074135776075[15] = 0; out_1924980074135776075[16] = 0; out_1924980074135776075[17] = 0; out_1924980074135776075[18] = 0; out_1924980074135776075[19] = 0; out_1924980074135776075[20] = 0; out_1924980074135776075[21] = 0; out_1924980074135776075[22] = 1; out_1924980074135776075[23] = 0; out_1924980074135776075[24] = 0; out_1924980074135776075[25] = 0; out_1924980074135776075[26] = 0; out_1924980074135776075[27] = 0; out_1924980074135776075[28] = dt; out_1924980074135776075[29] = 0; out_1924980074135776075[30] = 0; out_1924980074135776075[31] = 0; out_1924980074135776075[32] = 0; out_1924980074135776075[33] = 0; out_1924980074135776075[34] = 0; out_1924980074135776075[35] = 0; out_1924980074135776075[36] = 0; out_1924980074135776075[37] = 0; out_1924980074135776075[38] = 0; out_1924980074135776075[39] = 0; out_1924980074135776075[40] = 0; out_1924980074135776075[41] = 0; out_1924980074135776075[42] = 0; out_1924980074135776075[43] = 0; out_1924980074135776075[44] = 1; out_1924980074135776075[45] = 0; out_1924980074135776075[46] = 0; out_1924980074135776075[47] = 0; out_1924980074135776075[48] = 0; out_1924980074135776075[49] = 0; out_1924980074135776075[50] = dt; out_1924980074135776075[51] = 0; out_1924980074135776075[52] = 0; out_1924980074135776075[53] = 0; out_1924980074135776075[54] = 0; out_1924980074135776075[55] = 0; out_1924980074135776075[56] = 0; out_1924980074135776075[57] = 0; out_1924980074135776075[58] = 0; out_1924980074135776075[59] = 0; out_1924980074135776075[60] = 0; out_1924980074135776075[61] = 0; out_1924980074135776075[62] = 0; out_1924980074135776075[63] = 0; out_1924980074135776075[64] = 0; out_1924980074135776075[65] = 0; out_1924980074135776075[66] = 1; out_1924980074135776075[67] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[11] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[10] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[12]); out_1924980074135776075[68] = dt*((2*state[3]*state[4] - 2*state[5]*state[6])*state[12] + (-2*state[3]*state[6] - 2*state[4]*state[5])*state[10] + (-pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[11]); out_1924980074135776075[69] = 0; out_1924980074135776075[70] = 0; out_1924980074135776075[71] = 0; out_1924980074135776075[72] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); out_1924980074135776075[73] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]); out_1924980074135776075[74] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]); out_1924980074135776075[75] = 0; out_1924980074135776075[76] = 0; out_1924980074135776075[77] = 0; out_1924980074135776075[78] = 0; out_1924980074135776075[79] = 0; out_1924980074135776075[80] = 0; out_1924980074135776075[81] = 0; out_1924980074135776075[82] = 0; out_1924980074135776075[83] = 0; out_1924980074135776075[84] = 0; out_1924980074135776075[85] = 0; out_1924980074135776075[86] = 0; out_1924980074135776075[87] = dt*(-(2*state[3]*state[4] + 2*state[5]*state[6])*state[11] - (-2*state[3]*state[5] + 2*state[4]*state[6])*state[10] - (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[12]); out_1924980074135776075[88] = 1; out_1924980074135776075[89] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[12] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[11] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[10]); out_1924980074135776075[90] = 0; out_1924980074135776075[91] = 0; out_1924980074135776075[92] = 0; out_1924980074135776075[93] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]); out_1924980074135776075[94] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); out_1924980074135776075[95] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]); out_1924980074135776075[96] = 0; out_1924980074135776075[97] = 0; out_1924980074135776075[98] = 0; out_1924980074135776075[99] = 0; out_1924980074135776075[100] = 0; out_1924980074135776075[101] = 0; out_1924980074135776075[102] = 0; out_1924980074135776075[103] = 0; out_1924980074135776075[104] = 0; out_1924980074135776075[105] = 0; out_1924980074135776075[106] = 0; out_1924980074135776075[107] = 0; out_1924980074135776075[108] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[12] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[10] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[11]); out_1924980074135776075[109] = dt*((-2*state[3]*state[5] - 2*state[4]*state[6])*state[12] + (2*state[3]*state[6] - 2*state[4]*state[5])*state[11] + (-pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) + pow(state[6], 2))*state[10]); out_1924980074135776075[110] = 1; out_1924980074135776075[111] = 0; out_1924980074135776075[112] = 0; out_1924980074135776075[113] = 0; out_1924980074135776075[114] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]); out_1924980074135776075[115] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]); out_1924980074135776075[116] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); out_1924980074135776075[117] = 0; out_1924980074135776075[118] = 0; out_1924980074135776075[119] = 0; out_1924980074135776075[120] = 0; out_1924980074135776075[121] = 0; out_1924980074135776075[122] = 0; out_1924980074135776075[123] = 0; out_1924980074135776075[124] = 0; out_1924980074135776075[125] = 0; out_1924980074135776075[126] = 0; out_1924980074135776075[127] = 0; out_1924980074135776075[128] = 0; out_1924980074135776075[129] = 0; out_1924980074135776075[130] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[17] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]); out_1924980074135776075[131] = dt*((2*state[3]*state[4] - 2*state[5]*state[6])*state[18] + (-2*state[3]*state[6] - 2*state[4]*state[5])*state[16] + (-pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[17]); out_1924980074135776075[132] = 1; out_1924980074135776075[133] = 0; out_1924980074135776075[134] = 0; out_1924980074135776075[135] = 0; out_1924980074135776075[136] = 0; out_1924980074135776075[137] = 0; out_1924980074135776075[138] = 0; out_1924980074135776075[139] = 0; out_1924980074135776075[140] = 0; out_1924980074135776075[141] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); out_1924980074135776075[142] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]); out_1924980074135776075[143] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]); out_1924980074135776075[144] = 0; out_1924980074135776075[145] = 0; out_1924980074135776075[146] = 0; out_1924980074135776075[147] = 0; out_1924980074135776075[148] = 0; out_1924980074135776075[149] = 0; out_1924980074135776075[150] = dt*(-(2*state[3]*state[4] + 2*state[5]*state[6])*state[17] - (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] - (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]); out_1924980074135776075[151] = 0; out_1924980074135776075[152] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[18] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[17] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[16]); out_1924980074135776075[153] = 0; out_1924980074135776075[154] = 1; out_1924980074135776075[155] = 0; out_1924980074135776075[156] = 0; out_1924980074135776075[157] = 0; out_1924980074135776075[158] = 0; out_1924980074135776075[159] = 0; out_1924980074135776075[160] = 0; out_1924980074135776075[161] = 0; out_1924980074135776075[162] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]); out_1924980074135776075[163] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); out_1924980074135776075[164] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]); out_1924980074135776075[165] = 0; out_1924980074135776075[166] = 0; out_1924980074135776075[167] = 0; out_1924980074135776075[168] = 0; out_1924980074135776075[169] = 0; out_1924980074135776075[170] = 0; out_1924980074135776075[171] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[18] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[16] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[17]); out_1924980074135776075[172] = dt*((-2*state[3]*state[5] - 2*state[4]*state[6])*state[18] + (2*state[3]*state[6] - 2*state[4]*state[5])*state[17] + (-pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) + pow(state[6], 2))*state[16]); out_1924980074135776075[173] = 0; out_1924980074135776075[174] = 0; out_1924980074135776075[175] = 0; out_1924980074135776075[176] = 1; out_1924980074135776075[177] = 0; out_1924980074135776075[178] = 0; out_1924980074135776075[179] = 0; out_1924980074135776075[180] = 0; out_1924980074135776075[181] = 0; out_1924980074135776075[182] = 0; out_1924980074135776075[183] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]); out_1924980074135776075[184] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]); out_1924980074135776075[185] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); out_1924980074135776075[186] = 0; out_1924980074135776075[187] = 0; out_1924980074135776075[188] = 0; out_1924980074135776075[189] = 0; out_1924980074135776075[190] = 0; out_1924980074135776075[191] = 0; out_1924980074135776075[192] = 0; out_1924980074135776075[193] = 0; out_1924980074135776075[194] = 0; out_1924980074135776075[195] = 0; out_1924980074135776075[196] = 0; out_1924980074135776075[197] = 0; out_1924980074135776075[198] = 1; out_1924980074135776075[199] = 0; out_1924980074135776075[200] = 0; out_1924980074135776075[201] = 0; out_1924980074135776075[202] = 0; out_1924980074135776075[203] = 0; out_1924980074135776075[204] = 0; out_1924980074135776075[205] = 0; out_1924980074135776075[206] = 0; out_1924980074135776075[207] = 0; out_1924980074135776075[208] = 0; out_1924980074135776075[209] = 0; out_1924980074135776075[210] = 0; out_1924980074135776075[211] = 0; out_1924980074135776075[212] = 0; out_1924980074135776075[213] = 0; out_1924980074135776075[214] = 0; out_1924980074135776075[215] = 0; out_1924980074135776075[216] = 0; out_1924980074135776075[217] = 0; out_1924980074135776075[218] = 0; out_1924980074135776075[219] = 0; out_1924980074135776075[220] = 1; out_1924980074135776075[221] = 0; out_1924980074135776075[222] = 0; out_1924980074135776075[223] = 0; out_1924980074135776075[224] = 0; out_1924980074135776075[225] = 0; out_1924980074135776075[226] = 0; out_1924980074135776075[227] = 0; out_1924980074135776075[228] = 0; out_1924980074135776075[229] = 0; out_1924980074135776075[230] = 0; out_1924980074135776075[231] = 0; out_1924980074135776075[232] = 0; out_1924980074135776075[233] = 0; out_1924980074135776075[234] = 0; out_1924980074135776075[235] = 0; out_1924980074135776075[236] = 0; out_1924980074135776075[237] = 0; out_1924980074135776075[238] = 0; out_1924980074135776075[239] = 0; out_1924980074135776075[240] = 0; out_1924980074135776075[241] = 0; out_1924980074135776075[242] = 1; out_1924980074135776075[243] = 0; out_1924980074135776075[244] = 0; out_1924980074135776075[245] = 0; out_1924980074135776075[246] = 0; out_1924980074135776075[247] = 0; out_1924980074135776075[248] = 0; out_1924980074135776075[249] = 0; out_1924980074135776075[250] = 0; out_1924980074135776075[251] = 0; out_1924980074135776075[252] = 0; out_1924980074135776075[253] = 0; out_1924980074135776075[254] = 0; out_1924980074135776075[255] = 0; out_1924980074135776075[256] = 0; out_1924980074135776075[257] = 0; out_1924980074135776075[258] = 0; out_1924980074135776075[259] = 0; out_1924980074135776075[260] = 0; out_1924980074135776075[261] = 0; out_1924980074135776075[262] = 0; out_1924980074135776075[263] = 0; out_1924980074135776075[264] = 1; out_1924980074135776075[265] = 0; out_1924980074135776075[266] = 0; out_1924980074135776075[267] = 0; out_1924980074135776075[268] = 0; out_1924980074135776075[269] = 0; out_1924980074135776075[270] = 0; out_1924980074135776075[271] = 0; out_1924980074135776075[272] = 0; out_1924980074135776075[273] = 0; out_1924980074135776075[274] = 0; out_1924980074135776075[275] = 0; out_1924980074135776075[276] = 0; out_1924980074135776075[277] = 0; out_1924980074135776075[278] = 0; out_1924980074135776075[279] = 0; out_1924980074135776075[280] = 0; out_1924980074135776075[281] = 0; out_1924980074135776075[282] = 0; out_1924980074135776075[283] = 0; out_1924980074135776075[284] = 0; out_1924980074135776075[285] = 0; out_1924980074135776075[286] = 1; out_1924980074135776075[287] = 0; out_1924980074135776075[288] = 0; out_1924980074135776075[289] = 0; out_1924980074135776075[290] = 0; out_1924980074135776075[291] = 0; out_1924980074135776075[292] = 0; out_1924980074135776075[293] = 0; out_1924980074135776075[294] = 0; out_1924980074135776075[295] = 0; out_1924980074135776075[296] = 0; out_1924980074135776075[297] = 0; out_1924980074135776075[298] = 0; out_1924980074135776075[299] = 0; out_1924980074135776075[300] = 0; out_1924980074135776075[301] = 0; out_1924980074135776075[302] = 0; out_1924980074135776075[303] = 0; out_1924980074135776075[304] = 0; out_1924980074135776075[305] = 0; out_1924980074135776075[306] = 0; out_1924980074135776075[307] = 0; out_1924980074135776075[308] = 1; out_1924980074135776075[309] = 0; out_1924980074135776075[310] = 0; out_1924980074135776075[311] = 0; out_1924980074135776075[312] = 0; out_1924980074135776075[313] = 0; out_1924980074135776075[314] = 0; out_1924980074135776075[315] = 0; out_1924980074135776075[316] = 0; out_1924980074135776075[317] = 0; out_1924980074135776075[318] = 0; out_1924980074135776075[319] = 0; out_1924980074135776075[320] = 0; out_1924980074135776075[321] = 0; out_1924980074135776075[322] = 0; out_1924980074135776075[323] = 0; out_1924980074135776075[324] = 0; out_1924980074135776075[325] = 0; out_1924980074135776075[326] = 0; out_1924980074135776075[327] = 0; out_1924980074135776075[328] = 0; out_1924980074135776075[329] = 0; out_1924980074135776075[330] = 1; out_1924980074135776075[331] = 0; out_1924980074135776075[332] = 0; out_1924980074135776075[333] = 0; out_1924980074135776075[334] = 0; out_1924980074135776075[335] = 0; out_1924980074135776075[336] = 0; out_1924980074135776075[337] = 0; out_1924980074135776075[338] = 0; out_1924980074135776075[339] = 0; out_1924980074135776075[340] = 0; out_1924980074135776075[341] = 0; out_1924980074135776075[342] = 0; out_1924980074135776075[343] = 0; out_1924980074135776075[344] = 0; out_1924980074135776075[345] = 0; out_1924980074135776075[346] = 0; out_1924980074135776075[347] = 0; out_1924980074135776075[348] = 0; out_1924980074135776075[349] = 0; out_1924980074135776075[350] = 0; out_1924980074135776075[351] = 0; out_1924980074135776075[352] = 1; out_1924980074135776075[353] = 0; out_1924980074135776075[354] = 0; out_1924980074135776075[355] = 0; out_1924980074135776075[356] = 0; out_1924980074135776075[357] = 0; out_1924980074135776075[358] = 0; out_1924980074135776075[359] = 0; out_1924980074135776075[360] = 0; out_1924980074135776075[361] = 0; out_1924980074135776075[362] = 0; out_1924980074135776075[363] = 0; out_1924980074135776075[364] = 0; out_1924980074135776075[365] = 0; out_1924980074135776075[366] = 0; out_1924980074135776075[367] = 0; out_1924980074135776075[368] = 0; out_1924980074135776075[369] = 0; out_1924980074135776075[370] = 0; out_1924980074135776075[371] = 0; out_1924980074135776075[372] = 0; out_1924980074135776075[373] = 0; out_1924980074135776075[374] = 1; out_1924980074135776075[375] = 0; out_1924980074135776075[376] = 0; out_1924980074135776075[377] = 0; out_1924980074135776075[378] = 0; out_1924980074135776075[379] = 0; out_1924980074135776075[380] = 0; out_1924980074135776075[381] = 0; out_1924980074135776075[382] = 0; out_1924980074135776075[383] = 0; out_1924980074135776075[384] = 0; out_1924980074135776075[385] = 0; out_1924980074135776075[386] = 0; out_1924980074135776075[387] = 0; out_1924980074135776075[388] = 0; out_1924980074135776075[389] = 0; out_1924980074135776075[390] = 0; out_1924980074135776075[391] = 0; out_1924980074135776075[392] = 0; out_1924980074135776075[393] = 0; out_1924980074135776075[394] = 0; out_1924980074135776075[395] = 0; out_1924980074135776075[396] = 1; out_1924980074135776075[397] = 0; out_1924980074135776075[398] = 0; out_1924980074135776075[399] = 0; out_1924980074135776075[400] = 0; out_1924980074135776075[401] = 0; out_1924980074135776075[402] = 0; out_1924980074135776075[403] = 0; out_1924980074135776075[404] = 0; out_1924980074135776075[405] = 0; out_1924980074135776075[406] = 0; out_1924980074135776075[407] = 0; out_1924980074135776075[408] = 0; out_1924980074135776075[409] = 0; out_1924980074135776075[410] = 0; out_1924980074135776075[411] = 0; out_1924980074135776075[412] = 0; out_1924980074135776075[413] = 0; out_1924980074135776075[414] = 0; out_1924980074135776075[415] = 0; out_1924980074135776075[416] = 0; out_1924980074135776075[417] = 0; out_1924980074135776075[418] = 1; out_1924980074135776075[419] = 0; out_1924980074135776075[420] = 0; out_1924980074135776075[421] = 0; out_1924980074135776075[422] = 0; out_1924980074135776075[423] = 0; out_1924980074135776075[424] = 0; out_1924980074135776075[425] = 0; out_1924980074135776075[426] = 0; out_1924980074135776075[427] = 0; out_1924980074135776075[428] = 0; out_1924980074135776075[429] = 0; out_1924980074135776075[430] = 0; out_1924980074135776075[431] = 0; out_1924980074135776075[432] = 0; out_1924980074135776075[433] = 0; out_1924980074135776075[434] = 0; out_1924980074135776075[435] = 0; out_1924980074135776075[436] = 0; out_1924980074135776075[437] = 0; out_1924980074135776075[438] = 0; out_1924980074135776075[439] = 0; out_1924980074135776075[440] = 1; } void h_4(double *state, double *unused, double *out_7366302340587907635) { out_7366302340587907635[0] = state[10] + state[13]; out_7366302340587907635[1] = state[11] + state[14]; out_7366302340587907635[2] = state[12] + state[15]; } void H_4(double *state, double *unused, double *out_8678952100085115055) { out_8678952100085115055[0] = 0; out_8678952100085115055[1] = 0; out_8678952100085115055[2] = 0; out_8678952100085115055[3] = 0; out_8678952100085115055[4] = 0; out_8678952100085115055[5] = 0; out_8678952100085115055[6] = 0; out_8678952100085115055[7] = 0; out_8678952100085115055[8] = 0; out_8678952100085115055[9] = 0; out_8678952100085115055[10] = 1; out_8678952100085115055[11] = 0; out_8678952100085115055[12] = 0; out_8678952100085115055[13] = 1; out_8678952100085115055[14] = 0; out_8678952100085115055[15] = 0; out_8678952100085115055[16] = 0; out_8678952100085115055[17] = 0; out_8678952100085115055[18] = 0; out_8678952100085115055[19] = 0; out_8678952100085115055[20] = 0; out_8678952100085115055[21] = 0; out_8678952100085115055[22] = 0; out_8678952100085115055[23] = 0; out_8678952100085115055[24] = 0; out_8678952100085115055[25] = 0; out_8678952100085115055[26] = 0; out_8678952100085115055[27] = 0; out_8678952100085115055[28] = 0; out_8678952100085115055[29] = 0; out_8678952100085115055[30] = 0; out_8678952100085115055[31] = 0; out_8678952100085115055[32] = 0; out_8678952100085115055[33] = 1; out_8678952100085115055[34] = 0; out_8678952100085115055[35] = 0; out_8678952100085115055[36] = 1; out_8678952100085115055[37] = 0; out_8678952100085115055[38] = 0; out_8678952100085115055[39] = 0; out_8678952100085115055[40] = 0; out_8678952100085115055[41] = 0; out_8678952100085115055[42] = 0; out_8678952100085115055[43] = 0; out_8678952100085115055[44] = 0; out_8678952100085115055[45] = 0; out_8678952100085115055[46] = 0; out_8678952100085115055[47] = 0; out_8678952100085115055[48] = 0; out_8678952100085115055[49] = 0; out_8678952100085115055[50] = 0; out_8678952100085115055[51] = 0; out_8678952100085115055[52] = 0; out_8678952100085115055[53] = 0; out_8678952100085115055[54] = 0; out_8678952100085115055[55] = 0; out_8678952100085115055[56] = 1; out_8678952100085115055[57] = 0; out_8678952100085115055[58] = 0; out_8678952100085115055[59] = 1; out_8678952100085115055[60] = 0; out_8678952100085115055[61] = 0; out_8678952100085115055[62] = 0; out_8678952100085115055[63] = 0; out_8678952100085115055[64] = 0; out_8678952100085115055[65] = 0; } void h_9(double *state, double *unused, double *out_1116014595619586497) { out_1116014595619586497[0] = state[10]; out_1116014595619586497[1] = state[11]; out_1116014595619586497[2] = state[12]; } void H_9(double *state, double *unused, double *out_2480573038359989091) { out_2480573038359989091[0] = 0; out_2480573038359989091[1] = 0; out_2480573038359989091[2] = 0; out_2480573038359989091[3] = 0; out_2480573038359989091[4] = 0; out_2480573038359989091[5] = 0; out_2480573038359989091[6] = 0; out_2480573038359989091[7] = 0; out_2480573038359989091[8] = 0; out_2480573038359989091[9] = 0; out_2480573038359989091[10] = 1; out_2480573038359989091[11] = 0; out_2480573038359989091[12] = 0; out_2480573038359989091[13] = 0; out_2480573038359989091[14] = 0; out_2480573038359989091[15] = 0; out_2480573038359989091[16] = 0; out_2480573038359989091[17] = 0; out_2480573038359989091[18] = 0; out_2480573038359989091[19] = 0; out_2480573038359989091[20] = 0; out_2480573038359989091[21] = 0; out_2480573038359989091[22] = 0; out_2480573038359989091[23] = 0; out_2480573038359989091[24] = 0; out_2480573038359989091[25] = 0; out_2480573038359989091[26] = 0; out_2480573038359989091[27] = 0; out_2480573038359989091[28] = 0; out_2480573038359989091[29] = 0; out_2480573038359989091[30] = 0; out_2480573038359989091[31] = 0; out_2480573038359989091[32] = 0; out_2480573038359989091[33] = 1; out_2480573038359989091[34] = 0; out_2480573038359989091[35] = 0; out_2480573038359989091[36] = 0; out_2480573038359989091[37] = 0; out_2480573038359989091[38] = 0; out_2480573038359989091[39] = 0; out_2480573038359989091[40] = 0; out_2480573038359989091[41] = 0; out_2480573038359989091[42] = 0; out_2480573038359989091[43] = 0; out_2480573038359989091[44] = 0; out_2480573038359989091[45] = 0; out_2480573038359989091[46] = 0; out_2480573038359989091[47] = 0; out_2480573038359989091[48] = 0; out_2480573038359989091[49] = 0; out_2480573038359989091[50] = 0; out_2480573038359989091[51] = 0; out_2480573038359989091[52] = 0; out_2480573038359989091[53] = 0; out_2480573038359989091[54] = 0; out_2480573038359989091[55] = 0; out_2480573038359989091[56] = 1; out_2480573038359989091[57] = 0; out_2480573038359989091[58] = 0; out_2480573038359989091[59] = 0; out_2480573038359989091[60] = 0; out_2480573038359989091[61] = 0; out_2480573038359989091[62] = 0; out_2480573038359989091[63] = 0; out_2480573038359989091[64] = 0; out_2480573038359989091[65] = 0; } void h_10(double *state, double *unused, double *out_15153629602772458) { out_15153629602772458[0] = 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] + state[16] + state[19]; out_15153629602772458[1] = 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[17] + state[20]; out_15153629602772458[2] = 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[18] + state[21]; } void H_10(double *state, double *unused, double *out_4583653000591918572) { out_4583653000591918572[0] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*pow(state[0], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); out_4583653000591918572[1] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1]; out_4583653000591918572[2] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[2]; out_4583653000591918572[3] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]; out_4583653000591918572[4] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]; out_4583653000591918572[5] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]; out_4583653000591918572[6] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]; out_4583653000591918572[7] = 0; out_4583653000591918572[8] = 0; out_4583653000591918572[9] = 0; out_4583653000591918572[10] = 0; out_4583653000591918572[11] = 0; out_4583653000591918572[12] = 0; out_4583653000591918572[13] = 0; out_4583653000591918572[14] = 0; out_4583653000591918572[15] = 0; out_4583653000591918572[16] = 1; out_4583653000591918572[17] = 0; out_4583653000591918572[18] = 0; out_4583653000591918572[19] = 1; out_4583653000591918572[20] = 0; out_4583653000591918572[21] = 0; out_4583653000591918572[22] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1]; out_4583653000591918572[23] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*pow(state[1], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); out_4583653000591918572[24] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1]*state[2]; out_4583653000591918572[25] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]; out_4583653000591918572[26] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]; out_4583653000591918572[27] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]; out_4583653000591918572[28] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]; out_4583653000591918572[29] = 0; out_4583653000591918572[30] = 0; out_4583653000591918572[31] = 0; out_4583653000591918572[32] = 0; out_4583653000591918572[33] = 0; out_4583653000591918572[34] = 0; out_4583653000591918572[35] = 0; out_4583653000591918572[36] = 0; out_4583653000591918572[37] = 0; out_4583653000591918572[38] = 0; out_4583653000591918572[39] = 1; out_4583653000591918572[40] = 0; out_4583653000591918572[41] = 0; out_4583653000591918572[42] = 1; out_4583653000591918572[43] = 0; out_4583653000591918572[44] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[0]*state[2]; out_4583653000591918572[45] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[1]*state[2]; out_4583653000591918572[46] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*pow(state[2], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); out_4583653000591918572[47] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]; out_4583653000591918572[48] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]; out_4583653000591918572[49] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]; out_4583653000591918572[50] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]; out_4583653000591918572[51] = 0; out_4583653000591918572[52] = 0; out_4583653000591918572[53] = 0; out_4583653000591918572[54] = 0; out_4583653000591918572[55] = 0; out_4583653000591918572[56] = 0; out_4583653000591918572[57] = 0; out_4583653000591918572[58] = 0; out_4583653000591918572[59] = 0; out_4583653000591918572[60] = 0; out_4583653000591918572[61] = 0; out_4583653000591918572[62] = 1; out_4583653000591918572[63] = 0; out_4583653000591918572[64] = 0; out_4583653000591918572[65] = 1; } void h_12(double *state, double *unused, double *out_9071809923999704409) { out_9071809923999704409[0] = state[0]; out_9071809923999704409[1] = state[1]; out_9071809923999704409[2] = state[2]; } void H_12(double *state, double *unused, double *out_4748335565592474766) { out_4748335565592474766[0] = 1; out_4748335565592474766[1] = 0; out_4748335565592474766[2] = 0; out_4748335565592474766[3] = 0; out_4748335565592474766[4] = 0; out_4748335565592474766[5] = 0; out_4748335565592474766[6] = 0; out_4748335565592474766[7] = 0; out_4748335565592474766[8] = 0; out_4748335565592474766[9] = 0; out_4748335565592474766[10] = 0; out_4748335565592474766[11] = 0; out_4748335565592474766[12] = 0; out_4748335565592474766[13] = 0; out_4748335565592474766[14] = 0; out_4748335565592474766[15] = 0; out_4748335565592474766[16] = 0; out_4748335565592474766[17] = 0; out_4748335565592474766[18] = 0; out_4748335565592474766[19] = 0; out_4748335565592474766[20] = 0; out_4748335565592474766[21] = 0; out_4748335565592474766[22] = 0; out_4748335565592474766[23] = 1; out_4748335565592474766[24] = 0; out_4748335565592474766[25] = 0; out_4748335565592474766[26] = 0; out_4748335565592474766[27] = 0; out_4748335565592474766[28] = 0; out_4748335565592474766[29] = 0; out_4748335565592474766[30] = 0; out_4748335565592474766[31] = 0; out_4748335565592474766[32] = 0; out_4748335565592474766[33] = 0; out_4748335565592474766[34] = 0; out_4748335565592474766[35] = 0; out_4748335565592474766[36] = 0; out_4748335565592474766[37] = 0; out_4748335565592474766[38] = 0; out_4748335565592474766[39] = 0; out_4748335565592474766[40] = 0; out_4748335565592474766[41] = 0; out_4748335565592474766[42] = 0; out_4748335565592474766[43] = 0; out_4748335565592474766[44] = 0; out_4748335565592474766[45] = 0; out_4748335565592474766[46] = 1; out_4748335565592474766[47] = 0; out_4748335565592474766[48] = 0; out_4748335565592474766[49] = 0; out_4748335565592474766[50] = 0; out_4748335565592474766[51] = 0; out_4748335565592474766[52] = 0; out_4748335565592474766[53] = 0; out_4748335565592474766[54] = 0; out_4748335565592474766[55] = 0; out_4748335565592474766[56] = 0; out_4748335565592474766[57] = 0; out_4748335565592474766[58] = 0; out_4748335565592474766[59] = 0; out_4748335565592474766[60] = 0; out_4748335565592474766[61] = 0; out_4748335565592474766[62] = 0; out_4748335565592474766[63] = 0; out_4748335565592474766[64] = 0; out_4748335565592474766[65] = 0; } void h_35(double *state, double *unused, double *out_7011637724721731008) { out_7011637724721731008[0] = state[7]; out_7011637724721731008[1] = state[8]; out_7011637724721731008[2] = state[9]; } void H_35(double *state, double *unused, double *out_2002772533267461057) { out_2002772533267461057[0] = 0; out_2002772533267461057[1] = 0; out_2002772533267461057[2] = 0; out_2002772533267461057[3] = 0; out_2002772533267461057[4] = 0; out_2002772533267461057[5] = 0; out_2002772533267461057[6] = 0; out_2002772533267461057[7] = 1; out_2002772533267461057[8] = 0; out_2002772533267461057[9] = 0; out_2002772533267461057[10] = 0; out_2002772533267461057[11] = 0; out_2002772533267461057[12] = 0; out_2002772533267461057[13] = 0; out_2002772533267461057[14] = 0; out_2002772533267461057[15] = 0; out_2002772533267461057[16] = 0; out_2002772533267461057[17] = 0; out_2002772533267461057[18] = 0; out_2002772533267461057[19] = 0; out_2002772533267461057[20] = 0; out_2002772533267461057[21] = 0; out_2002772533267461057[22] = 0; out_2002772533267461057[23] = 0; out_2002772533267461057[24] = 0; out_2002772533267461057[25] = 0; out_2002772533267461057[26] = 0; out_2002772533267461057[27] = 0; out_2002772533267461057[28] = 0; out_2002772533267461057[29] = 0; out_2002772533267461057[30] = 1; out_2002772533267461057[31] = 0; out_2002772533267461057[32] = 0; out_2002772533267461057[33] = 0; out_2002772533267461057[34] = 0; out_2002772533267461057[35] = 0; out_2002772533267461057[36] = 0; out_2002772533267461057[37] = 0; out_2002772533267461057[38] = 0; out_2002772533267461057[39] = 0; out_2002772533267461057[40] = 0; out_2002772533267461057[41] = 0; out_2002772533267461057[42] = 0; out_2002772533267461057[43] = 0; out_2002772533267461057[44] = 0; out_2002772533267461057[45] = 0; out_2002772533267461057[46] = 0; out_2002772533267461057[47] = 0; out_2002772533267461057[48] = 0; out_2002772533267461057[49] = 0; out_2002772533267461057[50] = 0; out_2002772533267461057[51] = 0; out_2002772533267461057[52] = 0; out_2002772533267461057[53] = 1; out_2002772533267461057[54] = 0; out_2002772533267461057[55] = 0; out_2002772533267461057[56] = 0; out_2002772533267461057[57] = 0; out_2002772533267461057[58] = 0; out_2002772533267461057[59] = 0; out_2002772533267461057[60] = 0; out_2002772533267461057[61] = 0; out_2002772533267461057[62] = 0; out_2002772533267461057[63] = 0; out_2002772533267461057[64] = 0; out_2002772533267461057[65] = 0; } void h_32(double *state, double *unused, double *out_8005805873262674095) { out_8005805873262674095[0] = state[3]; out_8005805873262674095[1] = state[4]; out_8005805873262674095[2] = state[5]; out_8005805873262674095[3] = state[6]; } void H_32(double *state, double *unused, double *out_6269965131311088716) { out_6269965131311088716[0] = 0; out_6269965131311088716[1] = 0; out_6269965131311088716[2] = 0; out_6269965131311088716[3] = 1; out_6269965131311088716[4] = 0; out_6269965131311088716[5] = 0; out_6269965131311088716[6] = 0; out_6269965131311088716[7] = 0; out_6269965131311088716[8] = 0; out_6269965131311088716[9] = 0; out_6269965131311088716[10] = 0; out_6269965131311088716[11] = 0; out_6269965131311088716[12] = 0; out_6269965131311088716[13] = 0; out_6269965131311088716[14] = 0; out_6269965131311088716[15] = 0; out_6269965131311088716[16] = 0; out_6269965131311088716[17] = 0; out_6269965131311088716[18] = 0; out_6269965131311088716[19] = 0; out_6269965131311088716[20] = 0; out_6269965131311088716[21] = 0; out_6269965131311088716[22] = 0; out_6269965131311088716[23] = 0; out_6269965131311088716[24] = 0; out_6269965131311088716[25] = 0; out_6269965131311088716[26] = 1; out_6269965131311088716[27] = 0; out_6269965131311088716[28] = 0; out_6269965131311088716[29] = 0; out_6269965131311088716[30] = 0; out_6269965131311088716[31] = 0; out_6269965131311088716[32] = 0; out_6269965131311088716[33] = 0; out_6269965131311088716[34] = 0; out_6269965131311088716[35] = 0; out_6269965131311088716[36] = 0; out_6269965131311088716[37] = 0; out_6269965131311088716[38] = 0; out_6269965131311088716[39] = 0; out_6269965131311088716[40] = 0; out_6269965131311088716[41] = 0; out_6269965131311088716[42] = 0; out_6269965131311088716[43] = 0; out_6269965131311088716[44] = 0; out_6269965131311088716[45] = 0; out_6269965131311088716[46] = 0; out_6269965131311088716[47] = 0; out_6269965131311088716[48] = 0; out_6269965131311088716[49] = 1; out_6269965131311088716[50] = 0; out_6269965131311088716[51] = 0; out_6269965131311088716[52] = 0; out_6269965131311088716[53] = 0; out_6269965131311088716[54] = 0; out_6269965131311088716[55] = 0; out_6269965131311088716[56] = 0; out_6269965131311088716[57] = 0; out_6269965131311088716[58] = 0; out_6269965131311088716[59] = 0; out_6269965131311088716[60] = 0; out_6269965131311088716[61] = 0; out_6269965131311088716[62] = 0; out_6269965131311088716[63] = 0; out_6269965131311088716[64] = 0; out_6269965131311088716[65] = 0; out_6269965131311088716[66] = 0; out_6269965131311088716[67] = 0; out_6269965131311088716[68] = 0; out_6269965131311088716[69] = 0; out_6269965131311088716[70] = 0; out_6269965131311088716[71] = 0; out_6269965131311088716[72] = 1; out_6269965131311088716[73] = 0; out_6269965131311088716[74] = 0; out_6269965131311088716[75] = 0; out_6269965131311088716[76] = 0; out_6269965131311088716[77] = 0; out_6269965131311088716[78] = 0; out_6269965131311088716[79] = 0; out_6269965131311088716[80] = 0; out_6269965131311088716[81] = 0; out_6269965131311088716[82] = 0; out_6269965131311088716[83] = 0; out_6269965131311088716[84] = 0; out_6269965131311088716[85] = 0; out_6269965131311088716[86] = 0; out_6269965131311088716[87] = 0; } void h_13(double *state, double *unused, double *out_7868428076142185420) { out_7868428076142185420[0] = (-2*state[3]*state[5] + 2*state[4]*state[6])*state[9] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[8] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[7]; out_7868428076142185420[1] = (2*state[3]*state[4] + 2*state[5]*state[6])*state[9] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[7] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[8]; out_7868428076142185420[2] = (-2*state[3]*state[4] + 2*state[5]*state[6])*state[8] + (2*state[3]*state[5] + 2*state[4]*state[6])*state[7] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[9]; } void H_13(double *state, double *unused, double *out_4177806446556115282) { out_4177806446556115282[0] = 0; out_4177806446556115282[1] = 0; out_4177806446556115282[2] = 0; out_4177806446556115282[3] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8]; out_4177806446556115282[4] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; out_4177806446556115282[5] = -2*state[3]*state[9] + 2*state[4]*state[8] - 2*state[5]*state[7]; out_4177806446556115282[6] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7]; out_4177806446556115282[7] = pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2); out_4177806446556115282[8] = 2*state[3]*state[6] + 2*state[4]*state[5]; out_4177806446556115282[9] = -2*state[3]*state[5] + 2*state[4]*state[6]; out_4177806446556115282[10] = 0; out_4177806446556115282[11] = 0; out_4177806446556115282[12] = 0; out_4177806446556115282[13] = 0; out_4177806446556115282[14] = 0; out_4177806446556115282[15] = 0; out_4177806446556115282[16] = 0; out_4177806446556115282[17] = 0; out_4177806446556115282[18] = 0; out_4177806446556115282[19] = 0; out_4177806446556115282[20] = 0; out_4177806446556115282[21] = 0; out_4177806446556115282[22] = 0; out_4177806446556115282[23] = 0; out_4177806446556115282[24] = 0; out_4177806446556115282[25] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7]; out_4177806446556115282[26] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7]; out_4177806446556115282[27] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; out_4177806446556115282[28] = -2*state[3]*state[7] + 2*state[5]*state[9] - 2*state[6]*state[8]; out_4177806446556115282[29] = -2*state[3]*state[6] + 2*state[4]*state[5]; out_4177806446556115282[30] = pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2); out_4177806446556115282[31] = 2*state[3]*state[4] + 2*state[5]*state[6]; out_4177806446556115282[32] = 0; out_4177806446556115282[33] = 0; out_4177806446556115282[34] = 0; out_4177806446556115282[35] = 0; out_4177806446556115282[36] = 0; out_4177806446556115282[37] = 0; out_4177806446556115282[38] = 0; out_4177806446556115282[39] = 0; out_4177806446556115282[40] = 0; out_4177806446556115282[41] = 0; out_4177806446556115282[42] = 0; out_4177806446556115282[43] = 0; out_4177806446556115282[44] = 0; out_4177806446556115282[45] = 0; out_4177806446556115282[46] = 0; out_4177806446556115282[47] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7]; out_4177806446556115282[48] = -2*state[3]*state[8] - 2*state[4]*state[9] + 2*state[6]*state[7]; out_4177806446556115282[49] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8]; out_4177806446556115282[50] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; out_4177806446556115282[51] = 2*state[3]*state[5] + 2*state[4]*state[6]; out_4177806446556115282[52] = -2*state[3]*state[4] + 2*state[5]*state[6]; out_4177806446556115282[53] = pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2); out_4177806446556115282[54] = 0; out_4177806446556115282[55] = 0; out_4177806446556115282[56] = 0; out_4177806446556115282[57] = 0; out_4177806446556115282[58] = 0; out_4177806446556115282[59] = 0; out_4177806446556115282[60] = 0; out_4177806446556115282[61] = 0; out_4177806446556115282[62] = 0; out_4177806446556115282[63] = 0; out_4177806446556115282[64] = 0; out_4177806446556115282[65] = 0; } void h_14(double *state, double *unused, double *out_1116014595619586497) { out_1116014595619586497[0] = state[10]; out_1116014595619586497[1] = state[11]; out_1116014595619586497[2] = state[12]; } void H_14(double *state, double *unused, double *out_2480573038359989091) { out_2480573038359989091[0] = 0; out_2480573038359989091[1] = 0; out_2480573038359989091[2] = 0; out_2480573038359989091[3] = 0; out_2480573038359989091[4] = 0; out_2480573038359989091[5] = 0; out_2480573038359989091[6] = 0; out_2480573038359989091[7] = 0; out_2480573038359989091[8] = 0; out_2480573038359989091[9] = 0; out_2480573038359989091[10] = 1; out_2480573038359989091[11] = 0; out_2480573038359989091[12] = 0; out_2480573038359989091[13] = 0; out_2480573038359989091[14] = 0; out_2480573038359989091[15] = 0; out_2480573038359989091[16] = 0; out_2480573038359989091[17] = 0; out_2480573038359989091[18] = 0; out_2480573038359989091[19] = 0; out_2480573038359989091[20] = 0; out_2480573038359989091[21] = 0; out_2480573038359989091[22] = 0; out_2480573038359989091[23] = 0; out_2480573038359989091[24] = 0; out_2480573038359989091[25] = 0; out_2480573038359989091[26] = 0; out_2480573038359989091[27] = 0; out_2480573038359989091[28] = 0; out_2480573038359989091[29] = 0; out_2480573038359989091[30] = 0; out_2480573038359989091[31] = 0; out_2480573038359989091[32] = 0; out_2480573038359989091[33] = 1; out_2480573038359989091[34] = 0; out_2480573038359989091[35] = 0; out_2480573038359989091[36] = 0; out_2480573038359989091[37] = 0; out_2480573038359989091[38] = 0; out_2480573038359989091[39] = 0; out_2480573038359989091[40] = 0; out_2480573038359989091[41] = 0; out_2480573038359989091[42] = 0; out_2480573038359989091[43] = 0; out_2480573038359989091[44] = 0; out_2480573038359989091[45] = 0; out_2480573038359989091[46] = 0; out_2480573038359989091[47] = 0; out_2480573038359989091[48] = 0; out_2480573038359989091[49] = 0; out_2480573038359989091[50] = 0; out_2480573038359989091[51] = 0; out_2480573038359989091[52] = 0; out_2480573038359989091[53] = 0; out_2480573038359989091[54] = 0; out_2480573038359989091[55] = 0; out_2480573038359989091[56] = 1; out_2480573038359989091[57] = 0; out_2480573038359989091[58] = 0; out_2480573038359989091[59] = 0; out_2480573038359989091[60] = 0; out_2480573038359989091[61] = 0; out_2480573038359989091[62] = 0; out_2480573038359989091[63] = 0; out_2480573038359989091[64] = 0; out_2480573038359989091[65] = 0; } void h_33(double *state, double *unused, double *out_5108012817780654932) { out_5108012817780654932[0] = state[16]; out_5108012817780654932[1] = state[17]; out_5108012817780654932[2] = state[18]; } void H_33(double *state, double *unused, double *out_1147784471371396547) { out_1147784471371396547[0] = 0; out_1147784471371396547[1] = 0; out_1147784471371396547[2] = 0; out_1147784471371396547[3] = 0; out_1147784471371396547[4] = 0; out_1147784471371396547[5] = 0; out_1147784471371396547[6] = 0; out_1147784471371396547[7] = 0; out_1147784471371396547[8] = 0; out_1147784471371396547[9] = 0; out_1147784471371396547[10] = 0; out_1147784471371396547[11] = 0; out_1147784471371396547[12] = 0; out_1147784471371396547[13] = 0; out_1147784471371396547[14] = 0; out_1147784471371396547[15] = 0; out_1147784471371396547[16] = 1; out_1147784471371396547[17] = 0; out_1147784471371396547[18] = 0; out_1147784471371396547[19] = 0; out_1147784471371396547[20] = 0; out_1147784471371396547[21] = 0; out_1147784471371396547[22] = 0; out_1147784471371396547[23] = 0; out_1147784471371396547[24] = 0; out_1147784471371396547[25] = 0; out_1147784471371396547[26] = 0; out_1147784471371396547[27] = 0; out_1147784471371396547[28] = 0; out_1147784471371396547[29] = 0; out_1147784471371396547[30] = 0; out_1147784471371396547[31] = 0; out_1147784471371396547[32] = 0; out_1147784471371396547[33] = 0; out_1147784471371396547[34] = 0; out_1147784471371396547[35] = 0; out_1147784471371396547[36] = 0; out_1147784471371396547[37] = 0; out_1147784471371396547[38] = 0; out_1147784471371396547[39] = 1; out_1147784471371396547[40] = 0; out_1147784471371396547[41] = 0; out_1147784471371396547[42] = 0; out_1147784471371396547[43] = 0; out_1147784471371396547[44] = 0; out_1147784471371396547[45] = 0; out_1147784471371396547[46] = 0; out_1147784471371396547[47] = 0; out_1147784471371396547[48] = 0; out_1147784471371396547[49] = 0; out_1147784471371396547[50] = 0; out_1147784471371396547[51] = 0; out_1147784471371396547[52] = 0; out_1147784471371396547[53] = 0; out_1147784471371396547[54] = 0; out_1147784471371396547[55] = 0; out_1147784471371396547[56] = 0; out_1147784471371396547[57] = 0; out_1147784471371396547[58] = 0; out_1147784471371396547[59] = 0; out_1147784471371396547[60] = 0; out_1147784471371396547[61] = 0; out_1147784471371396547[62] = 1; out_1147784471371396547[63] = 0; out_1147784471371396547[64] = 0; out_1147784471371396547[65] = 0; } #include #include typedef Eigen::Matrix DDM; typedef Eigen::Matrix EEM; typedef Eigen::Matrix DEM; void predict(double *in_x, double *in_P, double *in_Q, double dt) { typedef Eigen::Matrix RRM; double nx[DIM] = {0}; double in_F[EDIM*EDIM] = {0}; // functions from sympy f_fun(in_x, dt, nx); F_fun(in_x, dt, in_F); EEM F(in_F); EEM P(in_P); EEM Q(in_Q); RRM F_main = F.topLeftCorner(MEDIM, MEDIM); P.topLeftCorner(MEDIM, MEDIM) = (F_main * P.topLeftCorner(MEDIM, MEDIM)) * F_main.transpose(); P.topRightCorner(MEDIM, EDIM - MEDIM) = F_main * P.topRightCorner(MEDIM, EDIM - MEDIM); P.bottomLeftCorner(EDIM - MEDIM, MEDIM) = P.bottomLeftCorner(EDIM - MEDIM, MEDIM) * F_main.transpose(); P = P + dt*Q; // copy out state memcpy(in_x, nx, DIM * sizeof(double)); memcpy(in_P, P.data(), EDIM * EDIM * sizeof(double)); } // note: extra_args dim only correct when null space projecting // otherwise 1 template void update(double *in_x, double *in_P, Hfun h_fun, Hfun H_fun, Hfun Hea_fun, double *in_z, double *in_R, double *in_ea, double MAHA_THRESHOLD) { typedef Eigen::Matrix ZZM; typedef Eigen::Matrix ZDM; typedef Eigen::Matrix XEM; //typedef Eigen::Matrix EZM; typedef Eigen::Matrix X1M; typedef Eigen::Matrix XXM; double in_hx[ZDIM] = {0}; double in_H[ZDIM * DIM] = {0}; double in_H_mod[EDIM * DIM] = {0}; double delta_x[EDIM] = {0}; double x_new[DIM] = {0}; // state x, P Eigen::Matrix z(in_z); EEM P(in_P); ZZM pre_R(in_R); // functions from sympy h_fun(in_x, in_ea, in_hx); H_fun(in_x, in_ea, in_H); ZDM pre_H(in_H); // get y (y = z - hx) Eigen::Matrix pre_y(in_hx); pre_y = z - pre_y; X1M y; XXM H; XXM R; if (Hea_fun){ typedef Eigen::Matrix ZAM; double in_Hea[ZDIM * EADIM] = {0}; Hea_fun(in_x, in_ea, in_Hea); ZAM Hea(in_Hea); XXM A = Hea.transpose().fullPivLu().kernel(); y = A.transpose() * pre_y; H = A.transpose() * pre_H; R = A.transpose() * pre_R * A; } else { y = pre_y; H = pre_H; R = pre_R; } // get modified H H_mod_fun(in_x, in_H_mod); DEM H_mod(in_H_mod); XEM H_err = H * H_mod; // Do mahalobis distance test if (MAHA_TEST){ XXM a = (H_err * P * H_err.transpose() + R).inverse(); double maha_dist = y.transpose() * a * y; if (maha_dist > MAHA_THRESHOLD){ R = 1.0e16 * R; } } // Outlier resilient weighting double weight = 1;//(1.5)/(1 + y.squaredNorm()/R.sum()); // kalman gains and I_KH XXM S = ((H_err * P) * H_err.transpose()) + R/weight; XEM KT = S.fullPivLu().solve(H_err * P.transpose()); //EZM K = KT.transpose(); TODO: WHY DOES THIS NOT COMPILE? //EZM K = S.fullPivLu().solve(H_err * P.transpose()).transpose(); //std::cout << "Here is the matrix rot:\n" << K << std::endl; EEM I_KH = Eigen::Matrix::Identity() - (KT.transpose() * H_err); // update state by injecting dx Eigen::Matrix dx(delta_x); dx = (KT.transpose() * y); memcpy(delta_x, dx.data(), EDIM * sizeof(double)); err_fun(in_x, delta_x, x_new); Eigen::Matrix x(x_new); // update cov P = ((I_KH * P) * I_KH.transpose()) + ((KT.transpose() * R) * KT); // copy out state memcpy(in_x, x.data(), DIM * sizeof(double)); memcpy(in_P, P.data(), EDIM * EDIM * sizeof(double)); memcpy(in_z, y.data(), y.rows() * sizeof(double)); } } extern "C" { void live_update_4(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { update<3, 3, 0>(in_x, in_P, h_4, H_4, NULL, in_z, in_R, in_ea, MAHA_THRESH_4); } void live_update_9(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { update<3, 3, 0>(in_x, in_P, h_9, H_9, NULL, in_z, in_R, in_ea, MAHA_THRESH_9); } void live_update_10(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { update<3, 3, 0>(in_x, in_P, h_10, H_10, NULL, in_z, in_R, in_ea, MAHA_THRESH_10); } void live_update_12(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { update<3, 3, 0>(in_x, in_P, h_12, H_12, NULL, in_z, in_R, in_ea, MAHA_THRESH_12); } void live_update_35(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { update<3, 3, 0>(in_x, in_P, h_35, H_35, NULL, in_z, in_R, in_ea, MAHA_THRESH_35); } void live_update_32(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { update<4, 3, 0>(in_x, in_P, h_32, H_32, NULL, in_z, in_R, in_ea, MAHA_THRESH_32); } void live_update_13(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { update<3, 3, 0>(in_x, in_P, h_13, H_13, NULL, in_z, in_R, in_ea, MAHA_THRESH_13); } void live_update_14(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { update<3, 3, 0>(in_x, in_P, h_14, H_14, NULL, in_z, in_R, in_ea, MAHA_THRESH_14); } void live_update_33(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { update<3, 3, 0>(in_x, in_P, h_33, H_33, NULL, in_z, in_R, in_ea, MAHA_THRESH_33); } void live_H(double *in_vec, double *out_6746369553526897517) { H(in_vec, out_6746369553526897517); } void live_err_fun(double *nom_x, double *delta_x, double *out_2356689388845686605) { err_fun(nom_x, delta_x, out_2356689388845686605); } void live_inv_err_fun(double *nom_x, double *true_x, double *out_7416532235122030660) { inv_err_fun(nom_x, true_x, out_7416532235122030660); } void live_H_mod_fun(double *state, double *out_7744797074742978621) { H_mod_fun(state, out_7744797074742978621); } void live_f_fun(double *state, double dt, double *out_8063025216892748525) { f_fun(state, dt, out_8063025216892748525); } void live_F_fun(double *state, double dt, double *out_1924980074135776075) { F_fun(state, dt, out_1924980074135776075); } void live_h_4(double *state, double *unused, double *out_7366302340587907635) { h_4(state, unused, out_7366302340587907635); } void live_H_4(double *state, double *unused, double *out_8678952100085115055) { H_4(state, unused, out_8678952100085115055); } void live_h_9(double *state, double *unused, double *out_1116014595619586497) { h_9(state, unused, out_1116014595619586497); } void live_H_9(double *state, double *unused, double *out_2480573038359989091) { H_9(state, unused, out_2480573038359989091); } void live_h_10(double *state, double *unused, double *out_15153629602772458) { h_10(state, unused, out_15153629602772458); } void live_H_10(double *state, double *unused, double *out_4583653000591918572) { H_10(state, unused, out_4583653000591918572); } void live_h_12(double *state, double *unused, double *out_9071809923999704409) { h_12(state, unused, out_9071809923999704409); } void live_H_12(double *state, double *unused, double *out_4748335565592474766) { H_12(state, unused, out_4748335565592474766); } void live_h_35(double *state, double *unused, double *out_7011637724721731008) { h_35(state, unused, out_7011637724721731008); } void live_H_35(double *state, double *unused, double *out_2002772533267461057) { H_35(state, unused, out_2002772533267461057); } void live_h_32(double *state, double *unused, double *out_8005805873262674095) { h_32(state, unused, out_8005805873262674095); } void live_H_32(double *state, double *unused, double *out_6269965131311088716) { H_32(state, unused, out_6269965131311088716); } void live_h_13(double *state, double *unused, double *out_7868428076142185420) { h_13(state, unused, out_7868428076142185420); } void live_H_13(double *state, double *unused, double *out_4177806446556115282) { H_13(state, unused, out_4177806446556115282); } void live_h_14(double *state, double *unused, double *out_1116014595619586497) { h_14(state, unused, out_1116014595619586497); } void live_H_14(double *state, double *unused, double *out_2480573038359989091) { H_14(state, unused, out_2480573038359989091); } void live_h_33(double *state, double *unused, double *out_5108012817780654932) { h_33(state, unused, out_5108012817780654932); } void live_H_33(double *state, double *unused, double *out_1147784471371396547) { H_33(state, unused, out_1147784471371396547); } void live_predict(double *in_x, double *in_P, double *in_Q, double dt) { predict(in_x, in_P, in_Q, dt); } } const EKF live = { .name = "live", .kinds = { 4, 9, 10, 12, 35, 32, 13, 14, 33 }, .feature_kinds = { }, .f_fun = live_f_fun, .F_fun = live_F_fun, .err_fun = live_err_fun, .inv_err_fun = live_inv_err_fun, .H_mod_fun = live_H_mod_fun, .predict = live_predict, .hs = { { 4, live_h_4 }, { 9, live_h_9 }, { 10, live_h_10 }, { 12, live_h_12 }, { 35, live_h_35 }, { 32, live_h_32 }, { 13, live_h_13 }, { 14, live_h_14 }, { 33, live_h_33 }, }, .Hs = { { 4, live_H_4 }, { 9, live_H_9 }, { 10, live_H_10 }, { 12, live_H_12 }, { 35, live_H_35 }, { 32, live_H_32 }, { 13, live_H_13 }, { 14, live_H_14 }, { 33, live_H_33 }, }, .updates = { { 4, live_update_4 }, { 9, live_update_9 }, { 10, live_update_10 }, { 12, live_update_12 }, { 35, live_update_35 }, { 32, live_update_32 }, { 13, live_update_13 }, { 14, live_update_14 }, { 33, live_update_33 }, }, .Hes = { }, .sets = { }, .extra_routines = { { "H", live_H }, }, }; ekf_lib_init(live)