RowMajorMatrixXf AtARegInv_EigenFullLU = luOfAtOmegaAReg.inverse(); // Note: We should use ::solve() instead
Mat AtOmegaARegInvFullLU(AtARegInv_EigenFullLU.rows(), AtARegInv_EigenFullLU.cols(), CV_32FC1, AtARegInv_EigenFullLU.data()); // create an OpenCV Mat header for the Eigen data
*/
MatAtOmegatb=A.t()*Omega.t()*b;
Matc_s=-AtOmegaARegInv*AtOmegatb;// Note/Todo: We get coefficients ~ N(0, sigma) I think. They are not multiplied with the eigenvalues.
// Solve using OpenCV:
Matc_s;// Note/Todo: We get coefficients ~ N(0, sigma) I think. They are not multiplied with the eigenvalues.
boolnon_singular=cv::solve(AtOmegaAReg,-A.t()*Omega.t()*b,c_s,cv::DECOMP_SVD);// DECOMP_SVD calculates the pseudo-inverse if the matrix is not invertible.
// Because we're using SVD, non_singular will always be true. If we were to use e.g. Cholesky, we could return an expected<T>.