From d72ca2727d342dda7f2da92b43d39326e253b6f9 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Wed, 6 Feb 2019 14:27:03 +0100 Subject: [PATCH] added conj() --- complex.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/complex.hh b/complex.hh index df1fa40..b3cc5e5 100644 --- a/complex.hh +++ b/complex.hh @@ -102,6 +102,12 @@ static constexpr Complex operator / (Complex a, Complex b) (a.imag() * b.real() - a.real() * b.imag()) / (b.real() * b.real() + b.imag() * b.imag())); } +template +static constexpr Complex conj(Complex a) +{ + return Complex(a.real(), -a.imag()); +} + template static constexpr T norm(Complex a) {