From 047c7e4af3701be5909397e7535da8b3dcc5181b Mon Sep 17 00:00:00 2001 From: Guilherme Tadashi Maeoka Date: Wed, 26 May 2021 09:59:30 -0300 Subject: [PATCH] Update samplers to genereate symm pos def matrices --- c/test/sampler.m | 11 +++++------ python/test/sampler.m | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/c/test/sampler.m b/c/test/sampler.m index 7417f96..cf908b9 100644 --- a/c/test/sampler.m +++ b/c/test/sampler.m @@ -1,13 +1,12 @@ clear all -n = 10; +n = 100; A = rand(n); +A = 0.5 * (A + A'); +A = A * A'; +A = A + n * eye(n); -[L, U, P] = lu(A); -clear L U - -A = P * A; -b = A * [1:n]'; +b = A * [n:-1:1]'; x = A \ b; save A.mat A; diff --git a/python/test/sampler.m b/python/test/sampler.m index 7417f96..cf908b9 100644 --- a/python/test/sampler.m +++ b/python/test/sampler.m @@ -1,13 +1,12 @@ clear all -n = 10; +n = 100; A = rand(n); +A = 0.5 * (A + A'); +A = A * A'; +A = A + n * eye(n); -[L, U, P] = lu(A); -clear L U - -A = P * A; -b = A * [1:n]'; +b = A * [n:-1:1]'; x = A \ b; save A.mat A;