lmi-commits
[Top][All Lists]
Advanced

[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;
 }



reply via email to

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