24 bool solve_ls(
double A11,
double A12,
double A13,
double & x1,
double B1,
25 double A21,
double A22,
double A23,
double & x2,
double B2,
26 double A31,
double A32,
double A33,
double & x3,
double B3)
33 if (det == 0)
return false;
35 double inv_det = 1. / det;
37 x1 = inv_det * (
gfla_det(A22, A23, A32, A33) * B1 +
gfla_det(A13, A12, A33, A32) * B2 +
gfla_det(A12, A13, A22, A23) * B3);
38 x2 = inv_det * (
gfla_det(A23, A21, A33, A31) * B1 +
gfla_det(A11, A13, A31, A33) * B2 +
gfla_det(A13, A11, A23, A21) * B3);
39 x3 = inv_det * (
gfla_det(A21, A22, A31, A32) * B1 +
gfla_det(A12, A11, A32, A31) * B2 +
gfla_det(A11, A12, A21, A22) * B3);