lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master b0cdd09 5/6: Remove an unwanted ctor


From: Greg Chicares
Subject: [lmi-commits] [lmi] master b0cdd09 5/6: Remove an unwanted ctor
Date: Wed, 8 Feb 2017 09:15:41 -0500 (EST)

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

    Remove an unwanted ctor
    
    The removed ctor seems to have been written in 2002, before the lmi
    epoch. No use has ever been found for it, and none can plausibly be
    envisioned.
---
 input_sequence.cpp | 65 +-----------------------------------------------------
 input_sequence.hpp |  1 -
 2 files changed, 1 insertion(+), 65 deletions(-)

diff --git a/input_sequence.cpp b/input_sequence.cpp
index 199020c..21f8944 100644
--- a/input_sequence.cpp
+++ b/input_sequence.cpp
@@ -779,15 +779,10 @@ InputSequence::InputSequence
     realize_intervals();
 }
 
-// Constructors taking one or two vectors as their sole arguments are
+// Constructors taking only one (vector) argument are
 // intended to convert flat vectors to input sequences, compacted with
 // run-length encoding: 1 1 1 2 2 becomes 1[0,2), 2[2,4).
 //
-// The constructor that takes two vector arguments exists because some
-// sequences may have both numeric and keyword values. Distinct vectors
-// are supplied for these two value types; for each interval, the value
-// type chosen is keyword if the keyword is not blank, else numeric.
-//
 // The control constructs may appear nonobvious. This design treats
 // the push_back operation as fundamental: push_back is called exactly
 // when we know that a new interval must be added. This avoids special
@@ -857,64 +852,6 @@ void InputSequence::initialize_from_vector(std::vector<T> 
const& v)
         }
 }
 
-InputSequence::InputSequence
-    (std::vector<double> const& n_v
-    ,std::vector<std::string> const& s_v
-    )
-    :years_to_maturity_(n_v.size())
-{
-    if(n_v.size() != s_v.size())
-        {
-        fatal_error()
-            << "Vector lengths differ."
-            << LMI_FLUSH
-            ;
-        }
-
-    ValueInterval dummy;
-
-    double n_prior_value = n_v.empty() ? 0.0 : n_v.front();
-    double n_current_value = n_prior_value;
-
-    std::string s_prior_value = s_v.empty() ? std::string() : s_v.front();
-    std::string s_current_value = s_prior_value;
-
-    intervals_.push_back(dummy);
-    intervals_.back().value_number  = n_current_value;
-    intervals_.back().value_keyword = s_current_value;
-    intervals_.back().value_is_keyword = "" != s_current_value;
-
-    std::vector<double>::const_iterator n_vi;
-    std::vector<std::string>::const_iterator s_vi;
-    for
-        (n_vi = n_v.begin(), s_vi = s_v.begin()
-        ;n_vi != n_v.end() // s_v has same length, as 'asserted' above.
-        ;++n_vi, ++s_vi
-        )
-        {
-        n_current_value = *n_vi;
-        s_current_value = *s_vi;
-        if(n_prior_value == n_current_value && s_prior_value == 
s_current_value)
-            {
-            ++intervals_.back().end_duration;
-            }
-        else
-            {
-            int value_change_duration = intervals_.back().end_duration;
-            intervals_.push_back(dummy);
-            intervals_.back().value_number = n_current_value;
-            intervals_.back().value_keyword = s_current_value;
-            intervals_.back().value_is_keyword = "" != s_current_value;
-            intervals_.back().begin_duration = value_change_duration;
-            intervals_.back().end_duration = ++value_change_duration;
-            n_prior_value = n_current_value;
-            s_prior_value = s_current_value;
-            }
-        }
-
-    realize_intervals();
-}
-
 InputSequence::~InputSequence() = default;
 
 std::vector<double> const& InputSequence::linear_number_representation() const
diff --git a/input_sequence.hpp b/input_sequence.hpp
index 7c6c059..d0f7071 100644
--- a/input_sequence.hpp
+++ b/input_sequence.hpp
@@ -273,7 +273,6 @@ class LMI_SO InputSequence
 
     explicit InputSequence(std::vector<double> const&);
     explicit InputSequence(std::vector<std::string> const&);
-    InputSequence(std::vector<double> const&, std::vector<std::string> const&);
 
     ~InputSequence();
 



reply via email to

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