[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] An experimental change for withdrawal solves
From: |
Greg Chicares |
Subject: |
Re: [lmi] An experimental change for withdrawal solves |
Date: |
Fri, 20 Feb 2009 03:21:43 +0000 |
User-agent: |
Thunderbird 2.0.0.19 (Windows/20081209) |
On 2009-02-18 18:55Z, Greg Chicares wrote:
[...]
> Please test the patch below [...]
I've found an objection to it.
What's sauce for the goose, is sauce for the gander. If the patch
in my 2009-02-18T18:55Z email was good, then the patch below [1]
would seem to be better, because it treats loans and withdrawals
similarly.
However, this newer patch causes a regression error. Cell number
seventy-eight of testdeck 'sample.cns' (which we haven't yet
published, but should) solves for withdrawal to basis, then loan.
Without this patch, level income extends for fifty-five years, to
maturity, as requested; with this patch, income stops after the
fifty-third year.
The second patch is wrong. Therefore, either the first patch is
also wrong, for reasons unknown--or loan ullage is different in
kind from withdrawal ullage, and I can't say why. I just don't
understand this well enough to apply either patch.
---------
[1] "the patch below"
The last hunk sidesteps a different and gratuitous regression
error. We should eradicate 'ExcessLoan', which causes this error.
I'd left it alone temporarily only to keep system-test results
from changing, but then I had to write a workaround below, and
now I'm wasting more time explaining why.
Ceterum censeo 'ExcessLoan' esse delendam.
Index: ihs_avmly.cpp
===================================================================
RCS file: /sources/lmi/lmi/ihs_avmly.cpp,v
retrieving revision 1.120
diff -U 3 -r1.120 ihs_avmly.cpp
--- ihs_avmly.cpp 16 Feb 2009 10:27:28 -0000 1.120
+++ ihs_avmly.cpp 20 Feb 2009 02:04:11 -0000
@@ -2766,6 +2766,11 @@
if(Solving)
{
withdrawal_ullage_[Year] = std::max(0.0, RequestedWD - MaxWD);
+ // If capacity is zero, ullage must be zero.
+ if(0.0 == MaxWD)
+ {
+ withdrawal_ullage_[Year] = 0.0;
+ }
}
if(Solving || mce_run_gen_curr_sep_full == RunBasis_)
@@ -3120,6 +3125,11 @@
{
ActualLoan = RequestedLoan;
loan_ullage_[Year] = std::max(0.0, RequestedLoan - max_loan_increment);
+ // If capacity is zero, ullage must be zero.
+ if(0.0 == max_loan_increment)
+ {
+ loan_ullage_[Year] = 0.0;
+ }
}
else
{
@@ -3134,7 +3144,7 @@
VariantValues().ExcessLoan[Year] = std::min(0.0, max_loan_increment -
RequestedLoan);
if(Solving)
{
- LMI_ASSERT(VariantValues().ExcessLoan[Year] == -loan_ullage_[Year]);
+ LMI_ASSERT(0.0 == loan_ullage_[Year] ||
VariantValues().ExcessLoan[Year] == -loan_ullage_[Year]);
}
}
- [lmi] An experimental change for withdrawal solves, Greg Chicares, 2009/02/01
- Re: [lmi] An experimental change for withdrawal solves, Greg Chicares, 2009/02/06
- RE: [lmi] An experimental change for withdrawal solves, Boutin, Wendy, 2009/02/07
- Re: [lmi] An experimental change for withdrawal solves, Greg Chicares, 2009/02/08
- Re: [lmi] An experimental change for withdrawal solves, Greg Chicares, 2009/02/09
- RE: [lmi] An experimental change for withdrawal solves, Murphy, Kimberly, 2009/02/17
- RE: [lmi] An experimental change for withdrawal solves, Murphy, Kimberly, 2009/02/18
- Re: [lmi] An experimental change for withdrawal solves, Greg Chicares, 2009/02/18
- Re: [lmi] An experimental change for withdrawal solves, Greg Chicares, 2009/02/18
- Re: [lmi] An experimental change for withdrawal solves,
Greg Chicares <=
Re: [lmi] An experimental change for withdrawal solves, Greg Chicares, 2009/02/06