lmi-commits
[Top][All Lists]
Advanced

[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
         );



reply via email to

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