lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Question about "Numeric summary" logic


From: Vadim Zeitlin
Subject: Re: [lmi] Question about "Numeric summary" logic
Date: Mon, 31 Jul 2017 01:27:38 +0200

On Sun, 30 Jul 2017 22:51:37 +0000 Greg Chicares <address@hidden> wrote:

...
GC> >  This also answers my (unasked) question about why neither CZ nor GZ were
GC> > available in my (regular) illustration. I ran into this when trying to
GC> > translate the max-lapse-year definition from XSLT to C++: in XSLT it's
GC> > defined as max(LapseYear_Current, LapseYear_Guaranteed,
GC> > LapseYear_CurrentZero, LapseYear_GuaranteedZero) and relies on the fact
GC> > that the undefined variables evaluate to 0 -- while in C++ trying to 
access
GC> > them results in an exception.
GC> 
GC> Now that you point it out, this is the "get-max-lapse-year" template,
GC> which is called only through the trivial "max-lapse-year-text" template,
GC> which is used only to set "max-lapse-year", which I guess is used to
GC> decide how many rows to print in each table.

 Yes, indeed, I just simplified by omitting complications peculiar to XSLT.

GC> It's wrong because it omits
GC> "MF". It's also wrong because it omits "CH" and "GH": even though the
GC> "*H" bases are no longer used in practice, they might someday be wanted
GC> again. (In general, when a feature becomes obsolete, we should either
GC> eradicate it or maintain it, and the decision here was not to eradicate
GC> this.) It's also wrong because it's unnecessary--because we have this:
GC> 
GC> int Ledger::GetMaxLength() const
GC> ...
GC>     // For all ledgers in the map, find the longest duration that must
GC>     // be printed (until the last one lapses).
GC> ...
GC>     for(auto const& i : l_map_rep)
GC>         {
GC>         max_length = std::max(max_length, i.second.LapseYear);
GC>         }
GC> 
GC> which iterates implicitly over exactly the bases actually used.

 Thanks, I did see this but assumed that I shouldn't use it because of this
comment in xml_ledger_io.cpp:

        // GetMaxLength() is max *composite* length.
        //    int max_length = GetMaxLength();
            double MaxDuration = ledger_invariant_->EndtAge - 
ledger_invariant_->Age;

Now I realize that I should have asked about why does XSLT use
max-lapse-year instead of MaxDuration and whether MaxDuration as computed
here can be different from GetMaxLength() for non-composite illustrations
(I haven't looked at what happens in the composite case yet...).


GC> >  I still wonder about something here: wouldn't LapseYear_Current always be
GC> > at least as big as LapseYear_Guaranteed? Knowing that the former
GC> > assumptions are at least as good, it would seem that the policy can only
GC> > lapse later because of them, or am I missing something?
GC> 
GC> https://www.google.com/search?q=theory+practice+joke

 No need to search for this one, it's in my L1 cache.

GC> I've seen this apparently-reasonable assumption violated.
[...snip violation example...]

 Thanks, even though I guessed it could be something like this, it's nice
to have this definitely answered.

VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]