[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 431bdbb 01/11: Do not include PETE in any hea
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 431bdbb 01/11: Do not include PETE in any header except "et_vector.hpp" |
Date: |
Tue, 16 Feb 2021 13:06:21 -0500 (EST) |
branch: master
commit 431bdbb026193cc6b4c4d87ba6fdd49f5f8309e0
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Do not include PETE in any header except "et_vector.hpp"
PETE should be included only by deliberate intention because of its
size. No other header included it except 'math_functions.hpp', which
used it only for assign_midpoint<>(); removed it thence, and rewrote
that function template to use the C++ standard library. Including PETE
in a header was worse than making a single statement more verbose.
---
gpt_test.cpp | 1 +
irc7702_tables_test.cpp | 1 +
math_functions.hpp | 13 +++++++++----
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/gpt_test.cpp b/gpt_test.cpp
index 6750852..00b30b6 100644
--- a/gpt_test.cpp
+++ b/gpt_test.cpp
@@ -26,6 +26,7 @@
#include "assert_lmi.hpp"
#include "cso_table.hpp"
+#include "et_vector.hpp"
#include "irc7702_interest.hpp" // iglp(), igsp()
#include "materially_equal.hpp"
#include "math_functions.hpp"
diff --git a/irc7702_tables_test.cpp b/irc7702_tables_test.cpp
index 6a92e11..da8175e 100644
--- a/irc7702_tables_test.cpp
+++ b/irc7702_tables_test.cpp
@@ -23,6 +23,7 @@
#include "irc7702_tables.hpp"
+#include "et_vector.hpp"
#include "materially_equal.hpp"
#include "math_functions.hpp"
#include "ssize_lmi.hpp"
diff --git a/math_functions.hpp b/math_functions.hpp
index 059f4b7..a33a0ea 100644
--- a/math_functions.hpp
+++ b/math_functions.hpp
@@ -25,10 +25,9 @@
#include "config.hpp"
#include "assert_lmi.hpp"
-#include "et_vector.hpp"
-#include <algorithm> // max(), min()
-#include <cmath> // expm1(), log1p()
+#include <algorithm> // max(), min(), transform()
+#include <cmath> // expm1l(), log1pl()
#include <limits>
#include <stdexcept>
#include <type_traits>
@@ -347,7 +346,13 @@ void assign_midpoint
{
LMI_ASSERT(in_0.size() == in_1.size());
out.resize(in_0.size());
- assign(out, apply_binary(mean<T>(), in_0, in_1));
+ std::transform
+ (in_0.begin()
+ ,in_0.end()
+ ,in_1.begin()
+ ,out.begin()
+ ,mean<double>()
+ );
}
#endif // math_functions_hpp
- [lmi-commits] [lmi] master updated (3143a30 -> c90e25a), Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master b321588 05/11: Demonstrate PETE assignment to std::vector, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master bcec152 08/11: Amend PETE header and footer for generated files, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 2741732 07/11: Break a makefile dependency cycle, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 2a92707 04/11: Move a comment block that will soon become a test, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 431bdbb 01/11: Do not include PETE in any header except "et_vector.hpp",
Greg Chicares <=
- [lmi-commits] [lmi] master acac3ad 03/11: Accommodate 21st-century hardware, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master c90e25a 11/11: No longer invoke std::operator==() explicitly for vectors, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 2844ba0 10/11: Suppress PETE's operator==() for std::vector, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 7f3f834 06/11: Rewrite '*clean*' targets, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 088d2a8 09/11: Regenerate PETE, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 38d5ece 02/11: Further improve physical design, Greg Chicares, 2021/02/16