lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master ef22f46 07/25: Deduplicate [295]


From: Greg Chicares
Subject: [lmi-commits] [lmi] master ef22f46 07/25: Deduplicate [295]
Date: Wed, 24 Feb 2021 19:00:51 -0500 (EST)

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

    Deduplicate [295]
    
    Removed a commented-out block that was a copy of a 2005 version of the
    "i7702" block just marked for transplantation out of class BasicValues:
    the lmi equivalent of "junk DNA".
    
    (The marked defects had already been addressed in the original.)
---
 interest_rates.cpp | 125 -----------------------------------------------------
 1 file changed, 125 deletions(-)

diff --git a/interest_rates.cpp b/interest_rates.cpp
index 9421e84..f8c5581 100644
--- a/interest_rates.cpp
+++ b/interest_rates.cpp
@@ -956,128 +956,3 @@ void InterestRates::Initialize7702Rates()
     MlyGlpRate_ -= SpreadFor7702_;
     assign(MlyGlpRate_, apply_unary(i_upper_12_over_12_from_i<double>(), 
MlyGlpRate_));
 }
-
-#if 0
-// TODO ?? Here's the implementation actually used, elsewhere--it needs work.
-// Eventually this should be rewritten. It still lives here because it
-// really belongs here, not in class BasicValues. TAXATION !! Resolve this.
-
-{
-    // Monthly guar net int for 7702 is
-    //   greater of {iglp(), igsp()} and annual guar int rate
-    //   less 7702 spread
-    // TAXATION !! Resolve this:
-    // TODO ?? We need to subtract other things too, e.g. comp (sometimes)...
-    //   transformed to monthly (simple subtraction?).
-    // These interest rates belong here because they're used by
-    // DCV calculations in the account value class as well as
-    // GPT calculations in the 7702 class.
-
-    std::vector<double> guar_int = GenAcctGrossRate_[mce_gen_guar];
-/*
-    switch(LoanRateType_)
-        {
-        case mce_fixed_loan_rate:
-            {
-            // ET !! std::vector<double> guar_loan_rate = PublishedLoanRate_ - 
RegLoanSpread_[mce_gen_guar];
-            // ET !! guar_int = max(guar_int, RegLoanSpread_[mce_gen_guar]);
-            // TODO ?? TAXATION !! But that looks incorrect when written 
clearly!
-            // Perhaps this old comment:
-            //   APL: guar_int gets guar_int max gross_loan_rate - 
guar_loan_spread
-            // suggests the actual intention.
-
-            // TODO ?? TAXATION !! Need loan rates for 7702 whenever loans are 
allowed.
-            std::vector<double> gross_loan_rate = PublishedLoanRate_;
-            // TODO ?? TAXATION !! Should at least assert that preferred <= 
regular spread.
-            std::vector<double> guar_loan_spread = 
RegLoanSpread_[mce_gen_guar];
-            std::vector<double> guar_loan_rate(Length);
-            std::transform
-                (gross_loan_rate.begin()
-                ,gross_loan_rate.end()
-                ,guar_loan_spread.begin()
-                ,guar_loan_rate.begin()
-                ,std::minus<double>()
-                );
-            std::transform
-                (guar_int.begin()
-                ,guar_int.end()
-                ,guar_loan_spread.begin()
-                ,guar_int.begin()
-                ,greater_of<double>()
-                );
-            }
-            break;
-        case mce_variable_loan_rate:
-            {
-            // do nothing
-            }
-            break;
-        default:
-            {
-            alarum() << "No " << LoanRateType_ << " case." << LMI_FLUSH;
-            }
-        }
-*/
-
-    // ET !! Mly7702iGlp = i_upper_12_over_12_from_i(max(iglp(), guar_int) - 
SpreadFor7702_);
-    Mly7702iGlp.assign(Length, iglp());
-    std::transform
-        (guar_int.begin()
-        ,guar_int.end()
-        ,Mly7702iGlp.begin()
-        ,Mly7702iGlp.begin()
-        ,greater_of<double>()
-        );
-    std::transform
-        (Mly7702iGlp.begin()
-        ,Mly7702iGlp.end()
-        ,SpreadFor7702_.begin()
-        ,Mly7702iGlp.begin()
-        ,std::minus<double>()
-        );
-    std::transform
-        (Mly7702iGlp.begin()
-        ,Mly7702iGlp.end()
-        ,Mly7702iGlp.begin()
-        ,i_upper_12_over_12_from_i<double>()
-        );
-
-    // ET !! Mly7702iGlp = i_upper_12_over_12_from_i(max(igsp(), guar_int) - 
SpreadFor7702_);
-    Mly7702iGsp.assign(Length, igsp());
-    std::transform
-        (guar_int.begin()
-        ,guar_int.end()
-        ,Mly7702iGsp.begin()
-        ,Mly7702iGsp.begin()
-        ,greater_of<double>()
-        );
-    std::transform
-        (Mly7702iGsp.begin()
-        ,Mly7702iGsp.end()
-        ,SpreadFor7702_.begin()
-        ,Mly7702iGsp.begin()
-        ,std::minus<double>()
-        );
-    std::transform
-        (Mly7702iGsp.begin()
-        ,Mly7702iGsp.end()
-        ,Mly7702iGsp.begin()
-        ,i_upper_12_over_12_from_i<double>()
-        );
-
-    // ET !! Mly7702ig = -1.0 + 1.0 / DBDiscountRate;
-    Mly7702ig = DBDiscountRate;
-    std::transform
-        (Mly7702ig.begin()
-        ,Mly7702ig.end()
-        ,Mly7702ig.begin()
-        ,[](double x) { return 1.0 / x; }
-        );
-    std::transform
-        (Mly7702ig.begin()
-        ,Mly7702ig.end()
-        ,Mly7702ig.begin()
-        ,[](double x) { return x - 1.0; }
-        );
-}
-#endif // 0



reply via email to

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