From: Dominique O. <dom...@gm...> - 2005-06-22 11:43:49
|
On 6/22/05, Roman Geus <rom...@gm...> wrote: > Hi Dominique >=20 > Sorry for not replying. I actually forgot to register myself for this lis= t > :-/ >=20 > > Hello, > >=20 > > I am linking my C code to PySparse and would like to create a CSR > > matrix using newCSRMatObject. I don"t see why the prototype for that > > function does not appear in the headers unless SPMATRIX_MODULE is > > #define"d. > =20 > > If I #define SPMATRIX_MODULE before #include-ing csr_mat.h, I obtain > > tons of warning and error messages. >=20 > newCSRMatObject() is not supposed to be visible outside of pysparse. > =20 > > Why not have newCSRMatObject"s prototype in spmatrix_api.h like, e.g., > > newLLMatObject? Same for newSSSMatObject. >=20 > Since there is no way to create CSR and SSS matrices, other than > building an LL matrix first and then converting it, I don't really see > any benefit in exposing these functions. Am I missing something? Hello Roman, There may not be any benefits from Python. However, from C, you could obviously create instances of CSR and SSS matrices without the overhead of first creating an ll_mat and then converting it (which takes some time when the matrices get large). If you know in advance that you're going to create a matrix that will not be modified (in my case: the factors of a system) but that you will use (eg for backsolves), it would be nice to be able to skip the overhead of creating an ll_mat. I see it as a limitation of PySparse right now because my C kernel isn't able to call directly other low-level language subroutines that expect CSR or SSS matrices. Instead, I must take the long route through ll_mat land and that has time and computational consequences. I am not sure how to expose those functions though as tweaking the source code produces lots of errors and warnings. I must not be tweaking right. Dominique |