[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 6c4deff 4/7: Use 7702 statutory i from databa
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 6c4deff 4/7: Use 7702 statutory i from database |
Date: |
Mon, 22 Feb 2021 07:46:30 -0500 (EST) |
branch: master
commit 6c4deff404b8d8b72503e6ffa9837b93bb5456dc
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Use 7702 statutory i from database
---
ihs_basicval.cpp | 8 +++++---
interest_rates.cpp | 5 +++--
interest_rates.hpp | 1 +
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index 34fe93b..c166b95 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -41,7 +41,6 @@
#include "ihs_irc7702a.hpp"
#include "input.hpp"
#include "interest_rates.hpp"
-#include "irc7702_interest.hpp" // iglp(), igsp()
#include "lingo.hpp"
#include "loads.hpp"
#include "math_functions.hpp"
@@ -430,6 +429,9 @@ void BasicValues::Init7702()
// DCV calculations in the account value class as well as
// GPT calculations in the 7702 class.
+ std::vector<double> statutory7702i;
+ database().query_into(DB_AnnInterestRate7702, statutory7702i);
+
std::vector<double> guar_int;
database().query_into(DB_GuarInt, guar_int);
// TAXATION !! Rework this. The intention is to make the 7702 interest
@@ -481,7 +483,7 @@ void BasicValues::Init7702()
(Mly7702iGlp
,apply_unary
(i_upper_12_over_12_from_i<double>()
- ,apply_binary(greater_of<double>(), iglp(), guar_int) -
SpreadFor7702_
+ ,apply_binary(greater_of<double>(), statutory7702i, guar_int) -
SpreadFor7702_
)
);
@@ -490,7 +492,7 @@ void BasicValues::Init7702()
(Mly7702iGsp
,apply_unary
(i_upper_12_over_12_from_i<double>()
- ,apply_binary(greater_of<double>(), igsp(), guar_int) -
SpreadFor7702_
+ ,apply_binary(greater_of<double>(), 0.02 + statutory7702i,
guar_int) - SpreadFor7702_
)
);
diff --git a/interest_rates.cpp b/interest_rates.cpp
index 0a96535..9421e84 100644
--- a/interest_rates.cpp
+++ b/interest_rates.cpp
@@ -29,7 +29,6 @@
#include "database.hpp"
#include "dbnames.hpp"
#include "et_vector.hpp"
-#include "irc7702_interest.hpp" // iglp(), igsp()
#include "math_functions.hpp" // assign_midpoint()
#include "miscellany.hpp" // each_equal()
#include "ssize_lmi.hpp"
@@ -391,6 +390,8 @@ void InterestRates::Initialize(BasicValues const& v)
);
}
+ v.database().query_into(DB_AnnInterestRate7702, Statutory7702i_);
+
// Convert interest rates and test.
InitializeGeneralAccountRates();
@@ -950,7 +951,7 @@ void InterestRates::Initialize7702Rates()
// _without_ assigning from Zero_ first; but it's not.
// See test_pete_assignment() in 'expression_template_0_test.cpp'.
MlyGlpRate_ = Zero_;
- assign(MlyGlpRate_, apply_binary(greater_of<double>(), iglp(),
annual_guar_rate));
+ assign(MlyGlpRate_, apply_binary(greater_of<double>(), Statutory7702i_,
annual_guar_rate));
LMI_ASSERT(MlyGlpRate_.size() == SpreadFor7702_.size());
MlyGlpRate_ -= SpreadFor7702_;
assign(MlyGlpRate_, apply_unary(i_upper_12_over_12_from_i<double>(),
MlyGlpRate_));
diff --git a/interest_rates.hpp b/interest_rates.hpp
index 3a96e05..fdbe8fd 100644
--- a/interest_rates.hpp
+++ b/interest_rates.hpp
@@ -293,6 +293,7 @@ class InterestRates
std::vector<double> PostHoneymoonSpread_;
// GLP and GSP interest rates. DCV uses the GLP rate.
+ std::vector<double> Statutory7702i_;
std::vector<double> SpreadFor7702_;
std::vector<double> MlyGlpRate_;
std::vector<double> MlyGspRate_;
- [lmi-commits] [lmi] master updated (dc99d2e -> a62fbec), Greg Chicares, 2021/02/22
- [lmi-commits] [lmi] master d162b18 1/7: Improve documentation, Greg Chicares, 2021/02/22
- [lmi-commits] [lmi] master e143602 3/7: Hard-code 7702 i for another unit test, Greg Chicares, 2021/02/22
- [lmi-commits] [lmi] master 6c4deff 4/7: Use 7702 statutory i from database,
Greg Chicares <=
- [lmi-commits] [lmi] master 7b18d1d 2/7: Hard-code 7702 i for a unit test, Greg Chicares, 2021/02/22
- [lmi-commits] [lmi] master b7b20c4 5/7: Resurrect ancient code for 7702 (loan) interest, Greg Chicares, 2021/02/22
- [lmi-commits] [lmi] master 1a3d3e6 6/7: Fix defect introduced 20050114T1947Z: used the wrong variable [301], Greg Chicares, 2021/02/22
- [lmi-commits] [lmi] master a62fbec 7/7: Loan rate affects 7702 if loans allowed, not only if elected, Greg Chicares, 2021/02/22