[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 1d9b6e9 4/9: Store a useful value; discard a
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 1d9b6e9 4/9: Store a useful value; discard a useless one |
Date: |
Thu, 4 Oct 2018 19:24:15 -0400 (EDT) |
branch: master
commit 1d9b6e932ff235443d921e074ca5ad7a255a5352
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Store a useful value; discard a useless one
'MaxDuration' is used only for XSL-FO; discarded it elsewhere.
'GreatestLapseDuration' is actually useful; stored it for the new PDF
implementation, which will soon make use of it.
Expunged misleading comments that suggested GetMaxLength() is the
"max *composite* length". Actually it is the greatest lapse duration
across all {current, guaranteed, etc.} bases: thus, the number of rows
to be printed on an illustration; it has nothing to do with a composite
that summarizes multiple lives in a group.
---
ledger_evaluator.cpp | 11 +++++------
ledger_xml_io.cpp | 2 --
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/ledger_evaluator.cpp b/ledger_evaluator.cpp
index cb90029..8db69b3 100644
--- a/ledger_evaluator.cpp
+++ b/ledger_evaluator.cpp
@@ -502,6 +502,7 @@ ledger_evaluator Ledger::make_evaluator() const
format_map["External1035Amount" ] = f1;
format_map["GenderBlended" ] = f1;
format_map["GenderDistinct" ] = f1;
+ format_map["GreatestLapseDuration" ] = f1;
format_map["Has1035ExchCharge" ] = f1;
format_map["HasADD" ] = f1;
format_map["HasChildRider" ] = f1;
@@ -521,7 +522,6 @@ ledger_evaluator Ledger::make_evaluator() const
format_map["IsMec" ] = f1;
format_map["LapseMonth" ] = f1;
format_map["LapseYear" ] = f1;
- format_map["MaxDuration" ] = f1;
format_map["MecMonth" ] = f1;
format_map["MecYear" ] = f1;
format_map["NoLapse" ] = f1;
@@ -694,11 +694,10 @@ ledger_evaluator Ledger::make_evaluator() const
vectors["IrrCsv_Current" ] = &ledger_invariant_->IrrCsvCurrInput;
vectors["IrrDb_Current" ] = &ledger_invariant_->IrrDbCurrInput ;
-// GetMaxLength() is max *composite* length.
-// int max_length = GetMaxLength();
- double MaxDuration = ledger_invariant_->EndtAge - ledger_invariant_->Age;
- scalars["MaxDuration"] = &MaxDuration;
- int max_duration = static_cast<int>(MaxDuration);
+ double GreatestLapseDuration = GetMaxLength();
+ scalars["GreatestLapseDuration"] = &GreatestLapseDuration;
+
+ int max_duration = static_cast<int>(ledger_invariant_->EndtAge -
ledger_invariant_->Age);
int issue_age = static_cast<int>(ledger_invariant_->Age);
std::vector<double> AttainedAge(max_duration);
diff --git a/ledger_xml_io.cpp b/ledger_xml_io.cpp
index d75231e..b5b6f08 100644
--- a/ledger_xml_io.cpp
+++ b/ledger_xml_io.cpp
@@ -573,8 +573,6 @@ void Ledger::write(xml::element& x) const
vectors["IrrCsv_Current" ] = &ledger_invariant_->IrrCsvCurrInput;
vectors["IrrDb_Current" ] = &ledger_invariant_->IrrDbCurrInput ;
-// GetMaxLength() is max *composite* length.
-// int max_length = GetMaxLength();
double MaxDuration = ledger_invariant_->EndtAge - ledger_invariant_->Age;
scalars["MaxDuration"] = &MaxDuration;
int max_duration = static_cast<int>(MaxDuration);
- [lmi-commits] [lmi] master updated (b3e084f -> b36660c), Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master af5a41d 2/9: Demonstrate the nugatoriness of composite_lapse_year_, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master b957c49 1/9: Rewrite write_tsv(), Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 1d9b6e9 4/9: Store a useful value; discard a useless one,
Greg Chicares <=
- [lmi-commits] [lmi] master 579a4f4 3/9: Simplify [378], Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master fac6d21 8/9: Rename local variables in one function, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 4c6e6c3 6/9: Prefer bourn_cast to static_cast for arithmetic type conversions, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master b36660c 9/9: Define short aliases early; use them wherever possible, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 18f1ca3 7/9: Refactor to remove duplication, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 797a8b8 5/9: Rename a member function, Greg Chicares, 2018/10/04