[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 7c21f2a 7/8: Optionally trace IRR iterations
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 7c21f2a 7/8: Optionally trace IRR iterations |
Date: |
Fri, 9 Jul 2021 01:41:18 -0400 (EDT) |
branch: master
commit 7c21f2a660089955eca9b7c5c3ccc99e00efb83e
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Optionally trace IRR iterations
It seemed a shame to throw away this optional feature, which may be
wanted again.
---
financial.hpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/financial.hpp b/financial.hpp
index 242e43f..2788c75 100644
--- a/financial.hpp
+++ b/financial.hpp
@@ -27,8 +27,10 @@
#include "assert_lmi.hpp"
#include "bourn_cast.hpp"
#include "mc_enum_type_enums.hpp" // mcenum_mode
+#include "miscellany.hpp" // ios_out_app_binary()
#include "zero.hpp"
+#include <fstream>
#include <iterator> // iterator_traits
class calendar_date;
@@ -95,12 +97,17 @@ class irr_helper
long double operator()()
{
+// Uncomment to trace iterations:
+// std::ofstream ofs_trace;
+// ofs_trace.open("trace_irr.txt", ios_out_app_binary());
+// std::ostream os_trace(ofs_trace.rdbuf());
root_type const z = decimal_root
(*this
,-1.0 // A priori lower bound.
,1000.0 // Assumed upper bound.
,bias_lower // Return the final bound with the lower FV.
,decimals_
+// ,os_trace
);
switch(z.validity)
{
- [lmi-commits] [lmi] master updated (55873f1 -> ce8b814), Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master 485d642 4/8: Augment unit tests, Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master be56aad 2/8: Move and rename a present-value function, Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master 873c574 6/8: Expunge an unneeded overload, Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master ac0da7b 3/8: Use a more appropriate unit-test macro, Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master 951a9c9 1/8: Improve IRR speed measurements, Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master 81ede74 5/8: Reimplement fv(), Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master ce8b814 8/8: Record speed measurements, Greg Chicares, 2021/07/09
- [lmi-commits] [lmi] master 7c21f2a 7/8: Optionally trace IRR iterations,
Greg Chicares <=