-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupgrade810.m
29 lines (22 loc) · 8.41 KB
/
upgrade810.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function [Lti,q] = upgrade810(sample,opts)
% UPGRADE810 Solve a low-rank affine upgrade problem
% [Lti,q] = UPGRADE810(sample,opts) finds the affine upgrade L and q
% given a minimal sample with id 810. Note that Lti = inv(L').
%
% See also upgradeGeneral, upgrade900, upgrade801.
V = sample.V;
a = sample.a;
c = sample.c;
[Hqp,Hqh] = findLinearConstraints(sample);
ac = a-c;
cs = create_coeffs([Hqp; Hqh; V; ac]);
sols = roots(cs).';
[Lti,q] = extractSolutions(sample,sols,Hqp,Hqh,opts);
end
function c = create_coeffs(data)
c = zeros(1,4);
c(1) = -data(10)*data(11)*data(12)*data(22) + 2*data(10)*data(11)*data(18)*data(21) + 2*data(10)*data(12)*data(17)*data(20) + data(10)*data(15)^2*data(22) - 2*data(10)*data(15)*data(17)*data(21) - 2*data(10)*data(15)*data(18)*data(20) + 2*data(11)*data(12)*data(16)*data(19) + data(11)*data(14)^2*data(22) - 2*data(11)*data(14)*data(16)*data(21) - 2*data(11)*data(14)*data(18)*data(19) + data(12)*data(13)^2*data(22) - 2*data(12)*data(13)*data(16)*data(20) - 2*data(12)*data(13)*data(17)*data(19) - 2*data(13)^2*data(18)*data(21) - 2*data(13)*data(14)*data(15)*data(22) + 2*data(13)*data(14)*data(17)*data(21) + 2*data(13)*data(14)*data(18)*data(20) + 2*data(13)*data(15)*data(16)*data(21) + 2*data(13)*data(15)*data(18)*data(19) - 2*data(14)^2*data(17)*data(20) + 2*data(14)*data(15)*data(16)*data(20) + 2*data(14)*data(15)*data(17)*data(19) - 2*data(15)^2*data(16)*data(19);
c(2) = -data(1)*data(11)*data(12)*data(22) + 2*data(1)*data(11)*data(18)*data(21) + 2*data(1)*data(12)*data(17)*data(20) + data(1)*data(15)^2*data(22) - 2*data(1)*data(15)*data(17)*data(21) - 2*data(1)*data(15)*data(18)*data(20) - data(2)*data(10)*data(12)*data(22) + 2*data(2)*data(10)*data(18)*data(21) + 2*data(2)*data(12)*data(16)*data(19) + data(2)*data(14)^2*data(22) - 2*data(2)*data(14)*data(16)*data(21) - 2*data(2)*data(14)*data(18)*data(19) - data(3)*data(10)*data(11)*data(22) + 2*data(3)*data(10)*data(17)*data(20) + 2*data(3)*data(11)*data(16)*data(19) + data(3)*data(13)^2*data(22) - 2*data(3)*data(13)*data(16)*data(20) - 2*data(3)*data(13)*data(17)*data(19) + 2*data(4)*data(12)*data(13)*data(22) - 2*data(4)*data(12)*data(16)*data(20) - 2*data(4)*data(12)*data(17)*data(19) - 4*data(4)*data(13)*data(18)*data(21) - 2*data(4)*data(14)*data(15)*data(22) + 2*data(4)*data(14)*data(17)*data(21) + 2*data(4)*data(14)*data(18)*data(20) + 2*data(4)*data(15)*data(16)*data(21) + 2*data(4)*data(15)*data(18)*data(19) + 2*data(5)*data(11)*data(14)*data(22) - 2*data(5)*data(11)*data(16)*data(21) - 2*data(5)*data(11)*data(18)*data(19) - 2*data(5)*data(13)*data(15)*data(22) + 2*data(5)*data(13)*data(17)*data(21) + 2*data(5)*data(13)*data(18)*data(20) - 4*data(5)*data(14)*data(17)*data(20) + 2*data(5)*data(15)*data(16)*data(20) + 2*data(5)*data(15)*data(17)*data(19) + 2*data(6)*data(10)*data(15)*data(22) - 2*data(6)*data(10)*data(17)*data(21) - 2*data(6)*data(10)*data(18)*data(20) - 2*data(6)*data(13)*data(14)*data(22) + 2*data(6)*data(13)*data(16)*data(21) + 2*data(6)*data(13)*data(18)*data(19) + 2*data(6)*data(14)*data(16)*data(20) + 2*data(6)*data(14)*data(17)*data(19) - 4*data(6)*data(15)*data(16)*data(19) + 2*data(7)*data(11)*data(12)*data(19) - 2*data(7)*data(11)*data(14)*data(21) - 2*data(7)*data(12)*data(13)*data(20) + 2*data(7)*data(13)*data(15)*data(21) + 2*data(7)*data(14)*data(15)*data(20) - 2*data(7)*data(15)^2*data(19) + 2*data(8)*data(10)*data(12)*data(20) - 2*data(8)*data(10)*data(15)*data(21) - 2*data(8)*data(12)*data(13)*data(19) + 2*data(8)*data(13)*data(14)*data(21) - 2*data(8)*data(14)^2*data(20) + 2*data(8)*data(14)*data(15)*data(19) + 2*data(9)*data(10)*data(11)*data(21) - 2*data(9)*data(10)*data(15)*data(20) - 2*data(9)*data(11)*data(14)*data(19) - 2*data(9)*data(13)^2*data(21) + 2*data(9)*data(13)*data(14)*data(20) + 2*data(9)*data(13)*data(15)*data(19) + data(10)*data(11)*data(21)^2 + data(10)*data(12)*data(20)^2 - 2*data(10)*data(15)*data(20)*data(21) + data(11)*data(12)*data(19)^2 - 2*data(11)*data(14)*data(19)*data(21) - 2*data(12)*data(13)*data(19)*data(20) - data(13)^2*data(21)^2 + 2*data(13)*data(14)*data(20)*data(21) + 2*data(13)*data(15)*data(19)*data(21) - data(14)^2*data(20)^2 + 2*data(14)*data(15)*data(19)*data(20) - data(15)^2*data(19)^2;
c(3) = -data(1)*data(2)*data(12)*data(22) + 2*data(1)*data(2)*data(18)*data(21) - data(1)*data(3)*data(11)*data(22) + 2*data(1)*data(3)*data(17)*data(20) + 2*data(1)*data(6)*data(15)*data(22) - 2*data(1)*data(6)*data(17)*data(21) - 2*data(1)*data(6)*data(18)*data(20) + 2*data(1)*data(8)*data(12)*data(20) - 2*data(1)*data(8)*data(15)*data(21) + 2*data(1)*data(9)*data(11)*data(21) - 2*data(1)*data(9)*data(15)*data(20) + data(1)*data(11)*data(21)^2 + data(1)*data(12)*data(20)^2 - 2*data(1)*data(15)*data(20)*data(21) - data(2)*data(3)*data(10)*data(22) + 2*data(2)*data(3)*data(16)*data(19) + 2*data(2)*data(5)*data(14)*data(22) - 2*data(2)*data(5)*data(16)*data(21) - 2*data(2)*data(5)*data(18)*data(19) + 2*data(2)*data(7)*data(12)*data(19) - 2*data(2)*data(7)*data(14)*data(21) + 2*data(2)*data(9)*data(10)*data(21) - 2*data(2)*data(9)*data(14)*data(19) + data(2)*data(10)*data(21)^2 + data(2)*data(12)*data(19)^2 - 2*data(2)*data(14)*data(19)*data(21) + 2*data(3)*data(4)*data(13)*data(22) - 2*data(3)*data(4)*data(16)*data(20) - 2*data(3)*data(4)*data(17)*data(19) + 2*data(3)*data(7)*data(11)*data(19) - 2*data(3)*data(7)*data(13)*data(20) + 2*data(3)*data(8)*data(10)*data(20) - 2*data(3)*data(8)*data(13)*data(19) + data(3)*data(10)*data(20)^2 + data(3)*data(11)*data(19)^2 - 2*data(3)*data(13)*data(19)*data(20) + data(4)^2*data(12)*data(22) - 2*data(4)^2*data(18)*data(21) - 2*data(4)*data(5)*data(15)*data(22) + 2*data(4)*data(5)*data(17)*data(21) + 2*data(4)*data(5)*data(18)*data(20) - 2*data(4)*data(6)*data(14)*data(22) + 2*data(4)*data(6)*data(16)*data(21) + 2*data(4)*data(6)*data(18)*data(19) - 2*data(4)*data(7)*data(12)*data(20) + 2*data(4)*data(7)*data(15)*data(21) - 2*data(4)*data(8)*data(12)*data(19) + 2*data(4)*data(8)*data(14)*data(21) - 4*data(4)*data(9)*data(13)*data(21) + 2*data(4)*data(9)*data(14)*data(20) + 2*data(4)*data(9)*data(15)*data(19) - 2*data(4)*data(12)*data(19)*data(20) - 2*data(4)*data(13)*data(21)^2 + 2*data(4)*data(14)*data(20)*data(21) + 2*data(4)*data(15)*data(19)*data(21) + data(5)^2*data(11)*data(22) - 2*data(5)^2*data(17)*data(20) - 2*data(5)*data(6)*data(13)*data(22) + 2*data(5)*data(6)*data(16)*data(20) + 2*data(5)*data(6)*data(17)*data(19) - 2*data(5)*data(7)*data(11)*data(21) + 2*data(5)*data(7)*data(15)*data(20) + 2*data(5)*data(8)*data(13)*data(21) - 4*data(5)*data(8)*data(14)*data(20) + 2*data(5)*data(8)*data(15)*data(19) - 2*data(5)*data(9)*data(11)*data(19) + 2*data(5)*data(9)*data(13)*data(20) - 2*data(5)*data(11)*data(19)*data(21) + 2*data(5)*data(13)*data(20)*data(21) - 2*data(5)*data(14)*data(20)^2 + 2*data(5)*data(15)*data(19)*data(20) + data(6)^2*data(10)*data(22) - 2*data(6)^2*data(16)*data(19) + 2*data(6)*data(7)*data(13)*data(21) + 2*data(6)*data(7)*data(14)*data(20) - 4*data(6)*data(7)*data(15)*data(19) - 2*data(6)*data(8)*data(10)*data(21) + 2*data(6)*data(8)*data(14)*data(19) - 2*data(6)*data(9)*data(10)*data(20) + 2*data(6)*data(9)*data(13)*data(19) - 2*data(6)*data(10)*data(20)*data(21) + 2*data(6)*data(13)*data(19)*data(21) + 2*data(6)*data(14)*data(19)*data(20) - 2*data(6)*data(15)*data(19)^2;
c(4) = -data(1)*data(2)*data(3)*data(22) + 2*data(1)*data(2)*data(9)*data(21) + data(1)*data(2)*data(21)^2 + 2*data(1)*data(3)*data(8)*data(20) + data(1)*data(3)*data(20)^2 + data(1)*data(6)^2*data(22) - 2*data(1)*data(6)*data(8)*data(21) - 2*data(1)*data(6)*data(9)*data(20) - 2*data(1)*data(6)*data(20)*data(21) + 2*data(2)*data(3)*data(7)*data(19) + data(2)*data(3)*data(19)^2 + data(2)*data(5)^2*data(22) - 2*data(2)*data(5)*data(7)*data(21) - 2*data(2)*data(5)*data(9)*data(19) - 2*data(2)*data(5)*data(19)*data(21) + data(3)*data(4)^2*data(22) - 2*data(3)*data(4)*data(7)*data(20) - 2*data(3)*data(4)*data(8)*data(19) - 2*data(3)*data(4)*data(19)*data(20) - 2*data(4)^2*data(9)*data(21) - data(4)^2*data(21)^2 - 2*data(4)*data(5)*data(6)*data(22) + 2*data(4)*data(5)*data(8)*data(21) + 2*data(4)*data(5)*data(9)*data(20) + 2*data(4)*data(5)*data(20)*data(21) + 2*data(4)*data(6)*data(7)*data(21) + 2*data(4)*data(6)*data(9)*data(19) + 2*data(4)*data(6)*data(19)*data(21) - 2*data(5)^2*data(8)*data(20) - data(5)^2*data(20)^2 + 2*data(5)*data(6)*data(7)*data(20) + 2*data(5)*data(6)*data(8)*data(19) + 2*data(5)*data(6)*data(19)*data(20) - 2*data(6)^2*data(7)*data(19) - data(6)^2*data(19)^2;
end