*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2017,2018,2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/math/vectypes.h"
#include "gromacs/utility/real.h"
-struct t_complex{
+struct t_complex
+{
real re, im;
};
{
t_complex d;
- d.re = r*c.re;
- d.im = r*c.im;
+ d.re = r * c.re;
+ d.im = r * c.im;
return d;
}
{
t_complex c;
- c.re = a.re+b.re;
- c.im = a.im+b.im;
+ c.re = a.re + b.re;
+ c.im = a.im + b.im;
return c;
}
{
t_complex c;
- c.re = a.re-b.re;
- c.im = a.im-b.im;
+ c.re = a.re - b.re;
+ c.im = a.im - b.im;
return c;
}
{
t_complex c;
- c.re = a.re*b.re - a.im*b.im;
- c.im = a.re*b.im + a.im*b.re;
+ c.re = a.re * b.re - a.im * b.im;
+ c.im = a.re * b.im + a.im * b.re;
return c;
}
{
t_complex d;
- d.re = c.re;
+ d.re = c.re;
d.im = -c.im;
return d;
static inline real cabs2(t_complex c)
{
real abs2;
- abs2 = (c.re*c.re)+(c.im*c.im);
+ abs2 = (c.re * c.re) + (c.im * c.im);
return abs2;
}
anoemer = cmul(conjugate(noemer), noemer);
res = cmul(teller, conjugate(noemer));
- return rcmul(1.0/anoemer.re, res);
+ return rcmul(1.0 / anoemer.re, res);
}
-inline bool operator==(const t_complex &lhs, const t_complex &rhs){ return (lhs.re == rhs.re) && (lhs.im == rhs.im); }
-inline bool operator!=(const t_complex &lhs, const t_complex &rhs){ return !(lhs == rhs); }
+inline bool operator==(const t_complex& lhs, const t_complex& rhs)
+{
+ return (lhs.re == rhs.re) && (lhs.im == rhs.im);
+}
+inline bool operator!=(const t_complex& lhs, const t_complex& rhs)
+{
+ return !(lhs == rhs);
+}
#endif