[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 5d0c118 10/10: Refactor
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 5d0c118 10/10: Refactor |
Date: |
Thu, 11 Mar 2021 21:12:36 -0500 (EST) |
branch: master
commit 5d0c118e76610c5e1389697049623f6f227c9bfb
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Refactor
Finished separating initialization of data members from calculations
that use their values.
---
i7702.cpp | 61 +++++++++++++++++++++++++++++++------------------------------
1 file changed, 31 insertions(+), 30 deletions(-)
diff --git a/i7702.cpp b/i7702.cpp
index 6f18b7f..288d80e 100644
--- a/i7702.cpp
+++ b/i7702.cpp
@@ -268,36 +268,6 @@ i7702::i7702
database.query_into(DB_CurrAcctValLoad, Dsep_);
Dsep_ += stratified.minimum_tiered_sepacct_load_for_7702();
- std::vector<double> guar_int = Bgen_;
- assign(guar_int, Max(guar_int, Bflr_));
-
- gross_.assign(database.length(), 0.0);
- assign
- (gross_
- ,apply_unary
- (i_upper_12_over_12_from_i<double>()
- ,Max(A0_, guar_int)
- )
- );
-
- net_glp_.assign(database.length(), 0.0);
- assign
- (net_glp_
- ,apply_unary
- (i_upper_12_over_12_from_i<double>()
- ,Max(A0_, guar_int) - Dsep_
- )
- );
-
- net_gsp_.assign(database.length(), 0.0);
- assign
- (net_gsp_
- ,apply_unary
- (i_upper_12_over_12_from_i<double>()
- ,Max(0.02 + A0_, guar_int) - Dsep_
- )
- );
-
// Eckley's 'ig' represents the interest rate by which death
// benefit is discounted for calculating mortality charges,
// as seen in his formula (1):
@@ -335,6 +305,37 @@ i7702::i7702
constexpr double tolerance {0.0000001};
LMI_ASSERT(no_naar_discount || mm < tolerance);
+ // Here begin the dubious calculations that will be replaced.
+ std::vector<double> guar_int = Bgen_;
+ assign(guar_int, Max(guar_int, Bflr_));
+
+ gross_.assign(database.length(), 0.0);
+ assign
+ (gross_
+ ,apply_unary
+ (i_upper_12_over_12_from_i<double>()
+ ,Max(A0_, guar_int)
+ )
+ );
+
+ net_glp_.assign(database.length(), 0.0);
+ assign
+ (net_glp_
+ ,apply_unary
+ (i_upper_12_over_12_from_i<double>()
+ ,Max(A0_, guar_int) - Dsep_
+ )
+ );
+
+ net_gsp_.assign(database.length(), 0.0);
+ assign
+ (net_gsp_
+ ,apply_unary
+ (i_upper_12_over_12_from_i<double>()
+ ,Max(0.02 + A0_, guar_int) - Dsep_
+ )
+ );
+
std::vector<double> operative_naar_discount(database.length(), 0.0);
operative_naar_discount +=
Max
- [lmi-commits] [lmi] master updated (986ba37 -> 5d0c118), Greg Chicares, 2021/03/11
- [lmi-commits] [lmi] master eb0729d 01/10: Refine documentation, Greg Chicares, 2021/03/11
- [lmi-commits] [lmi] master 8b21622 05/10: Conditionalize sepacct load consistently, Greg Chicares, 2021/03/11
- [lmi-commits] [lmi] master 7b84df9 08/10: Move a commentary paragraph, Greg Chicares, 2021/03/11
- [lmi-commits] [lmi] master 55b91b6 09/10: Discuss monthly vs. annual rates, for ig especially, Greg Chicares, 2021/03/11
- [lmi-commits] [lmi] master 469b63a 02/10: Expunge needless data members, Greg Chicares, 2021/03/11
- [lmi-commits] [lmi] master 3b39e4e 03/10: Add new i7702 members, Greg Chicares, 2021/03/11
- [lmi-commits] [lmi] master 11041f1 06/10: Simplify an idiosyncratic gnarl, Greg Chicares, 2021/03/11
- [lmi-commits] [lmi] master 5d0c118 10/10: Refactor,
Greg Chicares <=
- [lmi-commits] [lmi] master e9a5eb0 04/10: Replace some local variables with members, Greg Chicares, 2021/03/11
- [lmi-commits] [lmi] master 0d51b6d 07/10: Refactor, Greg Chicares, 2021/03/11