Commit 3be2625f authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

use LU to solve

parent 1f075b6a
......@@ -72,8 +72,7 @@ void _mllsolve (double* cls, int ncl, int nell, double* mll, int nell1, int nell
MatrixXf A(nell,nell);
VectorXf b(nell);
VectorXf x(nell);
int k = 0;
for (int j=0; j<nell; j++){
for (int i=0; i<nell; i++){
......@@ -82,10 +81,13 @@ void _mllsolve (double* cls, int ncl, int nell, double* mll, int nell1, int nell
#pragma omp parallel for
for (int n=0; n<ncl; n++){
VectorXf b(nell);
VectorXf x(nell);
for (int j=0; j<nell; j++){
b(j) = cls[n*nell+j];
}
x = A.colPivHouseholderQr().solve(b);
//x = A.colPivHouseholderQr().solve(b);
x = A.fullPivLu().solve(b);
for (int j=0; j<nell; j++)
cls[n*nell+j] = x(j);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment