Commit 96632af1 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Define a macro for handling the absolute value of dcomplex

parent 82c05a96
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -66,9 +66,12 @@ typedef __complex__ double dcomplex;
#endif // lapack_int
#endif // np_int

//! \brief Macro to compute the conjugate of a complex number.
//! \brief Macro to compute the conjugate of a double precision complex number.
#define dconjg(z) ( (__real__ (z) - I * (__imag__ (z))) )

//! \brief Macro to compute the magnitude of a double precision complex number.
#define dcabs(z) ( std::sqrt(__real__ (z) * __real__ (z) + __imag__ (z) * __imag__ (z)) )

/*! \brief Get the imaginary part of double precision complex number.
 *
 * \param z: `const dcomplex &` Reference to the complex number from