[petsc-users] ublas sparse matrix bindings?

Luke Bloy luke.bloy at gmail.com
Tue Jun 29 11:39:06 CDT 2010


Aron,

Thanks for the reply. Thats unfortunate i was hoping to use petsc/slepc 
on  matrices of doubles and of ints within the same application. I was 
hoping to keep the ints for a smaller memory footprint as I'm already in 
the >10g range. but it seems like that is possible.

-Luke

On 06/29/2010 11:30 AM, Aron Ahmadia wrote:
> You couldn't simply template the dereference, you would need to have a 
> way to reformat the data into single/double-precision, and PETSc 
> assumes you are giving it a raw C pointer.  This would have the effect 
> of potentially generating an expensive data copy every time you need 
> to hand your object to PETSc.  I think you would be much better served 
> by deciding ahead of time whether you will need a single or 
> double-precision PETSc and writing your code accordingly with that 
> assumption.
>
> A
>
> On Tue, Jun 29, 2010 at 6:21 PM, Umut Tabak <u.tabak at tudelft.nl 
> <mailto:u.tabak at tudelft.nl>> wrote:
>
>     Luke Bloy wrote:
>
>         Thanks for the response. Thats unfortunate as i use many
>         different types of matrices that i would like use with petsc.
>
>         I'm not much of a c++ whiz,
>
>     me neither ;)
>
>         but i'm curious if something like an adaptor would be possible
>         that would make a
>         (float *) behave like a (petscscalar *) as far as petsc was
>         concerned? Thoughts?
>
>     I am not sure if these kinds of pointer conversions are safe if
>     you do not know that what 'petscscalar *' really is, you might
>     check the docs.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20100629/2fc91991/attachment.htm>


More information about the petsc-users mailing list