33 if (data.size() > 1) {
35 for (std::list<double>::iterator it = data.begin(); it != data.end(); ++it) {
38 mean = sum / data.size();
40 for (std::list<double>::iterator it = data.begin(); it != data.end(); ++it) {
41 sum += pow(*it -
mean, 2.0);
43 deviation = sqrt(sum / (data.size() - 1));
44 }
else if (data.size() == 1) {
49 Normal::Normal(std::list<double> data, std::list<int> multipliers,
bool circular) {
52 if (data.size() == multipliers.size() && data.size() > 1) {
55 std::list<double>::iterator data_it = data.begin();
56 std::list<int>::iterator multiplier_it = multipliers.begin();
58 sum += *multiplier_it * *data_it;
59 weight += *multiplier_it;
62 }
while (data_it != data.end());
65 data_it = data.begin();
66 multiplier_it = multipliers.begin();
68 sum += *multiplier_it * pow(*data_it -
mean, 2.0);
71 }
while (data_it != data.end());
73 }
else if (data.size() == 1) {
Normal(double mean, double deviation)