diff options
Diffstat (limited to 'src/auxiliaryFunctions/find/dfinda.c')
-rw-r--r-- | src/auxiliaryFunctions/find/dfinda.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/auxiliaryFunctions/find/dfinda.c b/src/auxiliaryFunctions/find/dfinda.c index 8613d00d..061caf56 100644 --- a/src/auxiliaryFunctions/find/dfinda.c +++ b/src/auxiliaryFunctions/find/dfinda.c @@ -15,17 +15,14 @@ void dfinda(double* x, int size ,double *out, int *indiceOut) { int i = 0; - int indice = *indiceOut; - - indice = 0; + indiceOut[1]=0; - /* Initialisation de out à -1 */ - for (i=0;i<size;i++) out[i]=-1; - + for (i = 0; i < size ; ++i) { if (x[i] != 0) { - out[indice] = (double)(i + 1); - indice++; + out[indiceOut[1]] = (double)(i+1); + indiceOut[1]++; } } } + |