diff options
Diffstat (limited to 'src/auxiliaryFunctions/find/zfinda.c')
-rw-r--r-- | src/auxiliaryFunctions/find/zfinda.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/auxiliaryFunctions/find/zfinda.c b/src/auxiliaryFunctions/find/zfinda.c index e01d42ca..18c87a25 100644 --- a/src/auxiliaryFunctions/find/zfinda.c +++ b/src/auxiliaryFunctions/find/zfinda.c @@ -12,12 +12,17 @@ #include "find.h" -int zfinda(doubleComplex* z, int size) { - int i = 0; +double *zfinda(doubleComplex* z, int size) { + int i = 0; + int indiceOut = 0; + double* out=NULL; + for (i = 0; i < size ; ++i) { if (zreals(z[i]) != 0 || zimags(z[i]) != 0) { - return i; + out = realloc(out, (uint)(indiceOut+1)*sizeof(double)); + out[indiceOut] = (double)i; + indiceOut++; } } - return NOT_FOUND; + return out; } |