lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 200e756 03/22: Clarify documentation


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 200e756 03/22: Clarify documentation
Date: Sun, 6 Jun 2021 21:37:59 -0400 (EDT)

branch: master
commit 200e75696c8dfc17fcf0bab7c0548be3aafa9bc4
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Clarify documentation
    
    Explicitly state that "final solve parameters are stored now" means
    calling the particular function that stores them, and nothing more.
    State this where that particular function is called.
---
 ihs_avsolve.cpp | 11 ++++++-----
 solve.cpp       | 14 +++++++-------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index 13fd8e0..741d226 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -468,15 +468,16 @@ currency AccountValue::Solve
             // TODO ?? What can we do when no solution exists for guar prem?
             }
         }
+    currency const solution_cents = round_minutiae().c(solution.first);
+
+    Solving = false;
 
     // The account and ledger values set as a side effect of solving
     // aren't generally the same as those shown on the illustration
     // because the 'Solving' flag has side effects. Therefore, the
-    // final solve parameters are stored now, and actual values are
-    // freshly generated downstream.
-
-    Solving = false;
-    currency const solution_cents = round_minutiae().c(solution.first);
+    // final solve parameters are stored by calling 'solve_set_fn'
+    // now, and actual values are freshly generated downstream.
     (this->*solve_set_fn)(solution_cents);
+
     return solution_cents;
 }
diff --git a/solve.cpp b/solve.cpp
index 53fbe74..3f196e4 100644
--- a/solve.cpp
+++ b/solve.cpp
@@ -335,12 +335,7 @@ currency AccountValue::Solve()
         LMI_ASSERT(0.0 == Solution.first);
         warning() << "Solution not found. Using zero instead." << LMI_FLUSH;
         }
-
-    // The account and ledger values set as a side effect of solving
-    // aren't generally the same as those shown on the illustration
-    // because the 'Solving' flag has side effects. Therefore, the
-    // final solve parameters are stored now, and actual values are
-    // freshly generated downstream.
+    currency const solution_cents = round_to_cents.c(Solution.first);
 
     Solving = false;
 
@@ -350,7 +345,12 @@ currency AccountValue::Solve()
     // kludge, but so is 'That'; a function object is wanted instead.
     only_set_values = !Solving;
 
-    currency const solution_cents = round_to_cents.c(Solution.first);
+    // The account and ledger values set as a side effect of solving
+    // aren't generally the same as those shown on the illustration
+    // because the 'Solving' flag has side effects. Therefore, the
+    // final solve parameters are stored by calling 'SolveFn'
+    // now, and actual values are freshly generated downstream.
     SolveFn(dblize(solution_cents));
+
     return solution_cents;
 }



reply via email to

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