[petsc-dev] [PATCH] Custom use of complex when not configured for complex

Jed Brown jedbrown at mcs.anl.gov
Mon Sep 10 11:19:32 CDT 2012


I would like to use complex arithmetic in some code that does polynomial
optimization in the complex plane (for adaptive smoothers), even when
PetscScalar is real. I'd like to push something like the attached, but
since this is potentially fragile, I'm posting here before pushing. Any
objections to my pushing?

This works with my C and C++ real builds as well as C and C++ complex. I
also tried a real build that disabled PETSC_HAVE_C99_COMPLEX (because all
my compilers support it), but of course that's not much of a check.

One thing that I think we could support (because C99 and C++ complex is
binary compatible) is choosing the complex implementation based on the
current language rather than PETSC_CLANGUAGE.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120910/f9240fb4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: complex.diff
Type: application/octet-stream
Size: 9561 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120910/f9240fb4/attachment.obj>


More information about the petsc-dev mailing list