lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 9ed87ac 4/4: Remove the defect just noted


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 9ed87ac 4/4: Remove the defect just noted
Date: Sun, 26 Feb 2017 14:54:09 -0500 (EST)

branch: master
commit 9ed87ac2d8a8369cbfc5fc2813690228793e8dcc
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Remove the defect just noted
    
    Obviously '1 maturity; 2' could not be canonical. The latent defect was
    that construction from a vector left the begin and end modes of each
    interval default-initialized.
---
 input_sequence.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/input_sequence.cpp b/input_sequence.cpp
index 36d6533..f30f92e 100644
--- a/input_sequence.cpp
+++ b/input_sequence.cpp
@@ -210,6 +210,8 @@ void InputSequence::initialize_from_vector(std::vector<T> 
const& v)
 
     ValueInterval default_interval;
     default_interval.value_is_keyword = T_is_string;
+    default_interval.begin_mode       = e_duration;
+    default_interval.end_mode         = e_duration;
 
     T prior_value = v.empty() ? T() : v.front();
     T current_value = prior_value;
@@ -234,6 +236,12 @@ void InputSequence::initialize_from_vector(std::vector<T> 
const& v)
             prior_value = current_value;
             }
         }
+
+    LMI_ASSERT(0                  == intervals_.front().begin_duration);
+    intervals_.front().begin_mode  = e_inception;
+
+    LMI_ASSERT(years_to_maturity_ == intervals_.back().end_duration);
+    intervals_.back().end_mode     = e_maturity;
 }
 
 InputSequence::~InputSequence() = default;



reply via email to

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