75 ROS_ERROR(
"StatVector3d:: Not enough data points for calculations!");
81 double x_sum = std::accumulate(std::begin(
x_), std::end(
x_), 0.0);
82 result.push_back(x_sum /
x_.size());
84 double y_sum = std::accumulate(std::begin(
y_), std::end(
y_), 0.0);
85 result.push_back(y_sum /
y_.size());
87 double z_sum = std::accumulate(std::begin(
z_), std::end(
z_), 0.0);
88 result.push_back(z_sum /
z_.size());
97 std::transform(mean.begin(), mean.end(), mean.begin(),
98 std::bind1st(std::multiplies<double>(), scale));
111 ROS_ERROR(
"StatVector3d:: Not enough data points for calculations!");
118 std::for_each(std::begin(
x_), std::end(
x_), [&](
const double d)
120 accum += (d - mean.at(0)) * (d - mean.at(0));
123 result.push_back(accum / (
x_.size()-1));
126 std::for_each(std::begin(
y_), std::end(
y_), [&](
const double d)
128 accum += (d - mean.at(1)) * (d - mean.at(1));
131 result.push_back(accum / (
y_.size()-1));
134 std::for_each(std::begin(
z_), std::end(
z_), [&](
const double d)
136 accum += (d - mean.at(2)) * (d - mean.at(2));
139 result.push_back(accum / (
z_.size()-1));
148 std::transform(variance.begin(), variance.end(), variance.begin(),
149 std::bind1st(std::multiplies<double>(), scale));
160 result.push_back(sqrt(variance.at(0)));
161 result.push_back(sqrt(variance.at(1)));
162 result.push_back(sqrt(variance.at(2)));
171 std::transform(stddev.begin(), stddev.end(), stddev.begin(),
172 std::bind1st(std::multiplies<double>(), scale));
void addData(int x, int y, int z)
TVectorDouble getStandardDeviationRaw()
TVectorDouble getMeanScaled(double scale)
TVectorDouble getVarianceRaw()
TVectorDouble getMeanRaw()
TVectorDouble getVarianceScaled(double scale)
TVectorDouble getStandardDeviationScaled(double scale)
std::vector< double > TVectorDouble