[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 40218dc 03/14: Factor out commutation-functio
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 40218dc 03/14: Factor out commutation-function speed tests |
Date: |
Mon, 5 Apr 2021 18:26:45 -0400 (EDT) |
branch: master
commit 40218dc873f0588ae0fc284c137027d24ef86d23
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Factor out commutation-function speed tests
---
commutation_functions_test.cpp | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/commutation_functions_test.cpp b/commutation_functions_test.cpp
index 77ebea7..076ae89 100644
--- a/commutation_functions_test.cpp
+++ b/commutation_functions_test.cpp
@@ -579,7 +579,7 @@ void OLCommFnsTest()
Test_1954_1958_IET_3pct();
}
-/// Comprehensive UL example with speed tests.
+/// Comprehensive UL example.
///
/// Calculate year-by-year option B account value for a no-load UL
/// contract; compare to results imported from a spreadsheet, with
@@ -674,6 +674,19 @@ void Test_1980_CSO_Male_ANB()
<< " " << std::setw(21) << worst_discrepancy << " worst_discrepancy\n"
<< std::endl
;
+}
+
+void assay_speed()
+{
+ std::vector<double> q(sample_q());
+ assign(q, apply_binary(coi_rate_from_q<double>(), q, 1.0 / 11.0));
+
+ std::vector<double>ic(q.size(), i_upper_12_over_12_from_i<double>()(0.07));
+ std::vector<double>ig(q.size(), i_upper_12_over_12_from_i<double>()(0.03));
+
+ ULCommFns ulcf(q, ic, ig, mce_option2_for_7702, mce_monthly);
+
+ std::vector<double> reserve(q.size());
std::cout
<< " Speed test: generate ordinary-life commutation functions\n "
@@ -732,6 +745,7 @@ int test_main(int, char*[])
OLCommFnsTest();
Test_1980_CSO_Male_ANB();
TestLimits();
+ assay_speed();
return EXIT_SUCCESS;
}
- [lmi-commits] [lmi] master updated (dd6ee0a -> 8aa09b9), Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master 40218dc 03/14: Factor out commutation-function speed tests,
Greg Chicares <=
- [lmi-commits] [lmi] master b8f43e0 06/14: Transpose several unit-test functions, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master e6ed669 01/14: Test guideline premium calculations with more complications, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master b1eecea 02/14: Stabilize unit-test timing, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master 28cabc2 04/14: Prefer lambdas to std::bind(), Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master 61a04eb 08/14: Make commutation functions default constructible, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master df25463 12/14: Avoid operator new, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master b657767 13/14: Remove conditionals that serve no further purpose, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master 23fe71f 11/14: Do away with an undesirable smart pointer [290], Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master 485e19b 07/14: Favor the rule of zero, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master 762056e 05/14: Prefer PETE's operator<<=() to assign(), Greg Chicares, 2021/04/05