summaryrefslogtreecommitdiff
path: root/src/auxiliaryFunctions
diff options
context:
space:
mode:
Diffstat (limited to 'src/auxiliaryFunctions')
-rw-r--r--src/auxiliaryFunctions/includes/pythag.h16
-rw-r--r--src/auxiliaryFunctions/pythag/cpythags.c19
-rw-r--r--src/auxiliaryFunctions/pythag/dpythags.c3
-rw-r--r--src/auxiliaryFunctions/pythag/spythags.c3
4 files changed, 34 insertions, 7 deletions
diff --git a/src/auxiliaryFunctions/includes/pythag.h b/src/auxiliaryFunctions/includes/pythag.h
index 37906f23..93b8827c 100644
--- a/src/auxiliaryFunctions/includes/pythag.h
+++ b/src/auxiliaryFunctions/includes/pythag.h
@@ -5,7 +5,7 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Thu Feb 8 10:12:17 2007 jofret
-** Last update Mon Apr 23 12:10:10 2007 jofret
+** Last update Thu Aug 16 12:18:00 2007 bruno
**
** Copyright INRIA 2007
*/
@@ -18,11 +18,21 @@
/*
** \brief Float Pythag function
*/
-float spythags(float x, float y);
+float spythags(float x, float y);
/*
** \brief Double Pythag function
*/
-double dpythags(double x, double y);
+double dpythags(double x, double y);
+
+/*
+** \brief Float Complex Pythag function
+*/
+floatComplex cpythags(floatComplex x, floatComplex y);
+
+/*
+** \brief Double Complex Pythag function
+*/
+doubleComplex zpythags(doubleComplex x, doubleComplex y);
#endif /* !__PYTHAG_H__ */
diff --git a/src/auxiliaryFunctions/pythag/cpythags.c b/src/auxiliaryFunctions/pythag/cpythags.c
new file mode 100644
index 00000000..0701ce98
--- /dev/null
+++ b/src/auxiliaryFunctions/pythag/cpythags.c
@@ -0,0 +1,19 @@
+/*
+** -*- C -*-
+**
+** spythags.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Mon Apr 23 11:31:47 2007 jofret
+** Last update Thu Aug 16 12:17:21 2007 bruno
+**
+** Copyright INRIA 2007
+*/
+
+#include "complex.h"
+#include "pythag.h"
+
+floatComplex cpythags(floatComplex x, floatComplex y) {
+ return (csqrts( cadds(ctimess(x,x),
+ ctimess(y,y)) ));
+}
diff --git a/src/auxiliaryFunctions/pythag/dpythags.c b/src/auxiliaryFunctions/pythag/dpythags.c
index 0b3eeb5f..a40fa7cd 100644
--- a/src/auxiliaryFunctions/pythag/dpythags.c
+++ b/src/auxiliaryFunctions/pythag/dpythags.c
@@ -5,13 +5,12 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Mon Apr 23 11:54:15 2007 jofret
-** Last update Mon Apr 23 15:43:21 2007 jofret
+** Last update Thu Aug 16 12:10:17 2007 bruno
**
** Copyright INRIA 2007
*/
#include "pythag.h"
-#include "sqrt.h"
double dpythags(double x, double y) {
return (dsqrts( (x*x) + (y*y) ) );
diff --git a/src/auxiliaryFunctions/pythag/spythags.c b/src/auxiliaryFunctions/pythag/spythags.c
index a4d279a1..47c0e85c 100644
--- a/src/auxiliaryFunctions/pythag/spythags.c
+++ b/src/auxiliaryFunctions/pythag/spythags.c
@@ -5,13 +5,12 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Mon Apr 23 11:31:47 2007 jofret
-** Last update Mon Apr 23 11:54:06 2007 jofret
+** Last update Thu Aug 16 12:10:01 2007 bruno
**
** Copyright INRIA 2007
*/
#include "pythag.h"
-#include "sqrt.h"
float spythags(float x, float y) {
return (ssqrts( (x*x) + (y*y) ));