CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Sparse matrix (http://www.cfd-online.com/Forums/main/3433-sparse-matrix.html)

 Takuya TSUJI May 8, 2001 22:53

Sparse matrix

Dear all, I have a problem with sparse matrix treatment. My matrix holds many zero-elements and real irregularity. From the memory storage limits, I want compress it. And hopefully I want to compute it in original arrangement withot uncompressing ( keep less memory). Do you have any idea? Some algorithm(liblary) exist? Please advise me.

 Damir Galeev May 9, 2001 05:58

Re: Sparse matrix

I use PETSc (http://www.mcs.anl.gov/petsc/)

 Giuseppe Casillo May 9, 2001 15:20

Re: Sparse matrix

dears sorry for my bed english dear damir galeev i dont know petsc dear takuya tsuji you can use twuo rectangular matrix: the first for the coefficient ,the second for the column index.programming you can resolve the problem. hi

 kalyan May 9, 2001 16:00

Re: Sparse matrix

You can use what is called a triad format. You define two integer arrays (which carry row and column numbers of non-zero entries) and one real array which carries the corresponding non-zero entries. Standard software like netlib often recognize this format. See www.netlib.org for other formats. Once you have the sparse matrix in a one standard format, I think there are standard routines to change into other formats.

 Damir Galeev May 9, 2001 18:07

Re: Sparse matrix

One can define 2 integer arrays for sparse matrix: 1st: N[row_number] = amount of all none-zero elements right up to the row number "row_number", the 2nd one gives the column for i-th none-zero element in the row

column = column[N[row]+i]

the only real (or double) array defines values:

value = value[N[row]+i]

(i - number of the none-zero element in the row)

 All times are GMT -4. The time now is 18:28.