| OLD | NEW |
| 1 #ifndef Stats_DEFINED | 1 #ifndef Stats_DEFINED |
| 2 #define Stats_DEFINED | 2 #define Stats_DEFINED |
| 3 | 3 |
| 4 #include <math.h> | 4 #include <math.h> |
| 5 | 5 |
| 6 #include "SkString.h" | 6 #include "SkString.h" |
| 7 #include "SkTSort.h" | 7 #include "SkTSort.h" |
| 8 | 8 |
| 9 static const char* kBars[] = { "▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" }; | 9 #ifdef SK_BUILD_FOR_WIN |
| 10 static const char* kBars[] = { ".", "o", "O" }; |
| 11 #else |
| 12 static const char* kBars[] = { "▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" }; |
| 13 #endif |
| 10 | 14 |
| 11 struct Stats { | 15 struct Stats { |
| 12 Stats(const double samples[], int n) { | 16 Stats(const double samples[], int n) { |
| 13 min = samples[0]; | 17 min = samples[0]; |
| 14 max = samples[0]; | 18 max = samples[0]; |
| 15 for (int i = 0; i < n; i++) { | 19 for (int i = 0; i < n; i++) { |
| 16 if (samples[i] < min) { min = samples[i]; } | 20 if (samples[i] < min) { min = samples[i]; } |
| 17 if (samples[i] > max) { max = samples[i]; } | 21 if (samples[i] > max) { max = samples[i]; } |
| 18 } | 22 } |
| 19 | 23 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 58 |
| 55 double min; | 59 double min; |
| 56 double max; | 60 double max; |
| 57 double mean; // Estimate of population mean. | 61 double mean; // Estimate of population mean. |
| 58 double var; // Estimate of population variance. | 62 double var; // Estimate of population variance. |
| 59 double median; | 63 double median; |
| 60 SkString plot; // A single-line bar chart (_not_ histogram) of the samples. | 64 SkString plot; // A single-line bar chart (_not_ histogram) of the samples. |
| 61 }; | 65 }; |
| 62 | 66 |
| 63 #endif//Stats_DEFINED | 67 #endif//Stats_DEFINED |
| OLD | NEW |