[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 3f1dd88 7/9: Consolidate and improve document
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 3f1dd88 7/9: Consolidate and improve documentation |
Date: |
Sat, 17 Feb 2018 11:13:05 -0500 (EST) |
branch: master
commit 3f1dd8893e15be5533cb5c9bde813afd569b9af9
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Consolidate and improve documentation
A deleted comment suggested that storing variant IRR columns in the
invariant ledger instead of the variant ledgers somehow conserves
storage. It has the opposite effect, if any.
---
ledger_invariant.cpp | 13 ++++++++++---
ledger_invariant.hpp | 5 -----
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/ledger_invariant.cpp b/ledger_invariant.cpp
index dfb4231..eb591d6 100644
--- a/ledger_invariant.cpp
+++ b/ledger_invariant.cpp
@@ -1274,9 +1274,16 @@ LedgerInvariant& LedgerInvariant::PlusEq(LedgerInvariant
const& a_Addend)
/// are always used in pairs, so that either may be tested as a
/// proxy for the other.
///
-/// TODO ?? It is extraordinary that this "invariant" class uses and
-/// even sets some data that vary by basis and therefore seem to
-/// belong in the complementary "variant" class instead.
+/// TODO ?? This function's purpose is to let formatting routines
+/// decide whether to calculate IRRs, because those calculations
+/// are costly and their results might not be used. Yet pushing any
+/// calculations into formatting routines vitiates the separation of
+/// concerns.
+///
+/// TODO ?? It is extraordinary that this function in an "invariant"
+/// class uses and even sets data that vary by basis. Consider moving
+/// this function into the base class, and the IRR variables into class
+/// LedgerVariant.
void LedgerInvariant::CalculateIrrs(Ledger const& LedgerValues)
{
diff --git a/ledger_invariant.hpp b/ledger_invariant.hpp
index 628a5d0..929fdcb 100644
--- a/ledger_invariant.hpp
+++ b/ledger_invariant.hpp
@@ -60,11 +60,6 @@ class LMI_SO LedgerInvariant
double GetInitAnnLoanDueRate() const;
std::string const& GetStatePostalAbbrev() const;
- // TODO ?? Does this really belong here?
- // Yes: it keeps the ledger object small; otherwise, numerous IRR
- // columns would need to be stored.
- // No: its purpose is to push IRR calculations into formatting
- // routines, which ought not to do any serious calculations.
void CalculateIrrs(Ledger const&);
void UpdateCRC(CRC& a_crc) const override;
- [lmi-commits] [lmi] master updated (422cd51 -> 5e372c6), Greg Chicares, 2018/02/17
- [lmi-commits] [lmi] master 36d5a6b 1/9: Remove unnecessary static_cast, Greg Chicares, 2018/02/17
- [lmi-commits] [lmi] master 513e891 4/9: Improve documentation, Greg Chicares, 2018/02/17
- [lmi-commits] [lmi] master ca32be5 3/9: Find a root of the zero polynomial, Greg Chicares, 2018/02/17
- [lmi-commits] [lmi] master 3781a93 5/9: Refactor for rearrangeability, Greg Chicares, 2018/02/17
- [lmi-commits] [lmi] master 0ae54b4 2/9: Refactor for terseness, Greg Chicares, 2018/02/17
- [lmi-commits] [lmi] master b710396 8/9: Don't assume--assert, Greg Chicares, 2018/02/17
- [lmi-commits] [lmi] master 3f1dd88 7/9: Consolidate and improve documentation,
Greg Chicares <=
- [lmi-commits] [lmi] master 060aecf 6/9: Rearrange for comprehensibility, Greg Chicares, 2018/02/17
- [lmi-commits] [lmi] master 5e372c6 9/9: Perform ledger IRR initialization in one place only, Greg Chicares, 2018/02/17