lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 2f6ea66 6/8: Demonstrate a simplification opp


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 2f6ea66 6/8: Demonstrate a simplification opportunity
Date: Thu, 23 Feb 2017 05:29:07 -0500 (EST)

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

    Demonstrate a simplification opportunity
    
    The ctors that take a single vector argument
     - call initialize_from_vector() to perform RLE on the argument, then
     - call realize_intervals() to decode the RLE and store the result
    and, as the temporary assertions added here demonstrate, the result of
    decoding the encoded argument is the original argument.
---
 input_sequence.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/input_sequence.cpp b/input_sequence.cpp
index 258fc36..923925c 100644
--- a/input_sequence.cpp
+++ b/input_sequence.cpp
@@ -136,6 +136,7 @@ InputSequence::InputSequence(std::vector<double> const& v)
 {
     initialize_from_vector(v);
     realize_intervals();
+    LMI_ASSERT(v == number_result_);
     assert_sane_and_ordered_partition(intervals_, years_to_maturity_);
 }
 
@@ -149,6 +150,7 @@ InputSequence::InputSequence(std::vector<std::string> 
const& v)
 {
     initialize_from_vector(v);
     realize_intervals();
+    LMI_ASSERT(v == keyword_result_);
     assert_sane_and_ordered_partition(intervals_, years_to_maturity_);
 }
 



reply via email to

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