[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5349] Refactor for simplicity
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5349] Refactor for simplicity |
Date: |
Sun, 08 Jan 2012 09:11:28 +0000 |
Revision: 5349
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5349
Author: chicares
Date: 2012-01-08 09:11:27 +0000 (Sun, 08 Jan 2012)
Log Message:
-----------
Refactor for simplicity
Modified Paths:
--------------
lmi/trunk/ihs_irc7702.cpp
lmi/trunk/ihs_irc7702.hpp
Modified: lmi/trunk/ihs_irc7702.cpp
===================================================================
--- lmi/trunk/ihs_irc7702.cpp 2012-01-08 02:31:39 UTC (rev 5348)
+++ lmi/trunk/ihs_irc7702.cpp 2012-01-08 09:11:27 UTC (rev 5349)
@@ -696,21 +696,18 @@
std::reverse(diff_lvl.begin(), diff_lvl.end());
}
-// For illustrations, we can't initialize everything in the ctor.
-// For instance, specamt might need to be calculated as a function
-// of GLP or GSP, so it cannot always be known before the GPT
-// calculations are available; and guideline premiums cannot be
-// determined until specamt is set. Therefore, we need these
-// functions to initialize these things after specamt has been set.
-//
+/// For illustrations, we can't initialize everything in the ctor.
+/// For instance, specamt might need to be calculated as a function
+/// of GLP or GSP, so it cannot always be known before the GPT
+/// calculations are available; and guideline premiums cannot be
+/// determined until specamt is set. Therefore, we need this function
+/// to initialize these things after specamt has been set. The server
+/// doesn't use it.
-//============================================================================
-// TODO ?? Is there any reason why dbopt would change?
-// --not used by server
void Irc7702::Initialize7702
(double a_BftAmt
,double a_SpecAmt
- ,mcenum_dbopt_7702 a_DBOpt
+ ,mcenum_dbopt_7702 a_DBOpt // TODO ?? Is there any reason why dbopt would
be changed here?
,double a_TargetPremium
)
{
@@ -718,7 +715,8 @@
LMI_ASSERT(0.0 <= a_TargetPremium);
PresentDBOpt = a_DBOpt;
PriorDBOpt = PresentDBOpt;
- Initialize7702(a_SpecAmt);
+ PresentSpecAmt = a_SpecAmt;
+ PriorSpecAmt = PresentSpecAmt;
PresentBftAmt = a_BftAmt;
PriorBftAmt = PresentBftAmt;
// This:
@@ -748,36 +746,6 @@
}
//============================================================================
-// Designed for use by FindSpecAmt, which treats specamt and bftamt as equal.
-//
-// Soon this function will be eliminated. It is no longer needed by
-// FindSpecAmt. It is called only within the present TU, by the "full"
-// four-argument overload of Initialize7702() into which its useful
-// contents will soon be inserted inline. The zero-initializations
-// will not be so inserted: they are needless for FindSpecAmt, and
-// harmful otherwise because they cause inforce cases to be incorrect.
-void Irc7702::Initialize7702
- (double a_SpecAmt
- ) const
-{
- // TODO ?? Some variables set in the ctor are reset here. Can
- // this be avoided?
-
- PresentSpecAmt = a_SpecAmt;
-
- PriorSpecAmt = PresentSpecAmt;
- LeastBftAmtEver = PresentSpecAmt;
-
- CumGLP = 0.0;
- GptLimit = 0.0;
- CumPmts = 0.0;
- PresentGLP = 0.0;
- PriorGLP = 0.0;
- PresentGSP = 0.0;
- PriorGSP = 0.0;
-}
-
-//============================================================================
void Irc7702::UpdateBOY7702()
{
// Update guideline limits.
Modified: lmi/trunk/ihs_irc7702.hpp
===================================================================
--- lmi/trunk/ihs_irc7702.hpp 2012-01-08 02:31:39 UTC (rev 5348)
+++ lmi/trunk/ihs_irc7702.hpp 2012-01-08 09:11:27 UTC (rev 5349)
@@ -99,7 +99,6 @@
);
~Irc7702();
- // TODO ?? Not sure why we need this non-const variant.
void Initialize7702
(double a_BftAmt
,double a_SpecAmt
@@ -140,9 +139,6 @@
,double a_SpecAmt
,double a_LeastBftAmtEver
) const;
- void Initialize7702
- (double a_SpecAmt
- ) const;
double GetLeastBftAmtEver() const;
double RoundedGLP() const;
double RoundedGSP() const;
@@ -187,9 +183,9 @@
double PresentBftAmt;
double PriorBftAmt;
- mutable double PresentSpecAmt;
- mutable double PriorSpecAmt;
- mutable double LeastBftAmtEver;// Lowest bft amt since issue
date // TODO ?? NOT!
+ double PresentSpecAmt;
+ double PriorSpecAmt;
+ double LeastBftAmtEver;// Lowest bft amt since issue
date // TODO ?? NOT!
mcenum_dbopt_7702 PresentDBOpt; // Present death benefit option
mcenum_dbopt_7702 PriorDBOpt; // Prior death benefit option
@@ -216,13 +212,13 @@
int Length;
- mutable double PresentGLP;
- mutable double PriorGLP;
- mutable double PresentGSP;
- mutable double PriorGSP;
- mutable double CumGLP; // Cumulative GLP
- mutable double GptLimit; // Guideline limit: max(cum GLP,
GSP)
- mutable double CumPmts; // Cumulative payments
+ double PresentGLP;
+ double PriorGLP;
+ double PresentGSP;
+ double PriorGSP;
+ double CumGLP; // Cumulative GLP
+ double GptLimit; // Guideline limit: max(cum GLP,
GSP)
+ double CumPmts; // Cumulative payments
// Commutation functions
// TODO ?? Apparently the original reason for using smart pointers
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5349] Refactor for simplicity,
Greg Chicares <=