Index: trunk/tests/test_ContOrthoPoly1D.cc =================================================================== --- trunk/tests/test_ContOrthoPoly1D.cc (revision 562) +++ trunk/tests/test_ContOrthoPoly1D.cc (revision 563) @@ -1,138 +1,179 @@ #include "UnitTest++.h" #include "test_utils.hh" #include "npstat/nm/ContOrthoPoly1D.hh" #include "npstat/rng/MersenneTwister.hh" using namespace npstat; using namespace std; inline static int kdelta(const unsigned i, const unsigned j) { return i == j ? 1 : 0; } namespace { TEST(ContOrthoPoly1D_orthonormalization) { const double eps = 1.0e-15; const OrthoPolyMethod method[] = {OPOLY_STIELTJES, OPOLY_LANCZOS}; const unsigned nMethods = sizeof(method)/sizeof(method[0]); const unsigned npoints = 64; const unsigned maxdeg = 10; const unsigned ntries = 10; std::vector points(2U*npoints); std::vector measure; measure.reserve(npoints); std::vector coeffs(maxdeg + 1); MersenneTwister rng; for (unsigned imeth=0; imeth(kdelta(i, j)), d, eps); } measure.clear(); for (unsigned i=0; i(kdelta(i, 0)), coeffs[i], eps); } } + TEST(ContOrthoPoly1D_weightCoeffs) + { + const double eps = 1.0e-8; + + const unsigned maxdeg = 10; + const unsigned ntries = 10; + const unsigned npoints = maxdeg + 1U; + + std::vector points(2U*npoints); + std::vector measure; + measure.reserve(npoints); + std::vector coeffs(maxdeg + 1); + + MersenneTwister rng; + + for (unsigned itry=0; itry points(npoints); for (unsigned itry=0; itry points(npoints); for (unsigned itry=0; itry