Skip to content
Snippets Groups Projects
Commit e0c50fa9 authored by Peter Reischig's avatar Peter Reischig Committed by Nicola Vigano
Browse files

Bug fixed: numerically exact intersections are now properly detected.

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@553 4c865b51-4357-4376-afb4-474e03ccb993
parent 27301dd7
No related branches found
No related tags found
No related merge requests found
......@@ -138,7 +138,7 @@ end
% Which lines are identical pair-wise (small distance and angle)
% -> double detection of Friedel pairs or wrong indexing
Lp = (Ld < tol.pd) & (abs(Lc) > tol.pc);
Lp = (Ld <= tol.pd) & (abs(Lc) >= tol.pc);
% Make matrices symmetric
Ld = Ld+Ld';
......@@ -150,7 +150,7 @@ Lry = Lry+Lry';
Lrz = Lrz+Lrz';
% Which lines are closer than the tolerance ?
Lnear = Ld < tol.dist;
Lnear = Ld <= tol.dist;
for i = 1:nof_lines
Lnear(i,i) = false;
end
......@@ -197,7 +197,7 @@ parfor ii = 1:nof_Nbase-1
dist = sum(dist.*dist,2);
distok = dist < told;
distok = dist <= told;
Nneib(ii,:) = distok;
end
......@@ -336,7 +336,7 @@ Rdistall = sum(diffRout.*fzonedirnorm,2);
Rdist = min(abs(Rdistall));
% Distance smaller than tolerance ?
Redge = Rdist < tol.dist;
Redge = Rdist <= tol.dist;
% If R vector is slightly out of the fundamental zone boundaries, set it
% back on the nearest boundary plane.
......
......@@ -82,7 +82,7 @@ end
% Which lines are identical pair-wise (small distance and angle)
% -> double detection of Friedel pairs or wrong indexing
Lp = (Ld < tol_Rdist) & (abs(Lc) > tol_cos);
Lp = (Ld <= tol_Rdist) & (abs(Lc) >= tol_cos);
% Make matrices symmetric
Ld = Ld + Ld';
......@@ -90,7 +90,7 @@ Lp = Lp | Lp';
% Which lines are closer than the tolerance ?
Lnear = Ld < tol_Rdist;
Lnear = (Ld <= tol_Rdist);
Lnear(sub2ind([nof_lines nof_lines], 1:nof_lines, 1:nof_lines)) = false;
......@@ -153,7 +153,7 @@ for ii = 1:nof_Nbase-1
dist = sum(dist.*dist,2);
distok = dist < told;
distok = (dist <= told);
Nneib(ii,:) = distok;
end
......@@ -317,7 +317,7 @@ Rdistall = sum(diffRout.*fzone_acc(:,4:6),2);
Rdist = min(abs(Rdistall));
% Distance smaller than tolerance ?
Redge = Rdist < tol_Rdist;
Redge = Rdist <= tol_Rdist;
% If R vector is slightly out of the fundamental zone boundaries, set it
% back on the nearest boundary plane.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment