added exponential distrbution + tests
new shortest-path walker (still todo) modified dijkstra-path (new helper methods)
This commit is contained in:
18
tests/math/TestDistribution.cpp
Normal file
18
tests/math/TestDistribution.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
#include "../Tests.h"
|
||||
#include "../../math/Distributions.h"
|
||||
|
||||
TEST(Distribution, Exp) {
|
||||
|
||||
ASSERT_NEAR(1.5, Distribution::Exponential<float>::getProbability(1.5, 0.0), 0.001);
|
||||
ASSERT_NEAR(1.0, Distribution::Exponential<float>::getProbability(1.0, 0.0), 0.001);
|
||||
ASSERT_NEAR(0.5, Distribution::Exponential<float>::getProbability(0.5, 0.0), 0.001);
|
||||
|
||||
ASSERT_NEAR(0.35, Distribution::Exponential<float>::getProbability(1.5, 1.0), 0.05);
|
||||
ASSERT_NEAR(0.35, Distribution::Exponential<float>::getProbability(1.0, 1.0), 0.05);
|
||||
ASSERT_NEAR(0.35, Distribution::Exponential<float>::getProbability(0.5, 1.0), 0.05);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user