[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master c2f6854 03/14: Self test: print more timings
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master c2f6854 03/14: Self test: print more timings |
Date: |
Sat, 29 Aug 2020 19:34:48 -0400 (EDT) |
branch: master
commit c2f685494515eb44a6f1bd6a48f179bc04dc2616
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Self test: print more timings
Print timings for all the scenarios that are tested.
---
main_cli.cpp | 45 ++++++++++++++++++++++++++-------------------
1 file changed, 26 insertions(+), 19 deletions(-)
diff --git a/main_cli.cpp b/main_cli.cpp
index 3b8a571..534bdbb 100644
--- a/main_cli.cpp
+++ b/main_cli.cpp
@@ -75,22 +75,23 @@ void self_test()
illustrator z(mce_emit_nothing);
- Input IP;
- IP["ProductName" ] = "sample2naic";
- IP["Gender" ] = "Male";
- IP["Smoking" ] = "Nonsmoker";
- IP["UnderwritingClass" ] = "Standard";
- IP["GeneralAccountRate"] = "0.06";
- IP["Payment" ] = "20000.0";
- IP["SpecifiedAmount" ] = "1000000.0";
- IP.RealizeAllSequenceInput();
+ Input naic_no_solve;
+ naic_no_solve["ProductName" ] = "sample2naic";
+ naic_no_solve["SolveType" ] = "No solve";
+ naic_no_solve["Gender" ] = "Male";
+ naic_no_solve["Smoking" ] = "Nonsmoker";
+ naic_no_solve["UnderwritingClass" ] = "Standard";
+ naic_no_solve["GeneralAccountRate"] = "0.06";
+ naic_no_solve["Payment" ] = "20000.0";
+ naic_no_solve["SpecifiedAmount" ] = "1000000.0";
+ naic_no_solve["SolveToWhich" ] = "Maturity";
+ naic_no_solve.RealizeAllSequenceInput();
double expected_value = 0.0;
double observed_value = 0.0;
- IP["SolveType"] = "No solve";
expected_value = 6305652.52;
- z("CLI_selftest", IP);
+ z("CLI_selftest", naic_no_solve);
observed_value = z.principal_ledger()->GetCurrFull().AcctVal.back();
if(!antediluvian && .005 < std::fabs(expected_value - observed_value))
{
@@ -104,10 +105,10 @@ void self_test()
;
}
- IP["SolveToWhich"] = "Maturity";
- IP["SolveType"] = "Specified amount";
+ Input naic_solve_specamt {naic_no_solve};
+ naic_solve_specamt["SolveType"] = "Specified amount";
expected_value = 1879139.14;
- z("CLI_selftest", IP);
+ z("CLI_selftest", naic_solve_specamt);
observed_value = z.principal_ledger()->GetCurrFull().AcctVal.back();
if(!antediluvian && .005 < std::fabs(expected_value - observed_value))
{
@@ -121,9 +122,10 @@ void self_test()
;
}
- IP["SolveType"] = "Employee premium";
+ Input naic_solve_ee_prem {naic_no_solve};
+ naic_solve_ee_prem["SolveType"] = "Employee premium";
expected_value = 10673.51;
- z("CLI_selftest", IP);
+ z("CLI_selftest", naic_solve_ee_prem);
observed_value =
z.principal_ledger()->GetLedgerInvariant().EeGrossPmt.front();
if(!antediluvian && .005 < std::fabs(expected_value - observed_value))
{
@@ -141,9 +143,14 @@ void self_test()
std::cout << "Timing test skipped: takes too long in debug mode" <<
std::endl;
#else // !defined _GLIBCXX_DEBUG
std::cout
- << "Test solve speed: "
- << TimeAnAliquot(std::bind(z, "CLI_selftest", IP))
- << '\n'
+ << "Test speed: "
+ << "\n naic, no solve : "
+ << TimeAnAliquot(std::bind(z, "CLI_selftest", naic_no_solve))
+ << "\n naic, specamt solve: "
+ << TimeAnAliquot(std::bind(z, "CLI_selftest", naic_solve_specamt))
+ << "\n naic, ee prem solve: "
+ << TimeAnAliquot(std::bind(z, "CLI_selftest", naic_solve_ee_prem))
+ << std::endl
;
#endif // !defined _GLIBCXX_DEBUG
}
- [lmi-commits] [lmi] master updated (c463357 -> 520bb97), Greg Chicares, 2020/08/29
- [lmi-commits] [lmi] master 4c54e90 02/14: Self test: explicitly specify product, Greg Chicares, 2020/08/29
- [lmi-commits] [lmi] master c2f6854 03/14: Self test: print more timings,
Greg Chicares <=
- [lmi-commits] [lmi] master ccb70ce 04/14: Self test: measure speed for 'finra' as well as 'ill_reg', Greg Chicares, 2020/08/29
- [lmi-commits] [lmi] master f6dfcf1 05/14: Filter out self-test timings, Greg Chicares, 2020/08/29
- [lmi-commits] [lmi] master 19be5c7 07/14: Don't initialize what's already been initialized, Greg Chicares, 2020/08/29
- [lmi-commits] [lmi] master 5dec884 01/14: Include appropriate headers, Greg Chicares, 2020/08/29
- [lmi-commits] [lmi] master fa15960 06/14: Don't touch a ledger object before calling its Init(), Greg Chicares, 2020/08/29
- [lmi-commits] [lmi] master 520bb97 14/14: Call ledger Init() less repeatedly [340], Greg Chicares, 2020/08/29
- [lmi-commits] [lmi] master 74927c6 13/14: Eradicate 'EePmt' and 'ErPmt', Greg Chicares, 2020/08/29
- [lmi-commits] [lmi] master c017212 08/14: Make 'daily_interest_accounting' harder to overlook, Greg Chicares, 2020/08/29
- [lmi-commits] [lmi] master 80f3ab4 09/14: Don't touch a ledger object before calling its Init() (bis), Greg Chicares, 2020/08/29
- [lmi-commits] [lmi] master 4a28bc2 10/14: Replace 'EePmt' (antediluvian), Greg Chicares, 2020/08/29