lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] valyuta/005 f9c5764 2/5: Resolve even more gratuitou


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/005 f9c5764 2/5: Resolve even more gratuitous incompatibilities with master
Date: Thu, 28 Jan 2021 17:53:34 -0500 (EST)

branch: valyuta/005
commit f9c57644d58e2d1c598ee0b8ca5aa21e2779fb63
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Resolve even more gratuitous incompatibilities with master
---
 GNUmakefile            |  2 +-
 antediluvian_stubs.cpp |  4 ++--
 database.cpp           |  2 +-
 ihs_avdebug.cpp        |  1 -
 ihs_avmly.cpp          | 42 ++++++++++++++++++++++--------------------
 ihs_avsolve.cpp        |  1 -
 ihs_basicval.cpp       | 15 ++-------------
 outlay.cpp             |  8 ++++----
 verify_products.cpp    | 28 ++++++++++++++--------------
 9 files changed, 46 insertions(+), 57 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 4733c17..f08c70e 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -142,7 +142,7 @@ localbindir     := 
$(prefix)/local/$(LMI_COMPILER)_$(LMI_TRIPLET)/bin
 locallibdir     := $(prefix)/local/$(LMI_COMPILER)_$(LMI_TRIPLET)/lib
 localincludedir := $(prefix)/local/include
 test_dir        := $(prefix)/test
-touchstone_dir  := $(prefix)/test_valyuta
+touchstone_dir  := $(prefix)/touchstone
 
 
################################################################################
 
diff --git a/antediluvian_stubs.cpp b/antediluvian_stubs.cpp
index 966515a..4ef3def 100644
--- a/antediluvian_stubs.cpp
+++ b/antediluvian_stubs.cpp
@@ -142,11 +142,11 @@ product_data::product_data()
 product_data::product_data(std::string const&)
 {}
 
-product_data::~product_data() = default;
-
 product_data::product_data(fs::path const&)
 {}
 
+product_data::~product_data() = default;
+
 product_data::product_data(product_data const&)
     :MemberSymbolTable <product_data> {}
 {}
diff --git a/database.cpp b/database.cpp
index 2837adc..6cecf32 100644
--- a/database.cpp
+++ b/database.cpp
@@ -192,7 +192,7 @@ void product_database::initialize(std::string const& 
product_name)
         }
     else
         {
-        std::string f = filename_from_product_name(product_name);
+        std::string const f = filename_from_product_name(product_name);
         product_data const& p(*product_data::read_via_cache(f));
         std::string const filename(p.datum("DatabaseFilename"));
         LMI_ASSERT(!filename.empty());
diff --git a/ihs_avdebug.cpp b/ihs_avdebug.cpp
index 592391d..20be072 100644
--- a/ihs_avdebug.cpp
+++ b/ihs_avdebug.cpp
@@ -260,7 +260,6 @@ inline void AccountValue::SetMonthlyDetail(int enumerator, 
double d)
 #if defined USE_CURRENCY_CLASS
 inline void AccountValue::SetMonthlyDetail(int enumerator, currency c)
 {
-    // CURRENCY !! Probably value_cast<>(currency) should be specialized.
     DebugRecord[enumerator] = value_cast<std::string>(dblize(c));
 }
 #endif // defined USE_CURRENCY_CLASS
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 70444f7..879e583 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -1903,27 +1903,27 @@ void AccountValue::TxSetRiderDed()
                     (
                     YearsWpRate
                     *   (
-                            CoiCharge
-                        +   MonthsPolicyFees
-                        +   SpecAmtLoad
-                        +   AdbCharge
-                        +   SpouseRiderCharge
-                        +   ChildRiderCharge
-                        +   TermCharge
+                          CoiCharge
+                        + MonthsPolicyFees
+                        + SpecAmtLoad
+                        + AdbCharge
+                        + SpouseRiderCharge
+                        + ChildRiderCharge
+                        + TermCharge
                         )
                     );
                 DcvWpCharge =
                     YearsWpRate
                     *   (
-                            DcvCoiCharge
-                        +   dblize
+                          DcvCoiCharge
+                        + dblize
                             ( MonthsPolicyFees
                             + SpecAmtLoad
                             + AdbCharge
                             + SpouseRiderCharge
                             + ChildRiderCharge
                             )
-                        +   DcvTermCharge
+                        + DcvTermCharge
                         );
                 }
                 break;
@@ -2629,18 +2629,10 @@ void AccountValue::TxTakeWD()
     InvariantValues().NetWD[Year] = dblize(NetWD);
 }
 
-//============================================================================
-// Calculate maximum permissible total loan (not increment).
+/// Calculate maximum permissible total loan (not increment).
+
 void AccountValue::SetMaxLoan()
 {
-    double max_loan =
-          dblize(AVGenAcct + AVSepAcct) * MaxLoanAVMult
-        + dblize(AVRegLn + AVPrfLn)
-        - dblize(anticipated_deduction(MaxLoanDed_))
-        - dblize(std::max(C0, SurrChg()))
-        ;
-
-    // Illustrations generally permit loans only on anniversary.
     double reg_loan_factor = InterestRates_->RegLnDueRate
         (GenBasis_
         ,mce_annual_rate
@@ -2653,6 +2645,7 @@ void AccountValue::SetMaxLoan()
         )
         [Year]
         ;
+    // Illustrations generally permit loans only on anniversary.
     if(0 != Month)
         {
         alarum() << "Off-anniversary loans untested." << LMI_FLUSH;
@@ -2666,6 +2659,15 @@ void AccountValue::SetMaxLoan()
             ;
         }
 
+    double max_loan =
+          (AVGenAcct + AVSepAcct) * MaxLoanAVMult
+        + dblize
+            ( (AVRegLn + AVPrfLn)
+            - anticipated_deduction(MaxLoanDed_)
+            - std::max(C0, SurrChg())
+            )
+        ;
+
     // Withholding anticipated interest, with the adjustment
     //   d upper n, where n is # months remaining in year,
     // attempts to keep the contract from becoming overloaned before
diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index 1f2f18d..79cdb89 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -69,7 +69,6 @@ class SolveHelper
     // or at least to make this function take a 'currency' argument.
     double operator()(double a_CandidateValue)
         {
-// CURRENCY !! Consider using decimal_root<currency> instead of double.
         return dblize(av.SolveTest(av.round_minutiae().c(a_CandidateValue)));
         }
 };
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index 2ff24a5..812fb95 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -66,11 +66,6 @@
 //============================================================================
 BasicValues::BasicValues(Input const& input)
     :yare_input_         (input)
-//  ,product_            (yare_input_.ProductName)
-// Safe to dereference?
-//  ,product_            
(*product_data::read_via_cache(yare_input_.ProductName))
-//  ,product_            
(*product_data::read_via_cache(filename_from_product_name(yare_input_.ProductName)))
-    // Throw if null?
     ,product_            
(product_data::read_via_cache(filename_from_product_name(yare_input_.ProductName)))
     ,database_           (yare_input_)
     ,DefnLifeIns_        {mce_cvat}
@@ -103,10 +98,6 @@ BasicValues::BasicValues
     // TODO ?? Need loan rate type here?
     )
     :yare_input_         (Input{})
-//  ,product_            (a_ProductName)
-// Safe to dereference?
-//  ,product_            
(*product_data::read_via_cache(filename_from_product_name(a_ProductName)))
-    // Throw if null?
     ,product_            
(product_data::read_via_cache(filename_from_product_name(a_ProductName)))
     ,database_
         (a_ProductName
@@ -181,12 +172,10 @@ void BasicValues::Init()
     FundData_          = FundData::read_via_cache
         (AddDataDir(product().datum("FundFilename")));
     RoundingRules_     = rounding_rules::read_via_cache
-        (AddDataDir(product().datum("RoundingFilename"))
-        );
+        (AddDataDir(product().datum("RoundingFilename")));
     SetRoundingFunctors();
     StratifiedCharges_ = stratified_charges::read_via_cache
-        (AddDataDir(product().datum("TierFilename"))
-        );
+        (AddDataDir(product().datum("TierFilename")));
 
     SetPermanentInvariants();
 
diff --git a/outlay.cpp b/outlay.cpp
index c29fe9f..ebbdd47 100644
--- a/outlay.cpp
+++ b/outlay.cpp
@@ -61,25 +61,25 @@ void modal_outlay::set_internal_1035_amount(currency z)
 
 void modal_outlay::set_ee_modal_premiums(currency z, int from_year, int 
to_year)
 {
-    z = round_gross_premium_.c(z); // already rounded?
+    z = round_gross_premium_.c(z); // CURRENCY !! already rounded?
     std::fill_n(ee_modal_premiums_.begin() + from_year, to_year - from_year, 
z);
 }
 
 void modal_outlay::set_er_modal_premiums(currency z, int from_year, int 
to_year)
 {
-    z = round_gross_premium_.c(z); // already rounded?
+    z = round_gross_premium_.c(z); // CURRENCY !! already rounded?
     std::fill_n(er_modal_premiums_.begin() + from_year, to_year - from_year, 
z);
 }
 
 void modal_outlay::set_er_modal_premiums(std::vector<currency> const& z)
 {
     LMI_ASSERT(z.size() == er_modal_premiums_.size());
-    er_modal_premiums_ = round_gross_premium_.c(z); // already rounded?
+    er_modal_premiums_ = round_gross_premium_.c(z); // CURRENCY !! already 
rounded?
 }
 
 void modal_outlay::set_withdrawals(currency z, int from_year, int to_year)
 {
-    z = round_withdrawal_.c(z);
+    z = round_withdrawal_.c(z); // CURRENCY !! already rounded?
     std::fill_n(withdrawals_.begin() + from_year, to_year - from_year, z);
 }
 
diff --git a/verify_products.cpp b/verify_products.cpp
index fea1d66..7417748 100644
--- a/verify_products.cpp
+++ b/verify_products.cpp
@@ -52,21 +52,21 @@ class product_verifier
   private:
     void verify_7702q();
 
-    std::string      const product_name_;
-    std::string      const gender_str_  ;
-    std::string      const smoking_str_ ;
+    std::string      const  product_name_;
+    std::string      const  gender_str_  ;
+    std::string      const  smoking_str_ ;
     product_data     const& p_           ; // or just std::shared_ptr?
-    mcenum_gender    const gender_      ;
-    mcenum_smoking   const smoking_     ;
-    product_database const db0_         ;
-    int              const min_age_     ;
-    product_database const db_          ;
-    mcenum_cso_era   const era_         ;
-    oenum_alb_or_anb const a_b_         ;
-    int              const t_           ;
-    bool             const axis_g_      ;
-    bool             const axis_s_      ;
-    int              const omega_       ;
+    mcenum_gender    const  gender_      ;
+    mcenum_smoking   const  smoking_     ;
+    product_database const  db0_         ;
+    int              const  min_age_     ;
+    product_database const  db_          ;
+    mcenum_cso_era   const  era_         ;
+    oenum_alb_or_anb const  a_b_         ;
+    int              const  t_           ;
+    bool             const  axis_g_      ;
+    bool             const  axis_s_      ;
+    int              const  omega_       ;
 };
 
 product_verifier::product_verifier



reply via email to

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