Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
Update samplers to genereate symm pos def matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
guimspace committed May 26, 2021
1 parent 9bfaece commit 047c7e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 5 additions & 6 deletions c/test/sampler.m
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
11 changes: 5 additions & 6 deletions python/test/sampler.m
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 047c7e4

Please sign in to comment.