diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2015-10-30 10:34:38 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2015-10-30 10:34:38 +0100 |
commit | 29206df7b398c450fe29b5f23bbc3d29e69006b5 (patch) | |
tree | 853102673d31ec101d0cf6cb4c56421e23ba69b7 /math.h | |
parent | c1c5f4787820e7b20c702ed288c8b3b1ccb6a2fc (diff) | |
download | pucket-29206df7b398c450fe29b5f23bbc3d29e69006b5.tar.gz pucket-29206df7b398c450fe29b5f23bbc3d29e69006b5.tar.bz2 pucket-29206df7b398c450fe29b5f23bbc3d29e69006b5.zip |
Import asteria from jwildfire
Diffstat (limited to 'math.h')
-rw-r--r-- | math.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -109,6 +109,18 @@ inline double sum(const double2 in) { return in[0] + in[1]; } +inline double square (const double in) { + return in * in; +} + +inline double2 square_d2 (const double2 in) { + return in * in; +} + +inline double squaresum (const double2 in) { + return sum (square_d2 (in)); +} + inline void normalize (double * const a, const size_t n) { double sum = 0.0; for (unsigned int j = 0; j < n; j++) { |