// Sigma(i, i) = sqrt(sigma_squared_2D), but then Omega is Sigma.t() * Sigma (squares the diagonal) - so we just assign 1/sigma_squared_2D to Omega here:
Omega(i,i)=1.0f/sigma_squared_2D;
}
// We use a VectorXf, and later use .asDiagonal():
// Earlier, we set Sigma in a for-loop and then computed Omega, but it was really unnecessary:
// Sigma(i, i) = sqrt(sigma_squared_2D), but then Omega is Sigma.t() * Sigma (squares the diagonal) - so we just assign 1/sigma_squared_2D to Omega here.
// The landmarks in matrix notation (in homogeneous coordinates), $3N\times 1$
constMatrixXfrhs=-A.transpose()*Omega.asDiagonal()*b;// It's -A^t*Omega^t*b, but we don't need to transpose Omega, since it's a diagonal matrix, and Omega^t = Omega.
// c_s: The 'x' that we solve for. (The variance-normalised shape parameter vector, $c_s = [a_1/sigma_{s,1} , ..., a_m-1/sigma_{s,m-1}]^t$.)
// We get coefficients ~ N(0, 1), because we're fitting with the rescaled basis. The coefficients are not multiplied with their eigenvalues.