I need to efficiently store the indices of nonzero elements in very large sparse matrix in a F90/95 program. Every row of the matrix has at least one nonzero but the number of nonzeros in any given row varies. The nonzero indices are found one at a time by looping through an array. I don't want to store repeated indices. By the way, this is a Finite Element code. This is the structure I'd like to build
Head(1) => {linked list of nonzeros in row 1}
.
.
.
Head(i) => {linked list of nonzeros in row i}
.
.
.
Head(N) => {linked list of nonzeros in row N}
where Head(i) is an element of an array of pointers and N is determined at run time.
Is this structure, or something equivalent, possible in Fortran 90/95? If it is, please tell me how to declare the variables and set it up. Thanks.
Head(1) => {linked list of nonzeros in row 1}
.
.
.
Head(i) => {linked list of nonzeros in row i}
.
.
.
Head(N) => {linked list of nonzeros in row N}
where Head(i) is an element of an array of pointers and N is determined at run time.
Is this structure, or something equivalent, possible in Fortran 90/95? If it is, please tell me how to declare the variables and set it up. Thanks.