Loading ...
Sorry, an error occurred while loading the content.

Re: [ublas-dev] compressed_matrix<> again

Expand Messages
  • jhr.walter@t-online.de
    Hi Kresimir, ... Yes, this seems reasonable. I ll add the missing index element. ... Thanks for the link. ... Best regards Joerg
    Message 1 of 3 , Nov 1, 2002
    • 0 Attachment
      Hi Kresimir,

      you wrote:

      > is it possible to make one more small change/addition
      > to the compressed_matrix<> storage format (besides
      > zero-based (or k-based) indexing)?
      >
      > Namely, many C libraries for solving sparse linear systems
      > that use compressed column storage format, e.g.
      >
      > -- SuperLU (http://www.nersc.gov/~xiaoye/SuperLU/)
      > -- TAUCS (http://www.tau.ac.il/~stoledo/taucs/)
      > -- UMFPACK (http://www.cise.ufl.edu/research/sparse/umfpack/)
      >
      > require that the array which contain column indices
      > (`index1_data_' in ublas::compressed_matrix<>) has
      > `ncols + 1' (i.e. `size2_ + 1') elements and that
      > `index1_data_[size2_] == non_zeros_'.
      >
      > Similarly, description of compressed row storage in
      > `Templates for the Solution of Linear Systems'
      > (http://www.netlib.org/linalg/html_templates/node91.html)
      > says:
      >
      > ``The val vector stores the values of the nonzero elements
      > of the matrix [...] The row_ptr vector stores the locations in the
      > val vector that start a row [...] By convention, we define
      > row_ptr(n+1) = nnz+1, where nnz is the number of nonzeros in
      > the matrix.''
      >
      > Therefore, it can be assumed that sparse Fortran libraries also
      > have this requirement (quoted sentences were obviously written
      > with Fortran in mind: `+1').

      Yes, this seems reasonable. I'll add the missing index element.

      > Most general description of compressed row storage
      > (although it assumes one-based indexing) is given by Yousef
      > Saad in `Iterative methods for sparse linear systems' (book,
      > as PS or PDF, can be freely downloaded from his web page
      > http://www-users.cs.umn.edu/~saad/):

      Thanks for the link.

      > ``An integer array IA contains the pointers to the beginning
      > of each row [...] The length of IA is n+1 with with IA(n+1)
      > containing the number IA(1) + Nz, i.e., the address in A and
      > JA of the beginning of a fictitious row number n+1.''
      >
      > This definition can be used in compressed_matrix<> if k-based
      > indexing is adopted.

      Best regards

      Joerg
    • Kresimir Fresl
      Hi Joerg, ... Great, thanx. So, I can begin the work on SuperLU interface. BTW, what you think about policy classes for index bases --
      Message 2 of 3 , Nov 1, 2002
      • 0 Attachment
        Hi Joerg,

        >>Namely, many C libraries for solving sparse linear systems
        >>that use compressed column storage format [...]
        >>require that the array which contain column indices
        >>(`index1_data_' in ublas::compressed_matrix<>) has
        >>`ncols + 1' (i.e. `size2_ + 1') elements and that
        >>`index1_data_[size2_] == non_zeros_'. [...]

        > Yes, this seems reasonable. I'll add the missing index element.

        Great, thanx. So, I can begin the work on SuperLU
        interface.

        BTW, what you think about policy classes for index bases
        -- http://groups.yahoo.com/group/ublas-dev/message/182 ?

        >> [Yousef Saad's book]

        > Thanks for the link.

        You're welcome ;o)

        fres
      Your message has been successfully submitted and would be delivered to recipients shortly.