[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] valyuta/004 c9b4787 13/17: Make two member functions
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] valyuta/004 c9b4787 13/17: Make two member functions almost identical |
Date: |
Thu, 24 Dec 2020 10:23:53 -0500 (EST) |
branch: valyuta/004
commit c9b478778657be5b61e8468e24a29e48f41940f4
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Make two member functions almost identical
Made BasicValues::GPTServerInit() and BasicValues::Init() identical
except for BasicValues::InitialTargetPremium, which will next be
handled separately.
Originally, the "server" variant avoided initializing several things
that it does not need, to make it faster. The server never having been
deployed, its speed is not important enough to justify maintaining two
nearly identical initialization functions. Such maintenance always risks
unwitting divergence; for example, code to throw an exception in
jurisdictions that have not approved a product ought to have been added
to the server (and is, hereby).
Similarly, it seems apparent that '.gpt' input has never been tested for
products that offer a "supplemental" specified amount.
---
ihs_basicval.cpp | 40 ++++++++++++++++++++++++++++++++--------
1 file changed, 32 insertions(+), 8 deletions(-)
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index 52da286..8b21e6c 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -148,6 +148,10 @@ BasicValues::BasicValues
int const db_len = database().length();
yare_input_.SpecifiedAmount .assign(db_len, a_FaceAmount);
+ // The tax law recognizes no "supplemental" amount, but
+ // class death_benefits expects SupplementalAmount to have
+ // the same length as SpecifiedAmount.
+ yare_input_.SupplementalAmount .assign(db_len, 0.0);
// Cf. effective_dbopt_7702()
mce_dbopt const z
@@ -282,6 +286,22 @@ void BasicValues::GPTServerInit()
StateOfJurisdiction_ = yare_input_.StateOfJurisdiction;
PremiumTaxState_ = yare_input_.PremiumTaxState ;
+ if
+ ( !database().query<bool>(DB_StateApproved)
+ && !global_settings::instance().ash_nazg()
+ && !global_settings::instance().regression_testing()
+ )
+ {
+ alarum()
+ << "Product "
+ << yare_input_.ProductName
+ << " not approved in state "
+ << mc_str(GetStateOfJurisdiction())
+ << "."
+ << LMI_FLUSH
+ ;
+ }
+
IssueAge = yare_input_.IssueAge;
RetAge = yare_input_.RetirementAge;
LMI_ASSERT(IssueAge < 100);
@@ -321,8 +341,8 @@ void BasicValues::GPTServerInit()
<< LMI_FLUSH
;
}
-// lingo_.reset(new lingo(AddDataDir(product().datum("LingoFilename"))));
-// FundData_.reset(new FundData(AddDataDir(product().datum("FundFilename"))));
+ lingo_ =
lingo::read_via_cache(AddDataDir(product().datum("LingoFilename")));
+ FundData_.reset(new FundData(AddDataDir(product().datum("FundFilename"))));
RoundingRules_.reset
(new rounding_rules(AddDataDir(product().datum("RoundingFilename")))
);
@@ -335,20 +355,24 @@ void BasicValues::GPTServerInit()
,StratifiedCharges_->minimum_tiered_spread_for_7702()
);
- // Requires database.
- MortalityRates_.reset(new MortalityRates (*this)); // Used by certain
target-premium calculations.
-// InterestRates_ .reset(new InterestRates (*this));
-// DeathBfts_ .reset(new death_benefits (GetLength(), yare_input_,
round_specamt_));
+ // Multilife contracts will need a vector of mortality-rate objects.
+
+ // Mortality and interest rates require database and rounding.
+ // Interest rates require tiered data and 7702 spread.
+ MortalityRates_.reset(new MortalityRates (*this));
+ InterestRates_ .reset(new InterestRates (*this));
+ DeathBfts_ .reset(new death_benefits (GetLength(), yare_input_,
round_specamt_));
// Outlay requires only input and rounding; it might someday use
// interest rates.
-// Outlay_ .reset(new modal_outlay (yare_input_,
round_gross_premium_, round_withdrawal_, round_loan_));
+ Outlay_ .reset(new modal_outlay (yare_input_,
round_gross_premium_, round_withdrawal_, round_loan_));
PremiumTax_ .reset(new premium_tax (PremiumTaxState_,
StateOfDomicile_, yare_input_.AmortizePremiumLoad, database(),
*StratifiedCharges_));
Loads_ .reset(new Loads (*this));
SetMaxSurvivalDur();
-// set_partial_mortality(); // Not needed here.
+ set_partial_mortality();
Init7702();
+ Init7702A();
}
//============================================================================
- [lmi-commits] [lmi] valyuta/004 updated (7192b10 -> cf62b44), Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 3c157f7 03/17: Report a range error when a range error is caught [336], Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 2504286 04/17: Resolve some marked defects [333], Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 eeacb20 07/17: Prepare to move a block of code, Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 f16fd3a 02/17: Expunge an unwanted exception class, Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 5ceb54d 01/17: Move an enum, Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 5ac107f 09/17: Refactor, Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 c9b4787 13/17: Make two member functions almost identical,
Greg Chicares <=
- [lmi-commits] [lmi] valyuta/004 cf62b44 17/17: Record timings, Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 9d9c2b7 06/17: Assert "length" is same in two classes, Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 67f1c54 08/17: Move a block of code as just announced, Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 80a18db 14/17: Make two member functions identical, Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 89ea7c8 15/17: Change a member's datatype, Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 c6f6f55 16/17: Expunge a duplicative member function [325], Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 17275df 05/17: Resolve some more marked defects [326], Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 72dcc19 11/17: Note an apparent defect [327], Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 4a21c32 10/17: Move another block of code, Greg Chicares, 2020/12/24
- [lmi-commits] [lmi] valyuta/004 47b096d 12/17: Fix defect introduced 20100723T2339Z: wrong jurisdiction [326], Greg Chicares, 2020/12/24