[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)
- [lmi-commits] [lmi] master updated (d9955ce -> b83bdf0), Greg Chicares, 2020/08/23
- [lmi-commits] [lmi] master 9cbb041 1/7: Prefer 'git switch' to optionless 'git checkout', Greg Chicares, 2020/08/23
- [lmi-commits] [lmi] master 9553083 4/7: Prepare to round in class modal_outlay, Greg Chicares, 2020/08/23
- [lmi-commits] [lmi] master a92e5c3 5/7: Overload rounding function objects to handle vectors, Greg Chicares, 2020/08/23
- [lmi-commits] [lmi] master 7ac2bd0 2/7: Say why a header is included, Greg Chicares, 2020/08/23
- [lmi-commits] [lmi] master 2ceaa93 3/7: Change order of loans and withdrawals in class modal_outlay,
Greg Chicares <=
- [lmi-commits] [lmi] master b83bdf0 7/7: Improve concinnity, Greg Chicares, 2020/08/23
- [lmi-commits] [lmi] master 5afe8dc 6/7: Round values in class modal_outlay, Greg Chicares, 2020/08/23