Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sparse LU decomposition 1

Status
Not open for further replies.

fanta2

Technical User
Apr 10, 2005
78
CA
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.
 
Thank you so much xwb! I will ask you again if i need additonal help or explanation!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top