Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: how to get origin matrix by NumericType? #777

Open
DragonPara opened this issue Mar 19, 2024 · 4 comments
Open

Question: how to get origin matrix by NumericType? #777

DragonPara opened this issue Mar 19, 2024 · 4 comments

Comments

@DragonPara
Copy link
Contributor

by using umfpack_di_get_numeric(Lp,Lj,Lx,Up,Ui,Ux,P,Q,nullptr,nullptr,nullptr,numeric);

excuse me, how to get origin matrix?

My code are as follows(uncorrect result):

    int ptr=0;
    for (size_t i1 = 0; i1 < n; i1++)
    {
        int i = P[i1];
        for (size_t j1 = 0; j1 < n; j1++)
        {
            int j = Q[j1];
            double temp = 0;
            int lstart = Lp[i];
            int lend = Lp[i+1];
            int ustart = Up[j];
            int uend = Up[j+1];
            while(lstart<lend && ustart<uend){
                if(Lj[lstart] == Ui[ustart]){
                    temp += Lx[lstart]*Ux[ustart];
                    lstart++;
                    ustart++;
                    continue;
                }
                else if(Lj[lstart] > Ui[ustart]){
                    ustart++;
                }
                else{
                    lstart++;
                }
            }
            if(temp!=0){
                Ai2[ptr] = i1;
                Aj2[ptr] = j1;
                Ax2[ptr] = temp;
                ptr++;
            }
        }
    }
@DragonPara
Copy link
Contributor Author

thanks a lot!

@DrTimothyAldenDavis
Copy link
Owner

The factorization doesn't include a copy of the original matrix. I don't keep a copy of it. I can use it later on in the solve step, but it must be passed in from the user application.

@DragonPara
Copy link
Contributor Author

Doctor, I want to get the original matrix by the result of factorization by L*U = A.

@DrTimothyAldenDavis
Copy link
Owner

It's not possible. The LU factorization cannot be used to compute the original matrix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants