Page 27 of 51

Re: Software that makes placemats

Posted: 11:57 Wed 19 Jun 2013
by jdaw1
PhilW wrote:Any possibility of multiple roots between initial bounds (excluding duplicate root)? (I.e. can we either exclude the possibility of multiple roots being present, and If not then do we care? i.e. are all roots required, or any root). Could there be any bounding of the relative ratio of xTolerance to initial delta between upper and lower bounds?

n.b. I assume direct calculation would not be appropriate?
LowerX < UpperX; f(LowerX) × f(UpperX) ≤ 0. Any root that is between LowerX and UpperX, please.

PhilW wrote:n.b. I assume direct calculation would not be appropriate?
I thought about that, and decided that it would be too much grief.

Re: Software that makes placemats

Posted: 12:03 Wed 19 Jun 2013
by PhilW
PhilW wrote:Could there be any bounding of the relative ratio of xTolerance to initial delta between upper and lower bounds?
(and if the implicit answer from your previous post is "no", then how is xTolerance defined/determined?)

Re: Software that makes placemats

Posted: 12:06 Wed 19 Jun 2013
by jdaw1
PhilW wrote:how is xTolerance defined/determined?)
I know that x is in points, so xTolerance is defined to be 0.01. An answer that accurate is good enough for me.

Re: Software that makes placemats

Posted: 13:42 Wed 19 Jun 2013
by PhilW
jdaw1 wrote:
PhilW wrote:how is xTolerance defined/determined?)
I know that x is in points, so xTolerance is defined to be 0.01. An answer that accurate is good enough for me.
If a maximum paper size can also be assumed, perhaps no greater than 3.5m in one dimension should be more than sufficient, then this would presumably bound the upper limit to 10000 points, which with a tolerance of 0.01 gives a worst case ratio of tolerance to initial upper-lower of 1/1000000 or approx. 1/(2^20). To identify a 1 in 2^20 region, would then require 20 calculations of y using bisection, which then gives us an upper bound for the required computation.
jdaw1 wrote:Desiderata include robustness, speed, and simplicity of code
Interpolation is only worthwhile compared with bisection if division is sufficiently computationally efficient compared with the saving in additional multiplication/addition operations to calculate the additional bisection steps. At some point this trade-off may change. On a system where division is not fully accelerated in hardware, a division could be as computationally intense as say five bisections, in which case only one or two interpolations may be worthwhile before switching to subsequent bisections, for example.

Going back to your original formula; it is not in the form I would have intuitively expected, but is equivalent, and your arrangement maps well to define the restriction of movement of the estimation region boundaries. The computation is essentially equivalent to standard interpolation; Notably the division could also be avoided for the case where the interpolation is limited, since the tests:
-LowerY<=0.14*(UpperY-LowerY) OR -LowerY>=0.86*(UpperY-LowerY)
could be performed and the division only calculated if they were true.

The generalised formula as:
next x = LowerX + (UpperX”“LowerX) × Max[alpha, Min[(1-alpha), LowerY/(LowerY”“UpperY) ]]
does seem useful, where determination of suitable alpha for different applications is possible.

Seems like a good approach for this application provided division isn't too costly (in which case bisection wins). I would guess you could usefully select a slightly higher value than 1/7 (anything up to 1/4 potentially) which would speed some cases up and others down. Not sure where the optimum value would be, likely data dependent.

Re: Software that makes placemats

Posted: 16:50 Wed 19 Jun 2013
by jdaw1
PhilW wrote:1/1000000 or approx. 1/(2^20).
PostScript uses single precision, with a 23-bit mantissa.
PhilW wrote:Seems like a good approach for this application provided division isn't too costly
(LowerX + UpperX) ÷ 2 still has s division. Maybe the hardware tests for and accelerates by-two division. Probably not.
PhilW wrote:Not sure where the optimum value would be, likely data dependent.
Constant, 1/7, determined by crude experiment in Excel.

Re: Software that makes placemats

Posted: 17:20 Wed 19 Jun 2013
by PhilW
jdaw1 wrote:
PhilW wrote:Seems like a good approach for this application provided division isn't too costly
(LowerX + UpperX) ÷ 2 still has s division.
(LowerX + UpperX) * 0.5 does not have a division in floating point calculation and would be the expected implementation to reduce computation for that case;
(LowerX + UpperX) >> 1 would be similarly used for the integer case (though an integer /2 might well be compiler optimised to that shift).

Re: Software that makes placemats

Posted: 14:58 Thu 20 Jun 2013
by jdaw1
jdaw1 wrote:
PhilW wrote:n.b. I assume direct calculation would not be appropriate?
I thought about that, and decided that it would be too much grief.
Alas, it is required. Damn.

Have you recommended (pseudo)code that will convert c0!c4 to four roots?

Re: Software that makes placemats

Posted: 15:40 Thu 20 Jun 2013
by PhilW
jdaw1 wrote:Have you recommended (pseudo)code that will convert c0!c4 to four roots?
No, sorry; I would use the formulae from there, and implement calculation of discriminant,p,q,S,Q,x (where c4..c0 are a..e and is only valid for non-zero a).

The only optimisations I can see would be potential detection of non-real solutions to allow you to ignore part of the calculation, but not much in the general case.

The fortran implementation here might help?

Re: Software that makes placemats

Posted: 16:53 Thu 20 Jun 2013
by jdaw1
PostScript lacks complex types, and lacks derived types. Ick. I’ll try harder to avoid this.

Re: Software that makes placemats

Posted: 00:15 Fri 21 Jun 2013
by jdaw1
/DiamondsPlus: done.
Image

Best fitting of seven glasses on A4.

Software that makes placemats

Posted: 00:42 Fri 21 Jun 2013
by djewesbury
jdaw1 wrote:/DiamondsPlus: done.
Image

Best fittin of seven glasses on A4.
Is the mathematician's solution always the drinker's?

Re: Software that makes placemats

Posted: 08:54 Fri 21 Jun 2013
by jdaw1
djewesbury wrote:Is the mathematician's solution always the drinker's?
We once had two sets of seven, Warre and Fonseca, and a room with space constraints. /DiamondsPlus would have helped.

However, it is less elegant than some other arrangements. So should be used only when needed only when packing seven onto A4 or US Letter = 8½″×11″, or ten onto US Legal 8½″×14″.

I thought it a mite harsh of you to add a spelling error to the quote of my correctly spelt words.

Software that makes placemats

Posted: 11:46 Fri 21 Jun 2013
by djewesbury
jdaw1 wrote: I thought it a mite harsh of you to add a spelling error to the quote of my correctly spelt words.
Oops! How did I manage that I wonder..
Your Warre/Fonseca placemats are things of beauty. How did the traced line connecting the glasses appear? And what is the correct way of including an external graphic (the makers' brands)?

Re: Software that makes placemats

Posted: 21:56 Fri 21 Jun 2013
by jdaw1
Made by PhilW, not by me.

Re: Software that makes placemats

Posted: 14:46 Sat 22 Jun 2013
by djewesbury
There appears to be a problem with /Array .
The example code in the manual:
[ /Array /Positions [0 2] [2 2 3 2] [4 2 3 2] [6 2] [0 1] [3 1] [6 1] [0 0] [3 0] [6 0] ] ,
when used in a test script, results in an automatic substitution of /TopRow for the intended pattern.
The same thing happens with other examples: /TopRow subsitution every time.
There appears to a be a syntactical error.
The code appears to use /PositionsStart, the manual /Positions .

Re: Software that makes placemats

Posted: 21:11 Sat 22 Jun 2013
by PhilW
djewesbury wrote:How did the traced line connecting the glasses appear?
These were my custom use of the feature "MakePathConnectingGlasses" within Julian's postscript.
djewesbury wrote:And what is the correct way of including an external graphic (the makers' brands)?
This is not a standard feature. I took a couple of photographs, converted them to postscript format using an imaging program, and then cut/pasted their use with function prototypes into Julian's program, using an online postscript manual as a reference.

Re: Software that makes placemats

Posted: 22:32 Sat 22 Jun 2013
by djewesbury
PhilW wrote: This is not a standard feature. I took a couple of photographs, converted them to postscript format using an imaging program, and then cut/pasted their use with function prototypes into Julian's program, using an online postscript manual as a reference.
Right... I can live without that for now then, given that I got a migraine trying to get the /Array packing style to work...

Re: Software that makes placemats

Posted: 08:36 Sun 23 Jun 2013
by jdaw1
DJ: did the emails help? Please suggest words for the manual.

Re: Software that makes placemats

Posted: 08:38 Sun 23 Jun 2013
by jdaw1
PhilW wrote:
jdaw1 wrote:Desiderata include robustness, speed, and simplicity of code
Interpolation is only worthwhile compared with bisection if division is sufficiently computationally efficient compared with the saving in additional multiplication/addition operations to calculate the additional bisection steps. At some point this trade-off may change. On a system where division is not fully accelerated in hardware, a division could be as computationally intense as say five bisections, in which case only one or two interpolations may be worthwhile before switching to subsequent bisections, for example.
It has taken me a while to realise what this misses. The assumption is that computation of f[] is slow compared to the modest computation done by the calling routine. Calling f[] half as many times is assumed to be much much more important. So the extra division of interpolation is de minimus.

Re: Software that makes placemats

Posted: 09:08 Sun 23 Jun 2013
by jdaw1
djewesbury wrote:The code appears to use /PositionsStart, the manual /Positions .
Very sorry. Damn. Will be fixed today.

Software that makes placemats

Posted: 10:51 Sun 23 Jun 2013
by djewesbury
jdaw1 wrote:DJ: did the emails help? Please suggest words for the manual.
jdaw1 wrote:
djewesbury wrote:The code appears to use /PositionsStart, the manual /Positions .
Very sorry. Damn. Will be fixed today.
It's all working fantastically now. The manual only needs a clearer eg for the /Array syntax, perhaps a block of code with all parameters correctly expressed for the basic (x,y) function.

Emails were v helpful. Thanks!

Re: Software that makes placemats

Posted: 00:12 Mon 24 Jun 2013
by jdaw1
jdaw1, in the thread entitled [i]The Port of Belfast, Tuesday 25th June, 6pm, The Galley[/i], wrote:
[url=http://www.theportforum.com/viewtopic.php?p=58189#p58189]Here[/url] djewesbury wrote:The placemats, which only required 14 major drafts and several ".1.1.1" updates... I'm learning...
And one bug fix in the code :oops:, and one new feature. No trouble at all.

Re: Software that makes placemats

Posted: 11:05 Fri 28 Jun 2013
by jdaw1
A note to self, following the 1966 Horizontal on Thu 27 June 2013: if RAYC is printing, he prints glasses sheets to card, and TN sheets to paper. So they should be separated, perhaps by
  • /PageOrderingNonDecanterLabelGlasses {[ GlassesOnSheets length {-1} repeat ]} def

Re: Software that makes placemats

Posted: 11:29 Fri 28 Jun 2013
by RAYC
Alternatively they can simply be printed to paper, if preferred. I marginally favour card, but the difference is very slight.

Re: Software that makes placemats

Posted: 11:45 Fri 28 Jun 2013
by jdaw1
Broader question: what should be the default? That leads to a question about our behaviour.

What do we do when setting up a tasting?
1. Arrange glasses sheets on table, simultaneously putting TN sheets with the glasses sheets.
2. Arrange glasses sheets, and when that is all done, then put the TN sheets with the glasses sheets.
Yesterday we did the second.

If we do #1, the the ideal ordering is the current one:
  • Person 1
    • Glasses
    • TNs
  • Person 2
    • Glasses
    • TNs
  • Person 3
    • Glasses
    • TNs
  • Person 4
    • Glasses
    • TNs
  • !
If we do #2, the ideal ordering is
  • Glasses
    • Person 1
    • Person 2
    • Person 3
    • Person 4
    • !
  • TNs
    • Person 1
    • Person 2
    • Person 3
    • Person 4
    • !
I’m half-preferring acknowledging that we tend to do the second behaviour, so should have the second arrangement. Thoughts?

(FYI, the programming effort is about zero the switch would be very easy to implement.)