summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/type/doubleComplex.h2
-rw-r--r--src/type/floatComplex.c26
-rw-r--r--src/type/floatComplex.h2
3 files changed, 30 insertions, 0 deletions
diff --git a/src/type/doubleComplex.h b/src/type/doubleComplex.h
index a8934b50..30dea12f 100644
--- a/src/type/doubleComplex.h
+++ b/src/type/doubleComplex.h
@@ -57,6 +57,8 @@ typedef double complex doubleComplex;
double zreals(doubleComplex);
double zimags(doubleComplex);
+void zreala(doubleComplex *in, int size, double *out);
+void zimaga(doubleComplex *in, int size, doubleg *out);
doubleComplex DoubleComplex(double, double);
doubleComplex* DoubleComplexMatrix(double*, double*, int);
bool zisreals(doubleComplex);
diff --git a/src/type/floatComplex.c b/src/type/floatComplex.c
index 05dcbb0a..c2b2bdb6 100644
--- a/src/type/floatComplex.c
+++ b/src/type/floatComplex.c
@@ -60,6 +60,32 @@ float cimags(floatComplex z) {
#endif
/*
+** \function creala
+** \brief Return a Complex Real Part array.
+*/
+void creala(floatComplex* z, int size, float* out) {
+ int i = 0;
+
+ for (i = 0 ; i < size ; ++i)
+ {
+ out[i] = creals(z[i]);
+ }
+}
+
+/*
+** \function cimaga
+** \brief Return a Complex Imaginary Part array.
+*/
+void cimaga(floatComplex* z, int size, float* out) {
+ int i = 0;
+
+ for (i = 0 ; i < size ; ++i)
+ {
+ out[i] = cimags(z[i]);
+ }
+}
+
+/*
** \function FloatComplex
** \brief construct a Float Complex .
*/
diff --git a/src/type/floatComplex.h b/src/type/floatComplex.h
index 1c1f3690..e2197719 100644
--- a/src/type/floatComplex.h
+++ b/src/type/floatComplex.h
@@ -57,6 +57,8 @@ typedef float complex floatComplex;
float creals(floatComplex);
float cimags(floatComplex);
+void creala(floatComplex *in, int size, float *out);
+void cimaga(floatComplex *in, int size, float *out);
floatComplex FloatComplex(float, float);
floatComplex* FloatComplexMatrix(float*, float*, int);
bool cisreals(floatComplex);