diff options
author | Thomas White <taw@physics.org> | 2012-02-28 16:32:34 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-28 16:32:34 +0100 |
commit | 16f2550e2f646458327493d2e2c7150c8bd72d9e (patch) | |
tree | db25783b5b881d2ceb247d92f39e7058008cce72 /src/powder_plot.c | |
parent | 8cbe3b3e5fbd4b066f1477b4efd4e6251d1923b4 (diff) |
powder_plot: Formatting
Diffstat (limited to 'src/powder_plot.c')
-rw-r--r-- | src/powder_plot.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/powder_plot.c b/src/powder_plot.c index cd93c7cc..5be08d8e 100644 --- a/src/powder_plot.c +++ b/src/powder_plot.c @@ -94,8 +94,8 @@ static int find_q_bin_index(double q, struct histogram_info *info, int mid; int min = 0; int max = info->histsize-1; - if (q < hist[min].q_max) {return min;} - if (q > hist[max].q_min) {return max;} + if (q < hist[min].q_max) return min; + if (q > hist[max].q_min) return max; do { mid = (min + max) / 2; if (q < hist[mid].q_min) { @@ -124,9 +124,8 @@ static int add_peak_to_histogram(double fs, double ss, double intensity, q = modulus(r.u, r.v, r.w); /* Ignore q value if outside of range */ - if ( (q<info->q_min) || (q>info->q_max) ) { - return 1; - } + if ( (q<info->q_min) || (q>info->q_max) ) return 1; + i = find_q_bin_index(q, info, hist); /* See Knuth TAOCP vol 2, 3rd ed, pg 232 for running variance */ @@ -149,9 +148,8 @@ static int add_d_to_histogram(double q, double intensity, int i; /* Ignore q value if outside of range */ - if ( (q<info->q_min) || (q>info->q_max) ) { - return 1; - } + if ( (q<info->q_min) || (q>info->q_max) ) return 1; + i = find_q_bin_index(q, info, hist); delta = intensity - hist[i].mean; |