Added unitary test.

time-shift
Stéphane Adjemian (Charybdis) 2011-12-19 15:54:30 +01:00
parent cf1d07f31c
commit 7ff36b680b
1 changed files with 16 additions and 1 deletions

View File

@ -105,4 +105,19 @@ nodes = sqrt(2)*nodes;
%$ t(2) = dyn_assert(ones(1,2),variance,1e-12);
%$ t(3) = dyn_assert(zeros(1,2),expectation,1e-12);
%$ T = all(t);
%@eof:3
%@eof:3
%@test:4
%$ n = 9; sigma = .1;
%$ [nodes,weights] = gauss_hermite_weights_and_nodes(n);
%$
%$ sum_of_weights = sum(weights);
%$ expectation = sum(weights.*nodes*.1);
%$ variance = sum(weights.*((nodes*.1).^2));
%$
%$ % Check the results.
%$ t(1) = dyn_assert(1.0,sum_of_weights,1e-12);
%$ t(2) = dyn_assert(.01,variance,1e-12);
%$ t(3) = dyn_assert(0.0,expectation,1e-12);
%$ T = all(t);
%@eof:4