Skip to content

Commit

Permalink
correct typos
Browse files Browse the repository at this point in the history
  • Loading branch information
diemoschwarz committed Sep 21, 2022
1 parent 5e9ab84 commit 9db5c6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/statistics/rta_histogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void rta_histogram_weighted_stride (rta_histogram_params_t *self,
}

/* calculate histogram */
for (i = 0; i < i_size * i_stride; i += i_stride, weightptr += weightstride)
for (i = 0; i < i_size * i_stride; i += i_stride, weights += w_stride)
{
/* find bin index */
int ind = (input[i] - self->lo) * xfact;
Expand All @@ -151,7 +151,7 @@ void rta_histogram_weighted_stride (rta_histogram_params_t *self,
if (ind >= self->nhist)
ind = self->nhist - 1;

output[ind * out_stride] += *weightptr;
output[ind * out_stride] += *weights;
}

// normalise histogram
Expand Down
5 changes: 3 additions & 2 deletions src/statistics/rta_histogram.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#define _RTA_HISTOGRAM_H_ 1

#include "rta.h"
#include <stdbool.h> /* to get bool type in C99 */

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -70,7 +71,7 @@ void rta_histogram_init (rta_histogram_params_t *self);
* @param i_size number of input elements
* @param output pointer to output data (at least params->nhist * out_stride elements)
* @param out_stride stride for output data
* @param binout NULL or pointer to bin index output data (at least params->nhist * bpf_stride elements)
* @param binout NULL or pointer to bin index output data (at least params->nhist * bin_stride elements)
* @param bin_stride stride for bin index data
*/
void rta_histogram_stride (rta_histogram_params_t *params,
Expand All @@ -90,7 +91,7 @@ void rta_histogram_stride (rta_histogram_params_t *params,
* @param w_stride stride for weights data
* @param output pointer to output data (at least params->nhist * out_stride elements)
* @param out_stride stride for output data
* @param binout NULL or pointer to bin index output data (at least params->nhist * bpf_stride elements)
* @param binout NULL or pointer to bin index output data (at least params->nhist * bin_stride elements)
* @param bin_stride stride for bin index data
*/
void rta_histogram_weighted_stride (rta_histogram_params_t *params,
Expand Down

0 comments on commit 9db5c6e

Please sign in to comment.