lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 33a9ca3 2/2: Require ordered intervals that p


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 33a9ca3 2/2: Require ordered intervals that partition [inception, maturity) [416]
Date: Sat, 28 Jan 2017 21:13:33 +0000 (UTC)

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

    Require ordered intervals that partition [inception, maturity) [416]
    
    There is no need to allow intervals to be specified other than in
    increasing order, and each duration must belong to one and only one
    interval. The GUI input sequence editor already appropriately imposes
    these requirements, and the unit test verifies the same diagnostics
    that the GUI displays as warnings.
    
    Thus, no function to sort intervals is wanted; and it is a design
    invariant that the last interval end at maturity, even though the
    implementation may not yet have established that invariant fully.
---
 input_seq_test.cpp |    2 --
 input_sequence.cpp |   27 ---------------------------
 input_sequence.hpp |    4 ----
 3 files changed, 33 deletions(-)

diff --git a/input_seq_test.cpp b/input_seq_test.cpp
index 073b84e..56c8410 100644
--- a/input_seq_test.cpp
+++ b/input_seq_test.cpp
@@ -239,7 +239,6 @@ int test_main(int, char*[])
     }
 
     // Test overlapping intervals.
-    // TODO ?? Treat these as an error?
     {
     int const n = 9;
     double const d[n] = {1, 1, 1, 3, 3, 5, 5, 7, 7};
@@ -248,7 +247,6 @@ int test_main(int, char*[])
     }
 
     // Test intervals with decreasing begin-points.
-    // TODO ?? Should this case be allowed?
     {
     int const n = 9;
     double const d[n] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
diff --git a/input_sequence.cpp b/input_sequence.cpp
index 899dafc..6adfcb0 100644
--- a/input_sequence.cpp
+++ b/input_sequence.cpp
@@ -74,10 +74,6 @@ InputSequence::InputSequence
 {
     sequence();
 
-    // TODO ?? Perhaps this belongs in realize_vector().
-    sort_intervals();
-
-    // TODO ?? Not correct if last interval-endpoint specified is not the 
latest of all.
     if(intervals.size()) // TODO ?? And if not?
         {
         intervals.back().end_duration = last_possible_duration;
@@ -1103,26 +1099,3 @@ std::vector<ValueInterval> const& 
InputSequence::interval_representation() const
     return intervals;
 }
 
-// Sort intervals by begin_duration and end_duration.
-// Detect overlaps.
-void InputSequence::sort_intervals()
-{
-/*
-// TODO ?? Code from above that may be a useful skeleton if we do this at all.
-    std::vector<ValueInterval>::iterator intervals_i = intervals.begin();
-    while(intervals_i != intervals.end())
-        {
-        oss
-            // TODO ?? Consider 'value_keyword'.
-            << intervals_i->value_number
-            << " ["
-            << intervals_i->begin_duration
-            << ", "
-            << intervals_i->end_duration
-            << "); "
-            ;
-        ++intervals_i;
-        }
-*/
-}
-
diff --git a/input_sequence.hpp b/input_sequence.hpp
index 22aaab8..0752e3f 100644
--- a/input_sequence.hpp
+++ b/input_sequence.hpp
@@ -313,10 +313,6 @@ class LMI_SO InputSequence
 
     void mark_diagnostic_context();
 
-    // SOMEDAY !! Something like this may be part of a solution if we
-    // decide to permit specification of intervals in random order.
-    void sort_intervals();
-
     std::istringstream input_stream;
     // Maturity (last possible) duration in context of this particular
     // life's issue age.



reply via email to

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