[Top][All Lists]

[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;

reply via email to

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