You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug discovered while writing taffy_xrods.m (talk), found that if z is zero get 'somehow there are still coincident coordinates' error.
The problem is that the code only looks for coincident particles in one coordinate (along the projection line). If particles are coincident in both coordinates, need to issue an error since it's impossible to define a braid. Adding noise, as is done currently, will give a braid, but it should't.
Here's a first code that should return a more proper error:
#!matlab
>> braid(zeros(10,2,4))
This returns the error
#!matlab
Warning: Coincident coordinates... adding a bit of noise.
> In @braid/private/color_braiding at 50
In braid.braid>braid.braid at 126
Error using color_braiding (line 95)
Somehow there are still coincident trajectories...
Error in braidlab.braid (line 126)
br = color_braiding(b,1:size(b,1),secnd);
But the error "Somehow there are still coincident trajectories..." should never actually happen. It is a safety check.
The second, related bug is when two strands are equal:
#!matlab
npts = 10; n = 4; XY = zeros(npts,2,n);
% Create constant braid (fixed strands).
for i = 1:n, XY(:,:,i) = i*ones(npts,2); end
XY(:,:,1) = XY(:,:,2); % Make two strands equals.
% Bug: nontrivial braid returned, since routine adds noise. Should
% return error instead.
braid(XY)
This returns
#!matlab
Warning: Coincident coordinates... adding a bit of noise.
> In @braid/private/color_braiding at 50
In braid.braid>braid.braid at 126
In bug_color_braiding_coincident at 9
ans =
< -1 1 -1 1 1 -1 -1 >
The braid will vary, since it is random. The warning is appropriate, since the coordinates are indeed coincident, but it should be an error about coincident particles.
This should be easy to fix: before even computing anything else, check if any coordinates are coincident. Maybe this is a bit difficult to do fast?
The text was updated successfully, but these errors were encountered:
Bug discovered while writing taffy_xrods.m (talk), found that if z is zero get 'somehow there are still coincident coordinates' error.
The problem is that the code only looks for coincident particles in one coordinate (along the projection line). If particles are coincident in both coordinates, need to issue an error since it's impossible to define a braid. Adding noise, as is done currently, will give a braid, but it should't.
Here's a first code that should return a more proper error:
This returns the error
But the error "Somehow there are still coincident trajectories..." should never actually happen. It is a safety check.
The second, related bug is when two strands are equal:
This returns
The braid will vary, since it is random. The warning is appropriate, since the coordinates are indeed coincident, but it should be an error about coincident particles.
This should be easy to fix: before even computing anything else, check if any coordinates are coincident. Maybe this is a bit difficult to do fast?
The text was updated successfully, but these errors were encountered: