[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 074ed9e 07/14: Eliminate some local variables
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 074ed9e 07/14: Eliminate some local variables |
Date: |
Thu, 18 Feb 2021 12:03:41 -0500 (EST) |
branch: master
commit 074ed9ea25b38e436d22cbf56335902acda7828e
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Eliminate some local variables
---
ihs_irc7702.cpp | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/ihs_irc7702.cpp b/ihs_irc7702.cpp
index e8c67ee..fb7b540 100644
--- a/ihs_irc7702.cpp
+++ b/ihs_irc7702.cpp
@@ -516,7 +516,6 @@ void Irc7702::InitCorridor()
/// to use them.
///
/// TAXATION !! Combine assertions and move to top for clarity.
-/// TAXATION !! Combine locals like ann_chg_pol and mly_chg_pol.
/// TAXATION !! Eliminate aliasing references.
/// TAXATION !! Rename '[46]Pct' to 'g[ls]p'.
/// TAXATION !! Write a utility function for rotate-partial_sum_rotate.
@@ -532,19 +531,15 @@ void Irc7702::InitPvVectors(EIOBasis const& a_EIOBasis)
// Present value of charges per policy
- std::vector<double> ann_chg_pol(Length);
LMI_ASSERT(Length == lmi::ssize(AnnChgPol));
LMI_ASSERT(Length == lmi::ssize(comm_fns.aD()));
- ann_chg_pol += AnnChgPol * comm_fns.aD();
- std::vector<double> mly_chg_pol(Length);
LMI_ASSERT(Length == lmi::ssize(MlyChgPol));
LMI_ASSERT(Length <= lmi::ssize(comm_fns.kD()));
- mly_chg_pol += MlyChgPol * comm_fns.kD();
std::vector<double>& chg_pol = PvChgPol[a_EIOBasis];
chg_pol.resize(Length);
- chg_pol += ann_chg_pol + mly_chg_pol;
+ chg_pol += AnnChgPol * comm_fns.aD() + MlyChgPol * comm_fns.kD();
// ET !! This is just APL written verbosely in a funny C++ syntax.
// Perhaps we could hope for an expression-template library to do this:
- [lmi-commits] [lmi] master updated (f0a4840 -> 7dd2680), Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master 2e84c56 03/14: Rearrange comments, Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master 5623352 06/14: Remove pointless assertions, Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master 140c288 05/14: Remove dead code [304], Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master 3edb81f 12/14: Add and use a backward-summation function template, Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master bff8d5b 04/14: Note a possible defect, Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master 387657b 08/14: Move assertions upward, Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master 074ed9e 07/14: Eliminate some local variables,
Greg Chicares <=
- [lmi-commits] [lmi] master 18a189a 11/14: Remove duplicate assertions, Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master cef60d4 09/14: Strengthen assertions, Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master 9c580de 01/14: Improve documentation, Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master 80fce3e 02/14: Rename a member function for clarity, Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master 837c225 10/14: Sort assertions, Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master 0b76da4 13/14: Say why certain headers are included, Greg Chicares, 2021/02/18
- [lmi-commits] [lmi] master 7dd2680 14/14: Add and use a forward-summation function template, Greg Chicares, 2021/02/18