diff options
Diffstat (limited to 'Temparray.h')
-rw-r--r-- | Temparray.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Temparray.h b/Temparray.h index ac96c04..0886c9d 100644 --- a/Temparray.h +++ b/Temparray.h @@ -57,6 +57,24 @@ class Temparray } earthtemp=8; } + void calcAverage(){ + float tempcache = 0; + int times = 0; + for(int i=0; i<sx; i++){ + for(int j=0; j<sy; j++){ + for(int k=0; k<sz; k++){ + for(int l=0; l<6; l++){ + for(int m=0; m<4; m++){ + tempcache += temperaturenew(i, j, k, l, m); + ++times; + } + } + } + } + } + averagetemp = tempcache/times; + std::cerr << averagetemp << std::endl; + } }; #endif /* _TEMPARRAY_H_ */ |