lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 140c288 05/14: Remove dead code [304]


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 140c288 05/14: Remove dead code [304]
Date: Thu, 18 Feb 2021 12:03:40 -0500 (EST)

branch: master
commit 140c28829a95107bb5147d68b0f7130433984fbe
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Remove dead code [304]
    
    See '7702.html' [14.3/5]. This difference:
      (LoadTgt[t] − LoadExc[t]) × aD[t]
    had been calculated and stored, but never used. It would have been used
    in Irc7702::CalculatePremium(), where it's just a scalar subtraction,
    which is not so costly as to justify calculating and storing the
    difference for every possible index t.
---
 ihs_irc7702.cpp | 17 -----------------
 ihs_irc7702.hpp |  3 ---
 2 files changed, 20 deletions(-)

diff --git a/ihs_irc7702.cpp b/ihs_irc7702.cpp
index 76bc385..1211d66 100644
--- a/ihs_irc7702.cpp
+++ b/ihs_irc7702.cpp
@@ -520,7 +520,6 @@ void Irc7702::InitCorridor()
 /// TAXATION !! Eliminate aliasing references.
 /// TAXATION !! Rename '[46]Pct' to 'g[ls]p'.
 /// TAXATION !! Write a utility function for rotate-partial_sum_rotate.
-/// TAXATION !! Eliminate PvLoadDiff{Sgl,Lvl} if unneeded.
 /// TAXATION !! Add unit tests.
 
 void Irc7702::InitPvVectors(EIOBasis const& a_EIOBasis)
@@ -624,22 +623,6 @@ void Irc7702::InitPvVectors(EIOBasis const& a_EIOBasis)
     std::reverse(npf_lvl_exc.begin(), npf_lvl_exc.end());
     std::partial_sum(npf_lvl_exc.begin(), npf_lvl_exc.end(), 
npf_lvl_exc.begin());
     std::reverse(npf_lvl_exc.begin(), npf_lvl_exc.end());
-
-    // Present value of target premium load - excess premium load
-
-    std::vector<double>& diff_sgl = PvLoadDiffSgl[a_EIOBasis];
-    diff_sgl.resize(Length);
-    LMI_ASSERT(Length == lmi::ssize(diff_sgl));
-    LMI_ASSERT(Length == lmi::ssize(npf_sgl_exc));
-    LMI_ASSERT(Length == lmi::ssize(npf_sgl_tgt));
-    diff_sgl += npf_sgl_exc - npf_sgl_tgt;
-
-    std::vector<double>& diff_lvl = PvLoadDiffLvl[a_EIOBasis];
-    diff_lvl.resize(Length);
-    LMI_ASSERT(Length == lmi::ssize(diff_lvl));
-    std::reverse(diff_lvl.begin(), diff_lvl.end());
-    std::partial_sum(diff_lvl.begin(), diff_lvl.end(), diff_lvl.begin());
-    std::reverse(diff_lvl.begin(), diff_lvl.end());
 }
 
 /// For illustrations, we can't initialize everything in the ctor.
diff --git a/ihs_irc7702.hpp b/ihs_irc7702.hpp
index c6d5ef3..5f2d1a1 100644
--- a/ihs_irc7702.hpp
+++ b/ihs_irc7702.hpp
@@ -256,9 +256,6 @@ class Irc7702 final
     std::vector<double>        PvNpfLvlTgt     [NumIOBases];
     std::vector<double>        PvNpfSglExc     [NumIOBases];
     std::vector<double>        PvNpfLvlExc     [NumIOBases];
-// TODO ?? TAXATION !! Not necessary?
-    std::vector<double>        PvLoadDiffSgl   [NumIOBases];
-    std::vector<double>        PvLoadDiffLvl   [NumIOBases];
 };
 
 // TAXATION !! Update this, and move it to a better location.



reply via email to

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