Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when changing projection line in color_braiding #3

Closed
jeanluct opened this issue Nov 27, 2014 · 3 comments
Closed

Bug when changing projection line in color_braiding #3

jeanluct opened this issue Nov 27, 2014 · 3 comments

Comments

@jeanluct
Copy link
Owner

Bug discovered while writing taffy_xrods.m (talk). (This was originally filed with issue #2, but has been split into a separae issue.)

This is a very 'symmetric' case where noise is needed for the trajectories. By changing the projection angle it should have fixed it? But we still get an error.

#!matlab

npts = 200; r = .75; rodr = .05; n = 5;

th = linspace(0,2*pi,npts); th = th(end:-1:1);

z = zeros(npts,n);
z(:,1) = 0 + r*exp(1i*(th-pi));
z(:,2) = 0;
z(:,3) = 1 + r*exp(1i*th);
z(:,4) = 1;
z(:,5) = .5*ones(size(z(:,1)));

XY = zeros(npts,2,n); XY(:,1,:) = real(z); XY(:,2,:) = imag(z);

% Bug? If we specify a projection angle we sometimes get an error.
b = braid(XY,.1)

This returns the error

#!matlab

Error using color_braiding (line 181)
crossdat inconsistency at crossing 6, time 124.110878, index 2, with permutation [2
5  3  1  4].

Error in braidlab.braid (line 126)
        br = color_braiding(b,1:size(b,1),secnd);

The longer version attached also plots the trajectories and the braid.

@jeanluct
Copy link
Owner Author

From Jean-Luc Thiffeault on 2013-01-20 22:41:18+00:00

The bug is not in the projection angle calculation, I'm pretty sure.

Chaging npts makes the bug appear and disappear. The simplest choice is npts=3 (!)

Actually, I think I know what the bug is. Even though we check for coincident particles at first, it's possible that coincidence will arise because of interpolation! Grrr!

@jeanluct
Copy link
Owner Author

From Jean-Luc Thiffeault on 2013-01-21 04:25:44+00:00

Here's the simplest example I can come up with: 3 strings of 4 points.

#!matlab

npts = 4; r = .75; n = 3; th = linspace(0,2*pi,npts); th = th(end:-1:1);

z = zeros(npts,n);
z(:,1) = 0 + r*exp(1i*(th-pi));
z(:,2) = 1 + r*exp(1i*th);
z(:,3) = .5*ones(size(z(:,1)));

XY = zeros(npts,2,n); XY(:,1,:) = real(z); XY(:,2,:) = imag(z);

% Bug?  If we specify a projection angle we sometimes get an error.
b = braid(XY,1)

with output

#!matlab

Error using color_braiding (line 204)
crossdat inconsistency at crossing 1, time 1.585051, index 1, with permutation [1  2  3].

Error in braidlab.braid (line 126)
        br = color_braiding(b,1:size(b,1),secnd);

Here's a plot of the braid from the two axes:

triple crossing

It's pretty clear the triple-crossings are creating the problem. The braid is perfectly well-defined (identity braid in this case), but the algorithm gets confused. Not sure yet if the X or Y triple crossing is the problem.

@jeanluct
Copy link
Owner Author

From Jean-Luc Thiffeault on 2013-01-21 15:33:04+00:00

Resolve issue #3: If the crossing string is not the one on the right,
start looking for a simultaneous crossing. If we find one, then swap
and use that crossing instead.

→ <<cset 7dfcea223346>>

jeanluct added a commit that referenced this issue Nov 13, 2019
Squashed commit of the following:

commit bbd3120
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Wed Nov 13 08:20:41 2019 -0600

    Fix dubious negation exposed by Mac compiler.

commit 678f2ec
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Thu Nov 2 21:21:33 2017 -0500

    Fix wonky indentation exposed by gcc-7.2.

commit 763d851
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Thu Nov 2 21:20:35 2017 -0500

    Alias libtrains.a to targets.

commit c68b86f
Author: Jean-Luc Thiffeault <jeanluc@math.wisc.edu>
Date:   Fri Jan 2 13:04:57 2015 -0600

    Add Google Analytics tracker with ga-beacon.

commit bb2640a
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Tue Dec 23 12:06:01 2014 -0500

    Replace .. by # (root folder).

commit 1a4b810
Merge: 359fd98 441a39f
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Mon Dec 22 21:13:07 2014 -0500

    Merge branch 'old-trains3-branch'

commit 441a39f
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Mon Dec 22 21:10:46 2014 -0500

    Update Toby's website.

commit d986c02
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Mon Dec 22 21:10:23 2014 -0500

    Add COPYING and README.

commit 359fd98
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Sun Dec 21 22:18:20 2014 -0600

    Remove old/trains3, after making a branch to keep the old version.

commit 3d52dcd
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Sun Dec 21 22:14:09 2014 -0600

    Update Scons build files (more sane).

commit 2fae64b
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Sun Dec 21 09:51:17 2014 -0600

    No need to ignore src/libtrains.a.

commit e1f1467
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Sun Dec 21 09:50:09 2014 -0600

    Comment-out unused var in train.cpp.

commit 5c555d6
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Sun Dec 21 09:44:19 2014 -0600

    Move files to subfolders; update Makefiles.

commit a22ff6e
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Sun Dec 21 09:02:42 2014 -0600

    Updated README with disclaimer.

commit daffe91
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Sun Dec 21 09:00:34 2014 -0600

    Added README.md.

commit 897a672
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Sun Dec 21 08:49:03 2014 -0600

    Move pdf to doc.

commit ac4f3a1
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Sun Dec 21 08:39:20 2014 -0600

    Added tag split-from-braid-code for changeset 2ae19857667d

commit 00f94b5
Author: convert-repo <devnull@localhost>
Date:   Sun Dec 21 20:37:58 2014 +0000

    update tags

commit a491ff8
Author: Marko Budisic <mbudisic@gmail.com>
Date:   Wed Nov 6 17:29:46 2013 -0600

    loopg - added private methods that return number of punctures and genus of the surface on which the loop lives

commit 8cf4bb2
Author: Marko Budisic <mbudisic@gmail.com>
Date:   Tue Nov 5 11:42:30 2013 -0600

    TAGS file for emacs code exploration

commit f82d997
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Tue Jan 22 08:32:45 2013 -0600

    Remove executable flag from files that shouldn't have it.

commit 922f47a
Author: matz <matz@ba35782b-c7b8-4bd9-8707-15d7a7f098ea>
Date:   Fri Jun 15 00:23:13 2012 +0000

    extensive help file for trains program, including interpretation of train track graph

commit 96a083a
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Tue Jun 9 19:50:10 2009 +0000

    run_train.m: look at isotopy class of sequences of generators.

commit 3e6a503
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Fri Jun 5 17:01:41 2009 +0000

     * Created a wrapper (train.cpp) for Toby's functions that can easily be called from Matlab.
     * Updated train.m to use train.cpp.

commit 5f072f2
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Tue Jul 15 18:14:31 2008 +0000

    g++-3.4 needs a couple of missing forward declarations.

commit 23aef74
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Sun Jul 6 05:04:39 2008 +0000

    Replace Jamfile by SCons SConscript/Sconstruct.

commit f5be550
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Sat Jul 5 19:46:02 2008 +0000

    Added Jamfile for bjam.

commit b750caf
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Sat Apr 5 22:15:34 2008 +0000

    Declare string literals "const" to suppress compiler warnings when
    upgrading to gcc 4.2.3 (Ubuntu 8.04).

commit 9290755
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Thu Apr 3 16:07:50 2008 +0000

     * Use trains v4 by default.
     * Modifify Makefile to build libtrains.a if needed.
     * Move trains4 to trains.

commit 07f56a7
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Thu Apr 3 15:47:18 2008 +0000

     * Select trains v3 or v4 with #define TRAINS3 or TRAINS4.
     * Moved current trains directory to trains3.

commit d71fc10
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Thu Apr 3 12:34:51 2008 +0000

    Renamed ABS to FABS to suppress compiler warning.  Closes ticket #3.

commit 322bcd8
Author: Jean-Luc Thiffeault <jeanluc@mailaps.org>
Date:   Tue Feb 5 19:17:57 2008 +0000

    - Moved all the header files to a braid subdirectory.
    - Added svn:externals.
    - Updated Makefile.
    - For some reason, the new version of mpfrxx.h is broken and creates
      problems with compilation of the other files, so I commented it out
      in lamination.hpp.  This means that testlamination.cpp is BROKEN.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant