lmi
[Top][All Lists]
Advanced

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

[lmi] for(;;) ... break;


From: Greg Chicares
Subject: [lmi] for(;;) ... break;
Date: Fri, 27 Jan 2017 03:05:31 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0

I've been reviewing every iterator and every for-statement in lmi,
and modernizing them wherever that seemed wise. After working through
Vadim's massive changes
  https://patch-diff.githubusercontent.com/raw/vadz/lmi/pull/52.patch
| 49 files changed, 310 insertions(+), 525 deletions(-)
I made some further changes, and now I've gone back and reviewed every
  /::iterator/
  /::const_iterator/
  /::for *(/
  /::for$/
and made a couple of final modernizations, which I'll commit and push
soon; and that concludes this particular modernization task.

I decided not to make a certain few potential modernizations for reasons
previously discussed here. Here's another one, which occurs more than once:

     std::vector<double> tabular_Ax;
+    for(auto const& j : CvatCorridorFactors)
+        {
+        LMI_ASSERT(0.0 < j);
+        tabular_Ax.push_back(1.0 / j);
+        }
-    for(int j = 0; j < input.years_to_maturity(); ++j)
-        {
-        LMI_ASSERT(0.0 < CvatCorridorFactors[j]);
-        tabular_Ax.push_back(1.0 / CvatCorridorFactors[j]);
-        }
     tabular_Ax.push_back(1.0);

I won't make that change because I feel it would be better handled
with expression templates:
     std::vector<double> tabular_Ax = 1.0 / CvatCorridorFactors;



reply via email to

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