lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master b8f43e0 06/14: Transpose several unit-test fu


From: Greg Chicares
Subject: [lmi-commits] [lmi] master b8f43e0 06/14: Transpose several unit-test functions
Date: Mon, 5 Apr 2021 18:26:46 -0400 (EDT)

branch: master
commit b8f43e00b9690f76e1c8c4684f5e1591c740d7c8
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Transpose several unit-test functions
---
 commutation_functions_test.cpp | 98 +++++++++++++++++++++---------------------
 1 file changed, 49 insertions(+), 49 deletions(-)

diff --git a/commutation_functions_test.cpp b/commutation_functions_test.cpp
index fc2ed62..ed8a162 100644
--- a/commutation_functions_test.cpp
+++ b/commutation_functions_test.cpp
@@ -53,42 +53,6 @@ std::vector<double> const& sample_q()
 }
 } // Unnamed namespace.
 
-void mete_olcf
-    (std::vector<double> const& q
-    ,std::vector<double> const& i
-    )
-{
-    for(int j = 0; j < 100; ++j)
-        {
-        volatile auto z = OLCommFns(q, i);
-        }
-}
-
-void mete_ulcf
-    (std::vector<double> const& q
-    ,std::vector<double> const& ic
-    ,std::vector<double> const& ig
-    )
-{
-    for(int j = 0; j < 100; ++j)
-        {
-        volatile auto z = ULCommFns(q, ic, ig, mce_option1_for_7702, 
mce_monthly);
-        }
-}
-
-void mete_reserve
-    (ULCommFns const&     ulcf
-    ,std::vector<double>& reserve
-    )
-{
-    for(int j = 0; j < 100; ++j)
-        {
-        volatile double premium = (10.0 * ulcf.aDomega() + ulcf.kM()[0]) / 
ulcf.aN()[0];
-        reserve <<= premium * ulcf.aD() - ulcf.kC();
-        reserve <<= fwd_sum(reserve) / ulcf.EaD();
-        }
-}
-
 /// Exactly reproduce Table 2 from Eckley's paper.
 ///
 /// Table 2 on pages 25-26 of TSA XXIX uses annual functions, and
@@ -675,6 +639,55 @@ void Test_1980_CSO_Male_ANB()
         ;
 }
 
+/// Test UL commutation functions in extreme cases.
+///
+/// For example, ic and ig can both be zero, and qc may round to zero
+/// for a Frasierized survivorship contract.
+
+void TestLimits()
+{
+    std::vector<double> zero(10, 0.0);
+    ULCommFns ulcf(zero, zero, zero, mce_option1_for_7702, mce_monthly);
+    LMI_TEST_EQUAL(1.0, ulcf.aDomega());
+    LMI_TEST_EQUAL(0.0, ulcf.kC().back());
+}
+
+void mete_olcf
+    (std::vector<double> const& q
+    ,std::vector<double> const& i
+    )
+{
+    for(int j = 0; j < 100; ++j)
+        {
+        volatile auto z = OLCommFns(q, i);
+        }
+}
+
+void mete_ulcf
+    (std::vector<double> const& q
+    ,std::vector<double> const& ic
+    ,std::vector<double> const& ig
+    )
+{
+    for(int j = 0; j < 100; ++j)
+        {
+        volatile auto z = ULCommFns(q, ic, ig, mce_option1_for_7702, 
mce_monthly);
+        }
+}
+
+void mete_reserve
+    (ULCommFns const&     ulcf
+    ,std::vector<double>& reserve
+    )
+{
+    for(int j = 0; j < 100; ++j)
+        {
+        volatile double premium = (10.0 * ulcf.aDomega() + ulcf.kM()[0]) / 
ulcf.aN()[0];
+        reserve <<= premium * ulcf.aD() - ulcf.kC();
+        reserve <<= fwd_sum(reserve) / ulcf.EaD();
+        }
+}
+
 void assay_speed()
 {
     std::vector<double> q(sample_q());
@@ -700,19 +713,6 @@ void assay_speed()
         ;
 }
 
-/// Test UL commutation functions in extreme cases.
-///
-/// For example, ic and ig can both be zero, and qc may round to zero
-/// for a Frasierized survivorship contract.
-
-void TestLimits()
-{
-    std::vector<double> zero(10, 0.0);
-    ULCommFns ulcf(zero, zero, zero, mce_option1_for_7702, mce_monthly);
-    LMI_TEST_EQUAL(1.0, ulcf.aDomega());
-    LMI_TEST_EQUAL(0.0, ulcf.kC().back());
-}
-
 int test_main(int, char*[])
 {
     ULCommFnsTest();



reply via email to

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