Go to the documentation of this file.
21 typedef std::vector<DataPoint>
Data;
32 void init(
double parzenWindow) {
43 double sqr(
double x) {
49 double minval=MAXDOUBLE;
51 for (Data::const_iterator it =
m_data.begin(); it !=
m_data.end(); it++) {
57 for (Data::iterator it =
m_data.begin(); it !=
m_data.end(); it++) {
65 void add(
double x,
double p) {
88 for (
double x=
m_from; x<=xTo; x+=step)
95 assert(
m_data.size() > 0 );
99 for (Data::const_iterator it =
m_data.begin(); it !=
m_data.end(); it++) {
101 double dist = fabs(x - d.
x);
113 assert(
m_data.size() > 0 );
129 assert(
m_data.size() > 0 );
131 std::vector<double>::iterator cit =
m_cummulated.begin();
133 for (Data::const_iterator it =
m_data.begin(); it !=
m_data.end(); ++it) {
142 assert(
m_data.size() > 0 );
167 assert(
m_data.size() > 0 );
175 std::vector<double> randoms(num);
176 for (
int i=0; i<num; i++)
179 std::sort(randoms.begin(), randoms.end());
186 while (i<nCum && j < num) {
189 while (sum >= randoms[j] && j < num) {
201 assert(
m_data.size() > 0 );
217 var +=
sqr(x-*mean) * d;
224 double gauss(
double x,
double mean,
double sigma) {
225 return 1.0/(sqrt(2.0*M_PI)*sigma) * exp(-0.5 *
sqr( (x-mean)/sigma));
240 g =
gauss(x, mean, sigma);
243 p +=
sqr( (sint - gint) );
261 g = 1e-10 +
gauss(x, mean, sigma);
272 if (fabs(sd-sg) > 0.1)
281 for (Data::const_iterator it =
m_data.begin(); it !=
m_data.end(); it++) {
283 fprintf(fp,
"%f %f\n", d.
x, d.
y);
double sampleNumeric(double step)
DataSmoother(double parzenWindow)
void init(double parzenWindow)
double gauss(double x, double mean, double sigma)
void gnuplotDumpData(FILE *fp)
double UTILS_EXPORT sampleUniformDouble(double min, double max)
double smoothedData(double x)
double UTILS_EXPORT sampleGaussian(double sigma, unsigned long int S=0)
double cramerVonMisesToGauss(double step, double mean, double sigma)
std::vector< DataPoint > Data
void sampleMultiple(std::vector< double > &samples, int num)
double integral(double step, double xTo)
void approxGauss(double step, double *mean, double *sigma)
void gnuplotDumpSmoothedData(FILE *fp, double step)
std::vector< double > m_cummulated
void integrate(double step)
DataPoint(double _x=0.0, double _y=0.0)
void add(double x, double p)
double kldToGauss(double step, double mean, double sigma)
openslam_gmapping
Author(s): Cyrill Stachniss, Udo Frese, Giorgio Grisetti, Wolfram Burgard
autogenerated on Thu Oct 19 2023 02:25:51