[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 19a4a3a 03/23: For now at least, trace solves
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 19a4a3a 03/23: For now at least, trace solves in regression test |
Date: |
Tue, 27 Jul 2021 21:59:50 -0400 (EDT) |
branch: master
commit 19a4a3ab265a48aaf91f72f3599d5b5c1d3141b9
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
For now at least, trace solves in regression test
The marginal cost is slight, and the trace is useful as long as
solves remain under investigation.
Incidentally, for illustration solves, make the trace show the number
of decimals specified for each solve, but never less than two in order
to ensure that currency cents are always shown.
---
ihs_avsolve.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index f6d8b9c..0ab7c85 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -34,6 +34,7 @@
#include "assert_lmi.hpp"
#include "contains.hpp"
#include "death_benefits.hpp"
+#include "global_settings.hpp"
#include "ledger_invariant.hpp"
#include "ledger_variant.hpp"
#include "mc_enum_types_aux.hpp" // set_run_basis_from_cloven_bases()
@@ -457,7 +458,10 @@ currency AccountValue::Solve
std::ostream os_trace(status().rdbuf());
std::ofstream ofs_trace;
- if(contains(yare_input_.Comments, "idiosyncrasyT"))
+ if
+ ( global_settings::instance().regression_testing()
+ || contains(yare_input_.Comments, "idiosyncrasyT")
+ )
{
ofs_trace.open("trace.txt", ios_out_app_binary());
os_trace.rdbuf(ofs_trace.rdbuf());
@@ -472,6 +476,7 @@ currency AccountValue::Solve
<< ", target " << mc_str(SolveTarget_)
<< std::endl
;
+ os_trace << std::fixed << std::setprecision(std::max(2, decimals));
}
SolveHelper solve_helper(*this, solve_set_fn);
- [lmi-commits] [lmi] master f576a4b 11/23: Augment unit test, (continued)
- [lmi-commits] [lmi] master f576a4b 11/23: Augment unit test, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master dc63e62 16/23: Cache evaluations for rounded decimal solves, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master cecc91f 21/23: Avoid a unit-test false negative, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master 4b26bf8 01/23: Add a parenthetical comment to a unit test, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master 86ae65d 18/23: Revert "Demonstration, for immediate reversion", Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master e59df26 14/23: Refactor, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master 8f2f355 19/23: Augment unit tests; record some observations, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master a259cb6 05/23: Calculate maximum possible number of iterations, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master d0a65c2 04/23: Demonstrate that Brent's δ can be almost arbitrarily small, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master 548f9ab 06/23: Document known shortcomings of a unit-testing helper, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master 19a4a3a 03/23: For now at least, trace solves in regression test,
Greg Chicares <=
- [lmi-commits] [lmi] master 04c58eb 09/23: Count iterations and evaluations separately, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master bbf2517 10/23: Use signum() where a signum function is wanted, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master e08be34 12/23: Improve a unit test, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master 02dde17 13/23: Avoid catastrophic cancellation, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master d2dcbf8 15/23: Reduce complexity, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master e93ca8f 17/23: Demonstration, for immediate reversion, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master 4500338 22/23: Simplify, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master 2ad4944 20/23: Record some more observations--no files changed, Greg Chicares, 2021/07/27
- [lmi-commits] [lmi] master 028b454 23/23: Find any root with only 64 function evaluations, Greg Chicares, 2021/07/27