minwdegree.m

来自「在matlab中」· M 代码 · 共 37 行

M
37
字号
function index = minwdegree(G,J,a,b)% index = minlex(G,J,m)%% Find minimum polynomial with respect to (a,b) weighted degree.% Arguments are a list of polynomials G, indices to search over J% and parameter m.  The polynomials are assumed to be in the form%%     G(x,y,index)%% so that G(:,:,j) is the j-th polynomial in the list.winval = 1e6;winlocI = 1e6;winlocJ = 1e6;for ind1=J   g = reshape(G(:,:,ind1),size(G,1),size(G,2));   [Is, Js, gij] = find(g~=0);   wts = a*(Is-1) + b*(Js-1);     % make sure to get 0 term   [val, k] = max(wts);   if (val < winval)      winval = val;      winlocI = Is(k);      winlocJ = ind1;   elseif (val == winval)          % break ties with lexicographic      if Is(k) < winlocI         winval = val;         winlocI = Is(k);         winlocJ = ind1;      end   endendindex = winlocJ;   

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?