add_ndxd.m

来自「麻省理工学院的人工智能工具箱,很珍贵,希望对大家有用!」· M 代码 · 共 21 行

M
21
字号
function id = add_ndxD(bigdom, smalldom, ns)
% ADD_NDXD Possibly add new indexes to the global cache
% id = add_ndxD(bigdom, smalldom, ns)
%
% ns is the node sizes of all nodes
% id is the identifier for the cache entry, new or existing.

global D_NDX
ndx = mk_ndxD(bigdom, smalldom, ns);

ndxD_len = length(D_NDX);
for i=1:ndxD_len
  if isequal(ndx, D_NDX{i})
    id = i;
    return;
  end
end

id = ndxD_len + 1;
D_NDX{id} = ndx;

⌨️ 快捷键说明

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