Commit 16c4ed76 authored by Conor McCoid's avatar Conor McCoid
Browse files

Tetra: initialized Z in higher dim algo, loose bounds on size

parent ebcfab25
...@@ -36,12 +36,12 @@ if prod(sum(S,2))==0 % if there is a given coordinate where all X values are n ...@@ -36,12 +36,12 @@ if prod(sum(S,2))==0 % if there is a given coordinate where all X values are n
Z=[]; Z=[];
return return
end end
S=prod(S); S=prod(S); m=sum(S==1); Z=U(:,S==1);
Z=U(:,S==1);
%--Intersections--% %--Intersections--%
global D global D
D=zeros(2^n,2^(n+1)); % storage for determinants D=zeros(2^n,2^(n+1)); % storage for determinants
Z=[Z,zeros(n-1,2^n * n)]; % is this the actual number of possible intersections? surely we can prove a tighter bound
H=cell(1); J=H; T=H; H=cell(1); J=H; T=H;
H{1}=X; J{1}=eye(n); T{1}=zeros(n,1); H{1}=X; J{1}=eye(n); T{1}=zeros(n,1);
for i=1:n-2 for i=1:n-2
...@@ -50,19 +50,21 @@ for i=1:n-2 ...@@ -50,19 +50,21 @@ for i=1:n-2
return return
end end
for j=1:length(T) % given this unpacking it is probably more efficient to do this step within the subfunctions for j=1:length(T) % given this unpacking it is probably more efficient to do this step within the subfunctions
Hj=H{j}; S=prod(Hj>=0); Z=[Z,A*Hj(2:end,S==1)+v0]; H1=H{j}; S=prod(H1>=0); mj=sum(S==1);
Z(:,m+(1:mj))=A*H1(2:end,S==1)+v0; m=m+mj;
if sum(S)~=0 % check which hyperplanes of V intersect with edges of U if sum(S)~=0 % check which hyperplanes of V intersect with edges of U
ind=1:n; ind=ind(T{j}==1)-1; ind(ind==0)=n; ind=1:n; ind=ind(T{j}==1)-1; ind(ind==0)=n;
nhbrs(ind)=1; nhbrs(ind)=1;
end end
end end
end end
Z=Z(:,1:m);
%--Vertices of Y in X--% %--Vertices of Y in X--%
binV=zeros(n,1); indV=binV; % another probably terrible way of doing things... see notes on v1 of Unfold and v2 of Orphan for thoughts binV=zeros(n,1); indV=binV; % another probably terrible way of doing things... see notes on v1 of Unfold and v2 of Orphan for thoughts
while ~isempty(H) while ~isempty(H)
H1=H{1}; T1=T{1}; H1=H{1}; T1=T{1};
indT=1:n; indT=indT(T1==0); % at most two values in ind indT=1:n; indT=indT(T1==0); % at most two values in indT
for i=indT for i=indT
if indV(i)==0 if indV(i)==0
j=indT(indT~=i); j=indT(indT~=i);
......
function [H_new,J_new,T_new] = SUB_simplices_Orphan_v2_20211214(H,J,T,y) function [H_new,J_new,T_new,m_new] = SUB_simplices_Orphan_v2_20211214(H,J,T,y)
% ORPHAN determines adjacent intersections and generates index set % ORPHAN determines adjacent intersections and generates index set
% [H_new,J_new,T_new] = Orphan(H,J,T,A,y,X) finds all intersections % [H_new,J_new,T_new] = Orphan(H,J,T,A,y,X) finds all intersections
% H_new between the n-simplex X and the hyperplanes indexed by T and y. % H_new between the n-simplex X and the hyperplanes indexed by T and y.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment