[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 123b572 01/14: Avoid reading back from ledger
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 123b572 01/14: Avoid reading back from ledger in class AccountValue |
Date: |
Sun, 6 Sep 2020 07:50:36 -0400 (EDT) |
branch: master
commit 123b572f0ae1322d367350ce62116914bbc244e8
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Avoid reading back from ledger in class AccountValue
Strive instead to treat the ledger as write-only, and read state from
members of class AccountValue (or its base class). There was never any
valid reason for reading issue and endowment age back from the ledger
when those values are already available as local state.
---
ihs_avdebug.cpp | 2 +-
ihs_avsolve.cpp | 10 +++-------
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/ihs_avdebug.cpp b/ihs_avdebug.cpp
index 425d8d0..e59bae3 100644
--- a/ihs_avdebug.cpp
+++ b/ihs_avdebug.cpp
@@ -310,7 +310,7 @@ void AccountValue::DebugPrint()
SetMonthlyDetail(eYear ,Year);
SetMonthlyDetail(eMonth ,Month);
SetMonthlyDetail(eBasis ,mc_str(RunBasis_));
- SetMonthlyDetail(eAge ,InvariantValues().Age + Year);
+ SetMonthlyDetail(eAge ,BasicValues::GetIssueAge() + Year);
// Initial values at beginning of run, reflecting inforce if applicable.
if(InforceYear == Year && InforceMonth == Month)
diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index d291757..4e04d98 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -278,11 +278,7 @@ double AccountValue::SolveGuarPremium()
// Store original er premiums for later restoration.
std::vector<double> stored = Outlay_->er_modal_premiums();
// Zero out er premiums and solve for ee premiums only.
- Outlay_->set_er_modal_premiums
- (0.0
- ,0
- ,static_cast<int>(InvariantValues().EndtAge - InvariantValues().Age)
- );
+ Outlay_->set_er_modal_premiums(0.0, 0, BasicValues::GetLength());
bool temp_solving = Solving;
Solving = true;
@@ -292,10 +288,10 @@ double AccountValue::SolveGuarPremium()
double guar_premium = Solve
(mce_solve_ee_prem
,0
- ,static_cast<int>(InvariantValues().EndtAge - InvariantValues().Age)
+ ,BasicValues::GetLength()
,mce_solve_for_endt
,0.0
- ,static_cast<int>(InvariantValues().EndtAge - InvariantValues().Age)
+ ,BasicValues::GetLength()
,mce_gen_guar
,mce_sep_full
);
- [lmi-commits] [lmi] master updated (c4f84b4 -> 59860e3), Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 123b572 01/14: Avoid reading back from ledger in class AccountValue,
Greg Chicares <=
- [lmi-commits] [lmi] master b4eb422 02/14: Rename a variable, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 14c2920 07/14: Factor out partial-mortality calculations, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 338d589 10/14: Call set_partial_mortality() OAOO, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 915e4ef 03/14: Avoid reading back from ledger in class AccountValue, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 540e3ca 04/14: Simplify, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 73d5f2b 06/14: Refactor for terseness, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 2bcf8d3 08/14: Move commentary outside function body, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 7b9b0cf 11/14: Resolve a marked defect [339], Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 3cbd888 12/14: Improve documentation, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 3ff6e18 13/14: Add and use trivial const accessors, Greg Chicares, 2020/09/06