Lines Matching refs:stats

33   RunningStatistics<double> stats;  in CreateStatsFilledWithIntsFrom1ToN()  local
35 stats.AddSample(v); in CreateStatsFilledWithIntsFrom1ToN()
37 return stats; in CreateStatsFilledWithIntsFrom1ToN()
47 RunningStatistics<double> stats; in CreateStatsFromUniformDistribution() local
49 stats.AddSample(dis(gen)); in CreateStatsFromUniformDistribution()
51 return stats; in CreateStatsFromUniformDistribution()
61 auto stats = CreateStatsFilledWithIntsFrom1ToN(100); in TEST() local
63 EXPECT_DOUBLE_EQ(*stats.GetMin(), 1.0); in TEST()
64 EXPECT_DOUBLE_EQ(*stats.GetMax(), 100.0); in TEST()
66 ASSERT_NEAR(*stats.GetMean(), 50.5, 1e-10); in TEST()
70 RunningStatistics<int> stats; in TEST() local
71 stats.AddSample(2); in TEST()
72 stats.AddSample(2); in TEST()
73 stats.AddSample(-1); in TEST()
74 stats.AddSample(5); in TEST()
76 EXPECT_DOUBLE_EQ(*stats.GetMean(), 2.0); in TEST()
77 EXPECT_DOUBLE_EQ(*stats.GetVariance(), 4.5); in TEST()
78 EXPECT_DOUBLE_EQ(*stats.GetStandardDeviation(), sqrt(4.5)); in TEST()
84 RunningStatistics<int> stats; in TEST() local
85 stats.AddSample(2); in TEST()
86 stats.AddSample(2); in TEST()
87 stats.AddSample(-1); in TEST()
88 stats.AddSample(5); in TEST()
92 stats.AddSample(i); in TEST()
93 stats.RemoveSample(i); in TEST()
95 EXPECT_NEAR(*stats.GetMean(), 2.0, 1e-8); in TEST()
96 EXPECT_NEAR(*stats.GetVariance(), 4.5, 1e-3); in TEST()
97 EXPECT_NEAR(*stats.GetStandardDeviation(), sqrt(4.5), 1e-4); in TEST()
104 RunningStatistics<int> stats; in TEST() local
105 stats.AddSample(2); in TEST()
106 stats.AddSample(2); in TEST()
107 stats.AddSample(-1); in TEST()
108 stats.AddSample(5); in TEST()
112 stats.AddSample(i); in TEST()
115 stats.RemoveSample(i); in TEST()
118 EXPECT_NEAR(*stats.GetMean(), 2.0, 1e-7); in TEST()
119 EXPECT_NEAR(*stats.GetVariance(), 4.5, 1e-3); in TEST()
120 EXPECT_NEAR(*stats.GetStandardDeviation(), sqrt(4.5), 1e-4); in TEST()
126 auto stats = CreateStatsFromUniformDistribution(1e6, 0, 1); in TEST() local
128 EXPECT_NEAR(*stats.GetVariance(), 1. / 12, 1e-3); in TEST()
138 auto stats = CreateStatsFromUniformDistribution(1e6, 1e9, 1e9 + 1); in TEST() local
140 EXPECT_NEAR(*stats.GetVariance(), 1. / 12, 1e-3); in TEST()
146 RunningStatistics<int> stats; in TEST() local
147 stats.AddSample(1); in TEST()
148 stats.AddSample(2); in TEST()
149 stats.RemoveSample(1); in TEST()
150 EXPECT_EQ(stats.GetMin(), 1); in TEST()
156 RunningStatistics<int> stats; in TEST() local
157 stats.AddSample(1); in TEST()
158 stats.AddSample(2); in TEST()
159 stats.RemoveSample(2); in TEST()
160 EXPECT_EQ(stats.GetMax(), 2); in TEST()