[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
- [lmi-commits] [lmi] master 447290e 04/25: Move an assertion; rewrite and duplicate its comment, (continued)
- [lmi-commits] [lmi] master 447290e 04/25: Move an assertion; rewrite and duplicate its comment, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master 5dbf2e3 06/25: Validate class i7702, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master 2f74b41 25/25: Improve encapsulation of 7702 "spread", Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master 3a06237 08/25: Deduplicate, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master 3c341a6 10/25: Remove more dead code, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master e6f9397 14/25: Obtain DCV interest rate from i7702 object, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master d17fda2 20/25: Bring bogosity into focus before eradicating it, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master bbe2802 21/25: Reduce bogosity ever so slightly, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master 8c27092 24/25: Use correct interest rates for '.mec' input, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master 7cf8204 02/25: Add a 7702 interest-rate class, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master ef22f46 07/25: Deduplicate [295],
Greg Chicares <=
- [lmi-commits] [lmi] master 6bde573 12/25: Make certain shared_ptr members const, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master ee8667d 13/25: Turn a local variable into a member, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master 9f5c39d 15/25: Expunge disused accessors, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master 8db602c 16/25: Turn several members into local variables, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master 87af00c 19/25: Support a further "refactoring", Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master ad762d4 18/25: Remove dead code, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master ec7093b 22/25: Eradicate global iglp() and igsp(), Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master bf5f2ba 23/25: Eradicate bogosity, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master 84ea017 11/25: Localize 7702 spread in class BasicValues, Greg Chicares, 2021/02/24
- [lmi-commits] [lmi] master 3a395bc 17/25: Use new rather than old code, Greg Chicares, 2021/02/24