lmi-commits
[Top][All Lists]
Advanced

[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)
             {



reply via email to

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