-
Notifications
You must be signed in to change notification settings - Fork 5
/
getBB.m
45 lines (40 loc) · 1.18 KB
/
getBB.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
function bb = getBB(polysys,d,b)
% bb = getBB(polysys,d,b)
% -----------------------
% Computes a border pre-basis at degree d for a given polynomial system polysys.
%
% bb = matrix, each row corresponds with a coefficient vector of
% a polynomial of the border prebasis,
%
% polysys = cell containing coefficients and monomials exponents of the
% set of polynomial equations,
%
% d = scalar, degree at which border pre-basis needs to be computed,
%
% b = vector, contains the indices of monomials according
% to the degree negative lex (graded xel) monomial ordering,
% CALLS
% -----
%
% getM.m, getMex.m, getBorder.m, updateN.m
n=size(polysys{1,2},2);
d0=getD0(polysys);
M=getM(polysys,d0);
N=null(M);
% update basis nullspace M(d) recursively
for i=d0+1:d
N = updateN(N,getMex(polysys,i,i-1));
end
border = getBorder(b,n);
bb = zeros(length(border),nchoosek(d+n,n));
for i=1:length(border)
temp = null(N([b border(i)],:)');
if ~isempty(temp)
if size(temp,2) > 1
disp(['warning: multiple solutions detected for leading term: ' num2str(border(i))])
bb(i,[b border(i)]) = temp(:,1);
else
bb(i,[b border(i)]) = temp;
end
end
end