- Hi Kresimir,

you wrote:

> is it possible to make one more small change/addition

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

> 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').

> Most general description of compressed row storage

Thanks for the link.

> (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/):

> ``An integer array IA contains the pointers to the beginning

Best regards

> 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.

Joerg - Hi Joerg,

>>Namely, many C libraries for solving sparse linear systems

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

>>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.

interface.

BTW, what you think about policy classes for index bases

-- http://groups.yahoo.com/group/ublas-dev/message/182 ?

>> [Yousef Saad's book]

You're welcome ;o)

> Thanks for the link.

fres