[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master a84aa87: Corrections in multi-operand Arithmet
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master a84aa87: Corrections in multi-operand Arithmetic operators |
Date: |
Mon, 26 Jun 2017 09:15:13 -0400 (EDT) |
branch: master
commit a84aa8794e953a4e39329613be643c36094fe4a6
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
Corrections in multi-operand Arithmetic operators
In the median operator, the `++a[i]' (from the wrong implementation that
was corrected in the last commit) still remained. It is now removed with
this commit. Also a comment was corrected in calculating the mean and std
operators.
---
lib/arithmetic.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/arithmetic.c b/lib/arithmetic.c
index 4e770a7..6e20539 100644
--- a/lib/arithmetic.c
+++ b/lib/arithmetic.c
@@ -800,7 +800,7 @@ arithmetic_where(unsigned char flags, gal_data_t *out,
gal_data_t *cond,
: ( a[i][j]==a[i][j] ? 1 : 0 ) ); /* Float */ \
else use=1; \
\
- /* Use in median if necessary. */ \
+ /* Calculate the mean if necessary. */ \
if(use) { sum += a[i][j]; ++n; } \
} \
*o++ = n ? sum/n : b; \
@@ -830,7 +830,7 @@ arithmetic_where(unsigned char flags, gal_data_t *out,
gal_data_t *cond,
: ( a[i][j]==a[i][j] ? 1 : 0 ) ); /* Float */ \
else use=1; \
\
- /* Use pixel value if necessary. */ \
+ /* Calculate the necessary parameters if necessary. */ \
if(use) \
{ \
sum2 += a[i][j] * a[i][j]; \
@@ -869,8 +869,8 @@ arithmetic_where(unsigned char flags, gal_data_t *out,
gal_data_t *cond,
: ( a[i][j]==a[i][j] ? 1 : 0 ) ); /* Float */ \
else use=1; \
\
- /* a[i] must be incremented to next pixel in any case. */ \
- if(use) pixs[n++]=a[i][j]; else ++a[i]; \
+ /* Put the value into the array of values. */ \
+ if(use) pixs[n++]=a[i][j]; \
} \
\
/* Sort all the values for this pixel and return the median. */ \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master a84aa87: Corrections in multi-operand Arithmetic operators,
Mohammad Akhlaghi <=