1 #define BOOST_TEST_MODULE
2 #include <boost/test/included/unit_test.hpp>
3 #include <boost/test/floating_point_comparison.hpp>
5 #include <queso/VectorSpace.h>
6 #include <queso/VectorRV.h>
7 #include <queso/GslMatrix.h>
15 uqFullEnvironment env;
16 uqVectorSpace<uqGslVector, uqGslMatrix> imageSpace(env,
"test_space", 2, NULL);
17 uqMap eMap(2, 0, env.comm());
19 uqGslVector imageMinVal(env, eMap, -INFINITY);
20 uqGslVector imageMaxVal(env, eMap, INFINITY);
22 uqGslVector initExpectedValues(env, eMap, 0.0);
23 uqGslMatrix initCovMatrix(env, eMap, 1.0);
25 uqGslVector finalExpectedValues(env, eMap, 1.0);
26 uqGslMatrix finalCovMatrix(env, eMap, 3.0);
28 uqGslVector testValues(env, eMap, 0.0);
30 uqGaussianVectorRV<uqGslVector, uqGslMatrix> gaussianRV(
"test_rv", imageSpace, imageMinVal, imageMaxVal,
31 initExpectedValues, initCovMatrix);
32 double tolClose = 1e-13, tolSmall = 1e-16;
40 BOOST_REQUIRE_CLOSE(gaussianRV.pdf().actualDensity(testValues), 1.0, tolClose);
43 gaussianRV.updateExpectedValues(finalExpectedValues);
44 BOOST_REQUIRE_CLOSE(gaussianRV.pdf().actualDensity(testValues), std::exp(-1.0), tolClose);
50 uqGslVector myRealization(testValues);
51 gaussianRV.realizer().realization(myRealization);
53 std::cout << myRealization;
BOOST_AUTO_TEST_CASE(simple_test_add)