DMUG-Archiv 2018

Frühere   Chronologischer Index   Spätere
Vorherige   Thematischer Index   Nächste

Re: [Dmug] knot theory package

Hello Stephan,

this

a shot into the wild

In[8]:= TimeConstrained[ DrawPD[DTCode[2 RandomInteger[{1, 32}, {36}]], {Gap -> 0.025}], 180]

is bullshit, because DT codes are permutations, not just RandomIntegers[]; something like that does a structural correct - but still wildly uneducated - guess

In[75]:= messageHandler = If[Last[#], Abort[]] &
Internal`AddHandler["Message", messageHandler]

Out[75]= If[Last[#1], Abort[]] &

In[92]:= Clear[rosebrockShot]
rosebrockShot[o_Integer?Positive] :=
Block[{l0 = Flatten @@ RandomPermutation[o], l1},
   l0 = Join[Complement[Range[o], l0], l0];
   l1 = 2 (((RandomInteger[{-1, 0}, o]) /. 0 -> 1) l0);
   Print[l1];
   TimeConstrained[DrawPD[DTCode[l1, {Gap -> 0.025}]], 180]
]

In[94]:= rosebrockShot[36]
During evaluation of In[94]:= {44,2,16,-4,-68,72,32,10,-30,-22,62,34,28,18,-52,56,-36,-38,-12,-40,6,14,46,54,26,-20,-66,-60,-8,58,24,-64,42,-70,-48,50}

During evaluation of In[94]:= System`Part::partw: Part 2 of GaussCode[DTCode[44,2,16,-4,-68,72,32,10,-30,-22,62,34,28,18,-52,56,-36,-38,-12,-40,6,14,46,54,26,-20,-66,-60,-8,58,24,-64,42,-70,-48,50,Gap->0.025]] does not exist. >>

Out[94]= $Aborted


the idea how to Abort[] on the very first message came from
https://mathematica.stackexchange.com/questions/1512/how-to-abort-on-any-message-generated

and for minimal efficency one should store unsuccessful input (e.g. as a list of their SHA hashes)

In[101]:= Hash[{44, 2, 16, -4, -68, 72, 32, 10, -30, -22, 62, 34, 28,
18, -52, 56, -36, -38, -12, -40, 6, 14, 46, 54,
26, -20, -66, -60, -8, 58, 24, -64, 42, -70, -48, 50}, "SHA"]

Out[101]= 49040125303340877648603157613185174793122282112

to avoid these in further tests.

Regards
Udo.
_______________________________________________
DMUG Deutschsprachiges Mathematica-Forum demug@XXXXXXX.ch
http://www.mathematica.ch/mailman/listinfo/demug
Archiv: http://www.mathematica.ch/archiv.html

Antworten:
Verweise:
Frühere   Chronologischer Index   Spätere
Vorherige   Thematischer Index   Nächste

DMUG DMUG-Archiv, http://www.mathematica.ch/archiv.html