<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 6, 2023, at 02:04, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class="">On Wed, Apr 5, 2023 at 1:59 PM gaochenyi14 <<a href="mailto:gaochenyi14@163.com" class="">gaochenyi14@163.com</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br class="">
<br class="">
I rely on PETSc to deal with real and complex sparse matrices of dimension 1e4 * 1e4 or above. I want to use real version when only real matrices are involved, to achieve better performance, and use complex version only when complex matrices get involved. But in the manual it says different versions can not be used at the same time. Can this restriction be circumvented? If not, where does the restriction come from?<br class=""></blockquote><div class=""><br class=""></div><div class="">It is possible to do this, but it is cumbersome. You would have to compile both versions of the library, dlopen() them, and get the symbols you need. A group at Purdue has done this, but it is involved.</div><div class=""><br class=""></div><div class="">We use typedefs to change between real and complex. It would not be difficult to allow storage in several types. However, prescribing how one type interactes with another, particularly when data is passed in or out, is challenging. This difficulty does not go away with templates since it is about type interaction, not polymorphism.</div><div class=""><br class=""></div><div class=""> Thanks,</div><div class=""><br class=""></div><div class=""> Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
All the best,<br class="">
C.-Y. GAO<br class="">
</blockquote></div><br clear="all" class=""><div class=""><br class=""></div><span class="gmail_signature_prefix">-- </span><br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class=""></div></div></div></div></div></div></div></div>
</div></blockquote></div><br class=""></div></div></div></div></div></div></body></html>