Can anyone help me please where I can get a fortran code or a text which describes about LU decomposition for sparse matrix in compact storage format? I appreciate any help!
I assume you already have a program that does normal LU decomposition. All you need to do is to change it as follows:
1) Say the array in question is A. You need 2 functions:
Code:
subroutine setA (x, y, val)
integer, intent(in):: x, y
double precision:: val
A(x,y) = val
end subroutine
double precision function getA (x, y)
return A(x,y)
end function
2) Recode the algorithm so that it uses setA and getA instead of A.
3) Now all you need to do is change setA and getA to use your sparse array to return the correct value or keep the correct value.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.