Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Motion to finalise interval literals





Dear All, 

I strongly believe text2interval and interval2text must be present. Below is an example from my experience. 

On Jun 14, 2013, at 3:45 AM, John Pryce wrote:

Jürgen, Vincent, P1788

On 2013-06-07 20:02:05 +0200, Jürgen Wolff von Gudenberg wrote:
P1788
as already stated in one of my last emails, I think interval
literals should not be required. They will involve languages and
compilers, and ,hence, augment the workload in dissemination the of
standard.

so change the "shall" into a "should"
On reflection I disagree with this. Interval literals have nothing to do with any language -- unless it chooses to incorporate them into its syntax. They are the notation that interval2text() outputs, and text2interval() inputs.

These are library functions.
- interval2text() will standardise, for intervals, something like fprintf() in C, or formatted write() in Fortran. It should also (IMO) offer a default output of intervals like C's fprintf() with %g specifier, or cout in C++, or write(*,*) in Fortran.
- text2interval() is a basis for a standardised free-format input of intervals, on the lines of read(*,*) in Fortran.

Someone only needs to write a these *once*, probably in C. They will then probably be used by various languages & implementations.

1788 doesn't propose, currently, to specify interval2text()'s conversion specifiers, so whoever does it first will probably make a de facto standard for those. Compare %f, %e, etc. in C's printf(), which is used with minor changes in about 30 widely used languages, says Wikipedia.


VNODE-LP compiles with either of PROFIL or FILIB++. There is at least one project where VNODE-LP compiles with GAOL. 
I have a small set of inline wrapper functions that call corresponding functions from these packages, kind of my own standardized interface.

Here is an example of the default output of FILIB++ (when VNODE-LP is compiled with it):
(Mac OS X, gcc)

Solution enclosure at t = [20, 20]
   [14.3, 14.3]
   [9.58, 9.58]
   [39, 39]

(It does not even enclose the result, but this is not the point here)

Keeping everything the same, here is the default output of PROFIL:

Solution enclosure at t = [20,20]
  14.30[38149456391501,44730143845645]
  9.5[785917646141598,801357351014219]
  39.038[2370903559348,4120430934303]]


With precision set to 15 digits, the output of FILIB is 

Solution enclosure at t = [20, 20]
   [14.303809944719, 14.3044812922969]
   [9.57858002618343, 9.58015516025692]
   [39.0382357508818, 39.0384142497156]


It is *really annoying* when two package produce output in different formats, when 
everything else is the same. 

About text2interval. PROFIL has had this feature for some time. As far as I know, it is relatively recent 
that FILIB++ can convert a string to an interval. Until that time, my string2interval function had to 
print a message that this feature is not supported yet in FILIB. 

So, I want to be able to compile VNODE-LP and my application program with any interval package 
and get the same format of the results. 
(It would be ideal to plug any interval package and obtain exactly the same results, but this is difficult to achieve.)

In general, any package built on top of an interval package A should work the same way as built on top of 
interval package B. If my application program has to use different functions for conversions, then I have to write 
my wrapper functions to get around this. I simply want to "press the button" and see the same no matter what 
package I use. 

I hope the above is convincing that having standardized conversion functions is a must.

Regards,
Ned Nedialkov