clear all

%% Inputs
A = [0.4983 0 0.5935 7.139 14.2715 24.6953 34.9027 40.5437; ...
    0.0973 0.0110 0.0191 0 0 0 0 0; ...
    0.0041 0.0442 0.3378 0.0698 0.0251 0.0065 0.0085 0; ...
    0 0.0014 0.1355 0.4286 0.1736 0.0968 0.0427 0.0435; ...
    0 0 0.0363 0.3841 0.6025 0.4258 0.2991 0.2174; ...
    0 0 0.0019 0.0254 0.113 0.2387 0.1709 0.2826; ...
    0 0 0 0.0095 0.0272 0.1548 0.3248 0.1957; ...
    0 0 0 0.0032 0.0063 0.0452 0.1282 0.2391];

n = 8;
s = 2;
[U, F] = UFdecomp(A);

DAt = rand(n^2, s);
HAt = rand(n^2*s, s);
DUt = rand(n^2, s);
DFt = rand(n^2, s);
HUt = rand(n^2*s, s);
HFt = rand(n^2*s, s);

%% Hessians

H1 = Hlambda_A(A);
H2 = Hlambda_theta(A, DAt, HAt);
H2a = Hlambda_sigma(U, F);

H3 = Hr_A(A);
H4 = Hr_theta(A, DAt, HAt);

H5 = HR0_U(U, F);
H6 = HR0_F(U, F);
H7 = HR0_theta(U, F, DUt, DFt, HUt, HFt);
H8 = HR0_theta_1(U, F, DUt, DFt, HUt, HFt);