diff options
Diffstat (limited to 'williamson.m')
-rw-r--r-- | williamson.m | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/williamson.m b/williamson.m index f969ab1..eaba514 100644 --- a/williamson.m +++ b/williamson.m @@ -57,7 +57,6 @@ function [Db, S] = williamson(V, tol) Kt = K * p; s1t = p * s1 * p; - s1t dd = xpxp_to_xxpp(s1t); perm_indices = xpxp_to_xxpp(1:2*n); @@ -70,4 +69,14 @@ function [Db, S] = williamson(V, tol) S = inv(S)'; end +%!test +%! V = load('test_data/covmat0.csv'); +%! [Db, S] = williamson(V); +%! assert(Db,eye(8), 1e-14) + +%!test +%! V = load('test_data/covmat15.csv'); +%! D0 = load('test_data/w_diag15.csv'); +%! [Db, S] = williamson(V); +%! assert(Db,D0, 1e-9) |