[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 48ffe2c 03/13: Optionally get 7702 q from bui
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 48ffe2c 03/13: Optionally get 7702 q from built-in table |
Date: |
Sat, 15 Jun 2019 20:25:35 -0400 (EDT) |
branch: master
commit 48ffe2c57dacc4a0f6bef46956b0143c3c6cb8ca
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Optionally get 7702 q from built-in table
---
basic_tables.cpp | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/basic_tables.cpp b/basic_tables.cpp
index 8a0f4c0..a9c66d7 100644
--- a/basic_tables.cpp
+++ b/basic_tables.cpp
@@ -24,6 +24,8 @@
#include "basic_tables.hpp"
#include "actuarial_table.hpp"
+#include "assert_lmi.hpp"
+#include "cso_table.hpp"
#include "data_directory.hpp"
#include "database.hpp"
#include "dbnames.hpp" // e_database_key
@@ -87,6 +89,32 @@ std::vector<double> basic_table_rates
}
#endif // 0
}
+
+std::vector<double> LMI_SO irc_7702_q_builtin
+ (product_database const& db
+ ,int issue_age
+ ,int years_to_maturity
+ )
+{
+ auto const era = db.query<oenum_cso_era >(DB_CsoEra);
+ auto const a_b = db.query<oenum_alb_or_anb>(DB_AgeLastOrNearest);
+ auto const axis_g = db.query<bool >(DB_Irc7702QAxisGender);
+ auto const axis_s = db.query<bool >(DB_Irc7702QAxisSmoking);
+ auto const omega = db.query<int >(DB_MaturityAge);
+ LMI_ASSERT(db.index().issue_age() == issue_age);
+ LMI_ASSERT(omega - issue_age == years_to_maturity);
+
+ // Use 7702 axes for gender and smoker--for 7702, not guar mort.
+ return cso_table
+ (era
+ ,oe_orthodox // No other option currently supported for 7702.
+ ,a_b
+ ,axis_g ? db.index().gender () : mce_unisex
+ ,axis_s ? db.index().smoking() : mce_unismoke
+ ,issue_age
+ ,omega
+ );
+}
} // Unnamed namespace
std::vector<double> LMI_SO irc_7702_q
@@ -100,7 +128,11 @@ std::vector<double> LMI_SO irc_7702_q
{
case oe_7702_q_builtin:
{
- throw "Not yet implemented.";
+ return irc_7702_q_builtin
+ (database
+ ,issue_age
+ ,years_to_maturity
+ );
}
case oe_7702_q_external_table:
{
- [lmi-commits] [lmi] master updated (5fce601 -> e019e5b), Greg Chicares, 2019/06/15
- [lmi-commits] [lmi] master db9783b 01/13: Document some ideas for future improvements, Greg Chicares, 2019/06/15
- [lmi-commits] [lmi] master 2f9030d 04/13: Improve documentation, Greg Chicares, 2019/06/15
- [lmi-commits] [lmi] master cf0c022 02/13: Add conditional debugging code, Greg Chicares, 2019/06/15
- [lmi-commits] [lmi] master 5fcaa33 05/13: Move a line; add a comment, Greg Chicares, 2019/06/15
- [lmi-commits] [lmi] master 1fa08b4 08/13: Make 'AgentPhone' a "required" input field, Greg Chicares, 2019/06/15
- [lmi-commits] [lmi] master d08aabe 10/13: Reapply "Move imprimaturs; rearrange footer", Greg Chicares, 2019/06/15
- [lmi-commits] [lmi] master 6170caf 12/13: Add agent Id and phone to cover page, Greg Chicares, 2019/06/15
- [lmi-commits] [lmi] master 48ffe2c 03/13: Optionally get 7702 q from built-in table,
Greg Chicares <=
- [lmi-commits] [lmi] master 0ea441a 07/13: Verify both DB_Irc7702QWhence cases, Greg Chicares, 2019/06/15
- [lmi-commits] [lmi] master d07c63a 06/13: Conditionalize a block, Greg Chicares, 2019/06/15
- [lmi-commits] [lmi] master b72c0eb 09/13: Make agent's Id and phone number available for reports, Greg Chicares, 2019/06/15
- [lmi-commits] [lmi] master 38ce843 11/13: Simplify formatting of 'imprimatur', Greg Chicares, 2019/06/15
- [lmi-commits] [lmi] master e019e5b 13/13: Rework some finra MST files, Greg Chicares, 2019/06/15