SlepcAbsEigenvalue#

Returns the absolute value of a complex number given its real and imaginary parts.

Synopsis#

#include <slepcmath.h>
PetscReal SlepcAbsEigenvalue(PetscScalar x, PetscScalar y)

Not Collective

Input parameters#

  • x - the real part of the complex number

  • y - the imaginary part of the complex number

Notes#

This function computes \(\sqrt{x^2+y^2}\), taking care not to cause unnecessary overflow. It is based on LAPACK’s DLAPY2.

In complex scalars, only the first argument is used, i.e., the result is \(|x|\).

Fortran Note#

This function is not available from Fortran.

See Also#

PetscAbsScalar()

Level#

developer

Location#

include/slepcmath.h

Examples#

src/sys/classes/bv/tests/test18.c
src/sys/classes/ds/tests/test1.c
src/sys/classes/ds/tests/test12.c
src/sys/classes/ds/tests/test20.c
src/sys/classes/ds/tests/test23.c
src/sys/classes/ds/tests/test25.c
src/sys/classes/ds/tests/test4.c
src/eps/tutorials/ex18.c
src/eps/tutorials/ex41.c
src/pep/tutorials/ex40.c


Index of all Sys routines Table of Contents for all manual pages Index of all manual pages