Re: Standing on the Giants shoulders... :-)

Discussion in 'C++' started by kwikius, May 30, 2008.

  1. kwikius

    kwikius Guest

    On May 30, 10:18 am, James Kanze <> wrote:
    > On May 30, 6:00 am, "kwikius" <> wrote:
    >
    > > quan
    > >http://tinyurl.com/5lxb3s
    > > std
    > >http://tinyurl.com/6k9b7f
    > > hmm... something smells a bit whiffy ..

    >
    > Sorry, but I don't follow you. What's the relationship between
    > the two?


    The duration type is pretty much of an exact replica of the quan
    quantity.

    But.....

    From the text the impression one gets is that the design is basically
    that of Jeff Garland boost date time lib, with some vague reference
    to Walter Brown, presumably SI units library and implementation by
    Howard Hinnant.

    I believe Walter Brown used compile time rational numbers [1] in
    SIUnits, as did Barton & Nackman, but they only used compile time
    rationals for dimensional analysis, not conversion factors (meter to
    millimeters etc).


    The original use of compile time rationals for the units was AFAIK my
    pqs library, the forerunner of my quan library in the above link.
    (Originally pqs used 2 separate compile time integers, but it was
    Brandon Forehand that pointed out that they were in fact acting as a
    rational number, and pqs was subsequently modified accordingly).


    In fact Mr Garland did use conversion factors in his boost date time
    lib, but used runtime scaling (in an explicit ctor at least in
    boost_1.33.0), all values were kept internally in milliseconds in a
    base class.

    Compared with quans method this approach has both a poor range and
    loss of precision due to the initial division.


    As far as Mr Brown is concerned, he appears until very recently to
    have found *problematic*, treating quantities with different
    conversion factors as different types (rather than using one type and
    doing a runtime scaling, the SIUnits approach).

    See wg21 n2526 section 4.1, 4.2 4.3 etc. (Quite a funny read
    actually :))

    My guess is that he has been swung around, because in use it is
    obvious that the approach used by quan is much superior... the
    approach in second link. sorry SIUnits.

    I spent a large amount of time working out and arguing for the
    approach these guys seem to be taking the credit for between 2003-2007
    on boost.org amidst a large amount of naive criticism, and where Mr
    Garland is a moderator so IOW he must be familiar with my work. Mr
    Garland eventually succeeded in initiating a flame war on boost.org
    during middle of which he informed me that he was singling my posts
    out for moderation, akin to tieing someones hands behind their back
    and slapping them about. At which point I left.


    .... hence the source of the smell.

    regards
    Andy Little




    note 1
    (Unfortunately I wrongly attributed the origin of compile time
    rational to Matthias Schabel in quan-0_2_0), but compile time
    rationals appears AFAIK in SIUnits and a physical quantities lib,
    ebf_units by Eric Ford around 2003, shortly before my earliset pqs
    libray, predecessor to quan.)
     
    kwikius, May 30, 2008
    #1
    1. Advertising

  2. kwikius

    Kai-Uwe Bux Guest

    James Kanze wrote:

    > On Jun 1, 4:01 pm, kwikius <> wrote:
    >> On Jun 1, 10:34 am, James Kanze <> wrote:

    >
    >> > On Jun 1, 4:40 am, kwikius <> wrote:

    >
    >> <...>

    >
    >> > What brotherhood is that? I'm certainly not involved in any way
    >> > with Boost (although I like a lot---but not everything---of what
    >> > they do). And in the standards committee, my activity is mostly
    >> > in the language section, and except for threading and garbage
    >> > collection, exclusively involved with improving existing
    >> > elements. Of the authors, I've meant Howard once, Walter and I
    >> > are old sparring partners (because I rather think that D is a
    >> > waste of time), and I've never even heard of the other two.

    >
    >> err.. hmm... Walter E. Brown, Fermilab, author of SIUnits ...
    >> not Walter Bright, C++ innovator and author of D, nor even
    >> Walter Banks.. extender of C, Bytecraft.

    >
    > Oops.
    >
    >> > > I actually now just find this whole business very amusing,
    >> > > well ... and somewhat sad. The truth is the truth and well
    >> > > documented over a period of some years for any one that cares
    >> > > to look.

    >
    >> > You mean like the proposals for Units in Algol.

    >
    >> That sounds like a lot of fun :) ... but Without a link to
    >> the details its FUD and handwaving, so... Care to provide a
    >> link to these proposals?

    >
    > I'm afraid the Web wasn't used much back in the early days of
    > Algol.


    An ordinary reference like Author, Year, Title, ... would be cool, too.
    Then, one would have a chance to find it in a library.


    > [...]
    >> Now there seem to be peple trying to slyly give the impression
    >> that its all their idea,

    >
    > Actually, you seem to be the only one claiming its their idea.
    > All of the others seem to consider it as more or less usual
    > practice.


    I wonder, whether it is all that clear what "it" is. I don't think that Mr
    Little claims to be the first to use converions factors to deal with
    different units. There must be something about the internals of his quan
    library that he thinks is originall, and while I am not sure what _it_ is,
    I suspect it might have escaped you too. Sometimes, thinks look
    superficially similar to something well known and the cute trick and twist,
    which is actually new, is somewhat hidden.

    A guess from elsethread is that "compile time rationals" (whatever that is)
    might be the new idea of Mr Little. I am not familiar with Algol, but I
    wonder whether it supports templates to the extend necessary to realize
    compile time rationals (which probably would have to entail computing GCDs
    at compile time).


    Best

    Kai-Uwe Bux
     
    Kai-Uwe Bux, Jun 1, 2008
    #2
    1. Advertising

  3. kwikius

    kwikius Guest

    On Jun 1, 9:39 pm, Kai-Uwe Bux <> wrote:

    <...>

    > I wonder, whether it is all that clear what "it" is. I don't think that Mr
    > Little claims to be the first to use converions factors to deal with
    > different units. There must be something about the internals of his quan
    > library that he thinks is originall, and while I am not sure what _it_ is,


    At the end of the following post of mine on clc++ is some code showing
    a highly simplified version of the techniques in quan, this just deals
    with simple integer exponents, but gives a flavour...

    http://tinyurl.com/5qvnzt

    .... but quan actually uses rationals ( a rational exponent and a
    rational multiplier per unit (standards proposal can only deal with
    multiplier part) where you can have much more flexibility in scaling
    values between quantities in different units
    Note that the version used in quan-0_2_0 also performs optimised calcs
    between scaling factors during compile time to do as much of the calc
    in conversions as possible at compiletime not runtime:

    http://tinyurl.com/6nuuet


    This is the same approach used in the standard proposal, except that
    quan can deal with all types of quantities(including non si ones), not
    just time, multiply add, divide, pow, etc with huge range, speed and
    accuracy. (AFAICS "duration" type in standards proposal only uses a
    multiplier, not exponent too as in quan... range in quan is huge
    compared, with no cost in runtime space, speed or accuracy... highly
    desirable for engineering, aerospace etc, etc.)

    regards
    Andy Little
     
    kwikius, Jun 2, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brent White
    Replies:
    2
    Views:
    400
    =?Utf-8?B?QnJlbnQgV2hpdGU=?=
    Jul 18, 2007
  2. kwikius
    Replies:
    1
    Views:
    275
    James Kanze
    May 30, 2008
  3. James Kanze
    Replies:
    11
    Views:
    648
    Noah Roberts
    Jun 2, 2008
  4. Brent Roman
    Replies:
    6
    Views:
    126
    Brent Roman
    Dec 27, 2004
  5. Chris Pearl
    Replies:
    6
    Views:
    135
    David Vallner
    Dec 6, 2006
Loading...

Share This Page