Skip to content
Snippets Groups Projects
Commit 6cecc181 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Added unitary test.

parent cd9250ed
Branches
Tags
No related merge requests found
......@@ -56,4 +56,19 @@ JacobiMatrix = diag(b,1)+diag(b,-1);
JacobiEigenVector = JacobiEigenVectors(1,:);
JacobiEigenVector = transpose(JacobiEigenVector(idx));
weights = JacobiEigenVector.^2;
nodes = sqrt(2)*nodes;
\ No newline at end of file
nodes = sqrt(2)*nodes;
%@test:1
%$ n = 5;
%$ [nodes,weights] = gauss_hermite_weights_and_nodes(n);
%$
%$ sum_of_weights = sum(weights);
%$
%$ % Expected nodes (taken from Judd (1998, table 7.4).
%$ enodes = [-2.020182870; -0.9585724646; 0; 0.9585724646; 2.020182870];
%$
%$ % Check the results.
%$ t(1) = dyn_assert(1.0,sum_of_weights,1e-12);
%$ t(2) = dyn_assert(enodes,nodes/sqrt(2),1e-8);
%$ T = all(t);
%@eof:1
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment