2 #include <gsl/gsl_math.h> 6 #include "../csm_all.h" 19 val d2J_dxdy1 =
zeros(3,(
size_t)laser_ref ->nrays);
27 double theta = x->data[2];
31 for(i=0;i<laser_sens->
nrays;i++) {
35 int j1 = laser_sens->
corr[i].
j1;
36 int j2 = laser_sens->
corr[i].
j2;
53 val d2J_dt2_k =
sc(2.0, C_k);
54 val d2J_dt_dtheta_k =
sc(2.0,
m(C_k,v1));
58 add_to(d2J_dt2, d2J_dt2_k);
59 add_to(d2J_dt_dtheta, d2J_dt_dtheta_k );
60 add_to(d2J_dtheta2, d2J_dtheta2_k);
63 val d2Jk_dtdrho_i =
sc(2.0,
m(C_k,v3));
64 val d2Jk_dtheta_drho_i =
sc(2.0,
sum(
m3(
tr(v2),C_k,v4),
m3(
tr(v3),C_k,v1)));
75 val d2Jk_dt_drho_j1 =
sum(
sc(-2.0,
m(C_k,v_j1)),
sc(2.0,
m(dC_drho_j1,v2)));
76 val d2Jk_dtheta_drho_j1 =
sum(
sc(-2.0,
m3(
tr(v_j1),C_k,v1)),
m3(
tr(v2),dC_drho_j1,v1));
80 val d2Jk_dt_drho_j2 =
sc(2.0,
m( dC_drho_j2,v2));
81 val d2Jk_dtheta_drho_j2 =
sc(2.0,
m3(
tr(v2), dC_drho_j2, v1));
91 val edx_dy1 =
sc(-1.0,
m(
inv(d2J_dx2), d2J_dxdy1));
92 val edx_dy2 =
sc(-1.0,
m(
inv(d2J_dx2), d2J_dxdy2));
94 val ecov0_x =
sum(
m(edx_dy1,
tr(edx_dy1)),
m(edx_dy2,
tr(edx_dy2)) );
109 double alpha =
M_PI/2 + atan2(
atv(d,1),
atv(d,0));
110 double c = cos(alpha);
double s = sin(alpha);
125 return sc(1/eps,
sub(C_k_eps,C_k));
INLINE int ld_valid_corr(LDP ld, int i)
val compute_C_k(val p_j1, val p_j2)
val egsl_vFa(size_t rows, const double *)
void egsl_push_named(const char *name)
struct correspondence *restrict corr
void compute_covariance_exact(LDP laser_ref, LDP laser_sens, const gsl_vector *x, val *cov0_x, val *dx_dy1, val *dx_dy2)
val dC_drho(val p1, val p2)
#define add_to_col(v1, j, v2)
void egsl_pop_named(const char *name)
#define zeros(rows, cols)
val egsl_vFda(size_t rows, size_t columns, const double *)