lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 2ceaa93 3/7: Change order of loans and withdr


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 2ceaa93 3/7: Change order of loans and withdrawals in class modal_outlay
Date: Sun, 23 Aug 2020 18:00:51 -0400 (EDT)

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

    Change order of loans and withdrawals in class modal_outlay
    
    Class rounding_rules declares its members roughly in monthiversary-
    processing order, where withdrawals precede loans. Class modal_outlay
    will soon apply rounding rules; following the same order in both classes
    will make mistakes less likely.
---
 outlay.cpp | 10 +++++-----
 outlay.hpp | 14 +++++++-------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/outlay.cpp b/outlay.cpp
index 66e32e3..6da84d8 100644
--- a/outlay.cpp
+++ b/outlay.cpp
@@ -36,8 +36,8 @@ modal_outlay::modal_outlay(yare_input const& yi)
     ,ee_premium_modes_     {yi.PaymentMode}
     ,er_modal_premiums_    {yi.CorporationPayment}
     ,er_premium_modes_     {yi.CorporationPaymentMode}
-    ,new_cash_loans_       {yi.NewLoan}
     ,withdrawals_          {yi.Withdrawal}
+    ,new_cash_loans_       {yi.NewLoan}
 {
 }
 
@@ -57,12 +57,12 @@ void 
modal_outlay::set_er_modal_premiums(std::vector<double> const& z)
     er_modal_premiums_ = z;
 }
 
-void modal_outlay::set_new_cash_loans(double z, int from_year, int to_year)
+void modal_outlay::set_withdrawals(double z, int from_year, int to_year)
 {
-    std::fill_n(new_cash_loans_.begin() + from_year, to_year - from_year, z);
+    std::fill_n(withdrawals_.begin() + from_year, to_year - from_year, z);
 }
 
-void modal_outlay::set_withdrawals(double z, int from_year, int to_year)
+void modal_outlay::set_new_cash_loans(double z, int from_year, int to_year)
 {
-    std::fill_n(withdrawals_.begin() + from_year, to_year - from_year, z);
+    std::fill_n(new_cash_loans_.begin() + from_year, to_year - from_year, z);
 }
diff --git a/outlay.hpp b/outlay.hpp
index 66860b0..9e42803 100644
--- a/outlay.hpp
+++ b/outlay.hpp
@@ -45,8 +45,8 @@ class modal_outlay final
     std::vector<mcenum_mode> const& ee_premium_modes     () const;
     std::vector<double>      const& er_modal_premiums    () const;
     std::vector<mcenum_mode> const& er_premium_modes     () const;
-    std::vector<double>      const& new_cash_loans       () const;
     std::vector<double>      const& withdrawals          () const;
+    std::vector<double>      const& new_cash_loans       () const;
 
   private:
     modal_outlay(modal_outlay const&) = delete;
@@ -59,8 +59,8 @@ class modal_outlay final
     void set_ee_modal_premiums(double z, int from_year, int to_year);
     void set_er_modal_premiums(double z, int from_year, int to_year);
     void set_er_modal_premiums(std::vector<double> const&);
-    void set_new_cash_loans   (double z, int from_year, int to_year);
     void set_withdrawals      (double z, int from_year, int to_year);
+    void set_new_cash_loans   (double z, int from_year, int to_year);
 
     double                   dumpin_;
     double                   external_1035_amount_;
@@ -69,8 +69,8 @@ class modal_outlay final
     std::vector<mcenum_mode> ee_premium_modes_;
     std::vector<double>      er_modal_premiums_;
     std::vector<mcenum_mode> er_premium_modes_;
-    std::vector<double>      new_cash_loans_;
     std::vector<double>      withdrawals_;
+    std::vector<double>      new_cash_loans_;
 };
 
 inline double modal_outlay::dumpin() const
@@ -108,14 +108,14 @@ inline std::vector<mcenum_mode> const& 
modal_outlay::er_premium_modes() const
     return er_premium_modes_;
 }
 
-inline std::vector<double> const& modal_outlay::new_cash_loans() const
+inline std::vector<double> const& modal_outlay::withdrawals() const
 {
-    return new_cash_loans_;
+    return withdrawals_;
 }
 
-inline std::vector<double> const& modal_outlay::withdrawals() const
+inline std::vector<double> const& modal_outlay::new_cash_loans() const
 {
-    return withdrawals_;
+    return new_cash_loans_;
 }
 
 inline void modal_outlay::set_external_1035_amount(double z)



reply via email to

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