<div dir="ltr"><div>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. </div>
<div><br></div><div>A </div><br><div class="gmail_quote">On Tue, Jun 29, 2010 at 6:21 PM, Umut Tabak <span dir="ltr"><<a href="mailto:u.tabak@tudelft.nl">u.tabak@tudelft.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Luke Bloy wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for the response. Thats unfortunate as i use many different types of matrices that i would like use with petsc.<br>
<br>
I'm not much of a c++ whiz,<br>
</blockquote></div>
me neither ;)<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
but i'm curious if something like an adaptor would be possible that would make a<br>
(float *) behave like a (petscscalar *) as far as petsc was concerned? Thoughts?<br>
</blockquote></div>
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.<br>
</blockquote></div><br></div>