Go to the documentation of this file.
34 map<string, CVectorDouble>
results;
38 #define TEST_RESAMPLING(ALGOR) \
39 mrpt::system::deleteFile(#ALGOR); \
44 for (size_t i = 0; i < N_TESTS; i++) \
46 mrpt::random::getRandomGenerator().drawUniformVector( \
47 log_ws, MIN_LOG_WEIG, 0.0); \
48 CParticleFilterCapable::log2linearWeights(log_ws, lin_ws); \
49 CParticleFilterCapable::computeResampling( \
50 CParticleFilter::ALGOR, log_ws, out_indxs); \
51 hist_parts = mrpt::math::histogram(out_indxs, 0, M - 1, M, true); \
52 vector<double> errs_hist = lin_ws - hist_parts; \
53 ERR_MEANs.push_back(mrpt::math::mean(errs_hist)); \
54 ERR_STDs.push_back(mrpt::math::stddev(errs_hist)); \
56 printf("%s: ERR_MEAN %e\n", #ALGOR, mrpt::math::mean(ERR_MEANs)); \
57 printf("%s: ERR_STD %f\n", #ALGOR, mrpt::math::mean(ERR_STDs)); \
58 results[#ALGOR].push_back(mrpt::math::mean(ERR_STDs));
65 vector<double> log_ws;
66 std::vector<size_t> out_indxs;
74 vector<double> lin_ws;
75 vector<double> hist_parts;
76 vector<double> ERR_MEANs;
77 vector<double> ERR_STDs;
91 for (
double LL = -2; LL <= 2.01; LL += 0.08)
93 double L = pow(10.0, LL);
96 printf(
"MIN_LOG_W=%f\n", L);
140 cerr <<
"Untyped excepcion!!";
map< string, CVectorDouble > results
void randomize(const uint32_t seed)
Initialize the PRNG from the given random seed.
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.
The namespace for Bayesian filtering algorithm: different particle filters and Kalman filter algorith...
This base provides a set of functions for maths stuff.
void push_back(const T &val)
A namespace of pseudo-random numbers generators of diferent distributions.
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
#define TEST_RESAMPLING(ALGOR)
bool vectorToTextFile(const std::vector< float > &vec, const std::string &fileName, bool append=false, bool byRows=false)
A useful function for debugging, which saves a numeric std::vector as a plain-text file compatible wi...
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sun Jul 19 15:15:43 UTC 2020 | |