# Skyline solver for AX=B where A is symmetric skyline matrix

I am looking for a simple subroutine in Fortran 90 (GNU Compiler) to solve linear equation of the type $AX=B$, where $A$ is an $n\times n$ symmetric matrix stored in the form of symmetric skyline matrix. I want a solution of this type:

X = skysolve(A,p,X,B,n)
A = {11,22,13,0,33,24,34,44,55,16,0,0,46,56,66}


where p is the index of diagonal elements p = {1,2,5,8,9,15}

It would be better if I could just have a simple subroutine kind of solution to this situation rather than a library.

• Welcome to SciComp.SE! Am I correct in assuming that you are re-asking this question after having registered? If so, it might make sense to edit this question to include the additional information in the other question (and also describe what a "skyline matrix" is) and then delete the old question (if you can; otherwise flag for a moderator to delete it). – Christian Clason Jan 16 '16 at 13:45
• Yes that is correct, I am unable to delete that question and unless I remove that content, cannot duplicate it here – Chaitanya Krishna Jan 16 '16 at 13:52
• I've copied the content for you -- if that's not what you want, feel free to revert the edit (or make a comment). To edit your question yourself (to include the definition of a skyline matrix, for example ;)), you can use the grey edit link under the tags. – Christian Clason Jan 16 '16 at 14:25

I suggest taking a look at the FEAPpv finite element code written by Robert Taylor to accompany this book:

http://www.amazon.com/The-Finite-Element-Method-Fundamentals/dp/1856176339

http://www.ce.berkeley.edu/projects/feap/feappv/

The code contains two subroutines, datri and dasol that perform the factorization and solution, respectively, of a matrix stored in skyline format; you first call datri to the factor the matrix and then call dasol to perform the forward and backward substitutions.

There are sufficiently detailed comments in both subroutines to be able to use them. Here is a simple example with five equations and a symmetric matrix (entries below the diagonal are not included):

      program test
C
C  Solve A*U = b
C        [2   -2    0    0   -1]
C        [0    3   -2    0    0]
C  A =   [0    0    5   -3    0]
C        [0    0    0   10    4]
C        [0    0    0    0   10]
C
C The solution, U, is: 636.,619.,292.,74.,34.
C
parameter (neqs = 5)