42 if (n_elements == 0) {
49 for (i = 0; i < n_elements; i++) {
50 sum += (float)
array[i];
52 return (
int32_t)(sum / n_elements);
80 if (n_elements == 0) {
85 float sumX = 0.f, sumY = 0.f, sumXY = 0.f;
89 for (i = 0; i < n_elements; i++) {
90 sumX += (float)array1[i];
91 sumY += (float)array2[i];
92 sumXY += (float)(array1[i]) * (float)(array2[i]);
94 return (
int32_t)(sumXY / n_elements - sumX * sumY / (n_elements * n_elements));
111 for (i = 0; i < n_elements; i++) {
124 if (n_elements == 0) {
128 return (
sum_f(
array, n_elements) / n_elements);
154 if (n_elements == 0) {
159 float sumX = 0.f, sumY = 0.f, sumXY = 0.f;
163 for (i = 0; i < n_elements; i++) {
166 sumXY += arr1[i] * arr2[i];
168 return (sumXY / n_elements - sumX * sumY / (n_elements * n_elements));