[petsc-dev] VecSqrt() for complex numbers?

Jed Brown jed at 59A2.org
Fri Apr 9 15:37:06 CDT 2010


On Fri, Apr 9, 2010 at 13:34, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>   Should VecSqrt() for complex numbers take the square root of the absolute
> value (as it does for real numbers) or should be actually be the square
> root?

I think it is critical that

  VecSet(x,-1);
  VecSqrt(x);

means the same thing when compiled with real and complex.  If you want
VecSqrt to actually do a square root instead of sqrt(abs(x)), then the
above should generate an error with scalar-type=real, otherwise this
different functionality needs to be a different function.

Jed



More information about the petsc-dev mailing list