[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5016] Fix defect introduced 20100623T0053Z: cannot load v
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5016] Fix defect introduced 20100623T0053Z: cannot load valid file in GUI |
Date: |
Fri, 25 Jun 2010 01:30:15 +0000 |
Revision: 5016
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5016
Author: chicares
Date: 2010-06-25 01:30:15 +0000 (Fri, 25 Jun 2010)
Log Message:
-----------
Fix defect introduced 20100623T0053Z: cannot load valid file in GUI
Modified Paths:
--------------
lmi/trunk/my_tier.cpp
lmi/trunk/tier_document.cpp
lmi/trunk/tier_view_editor.cpp
Modified: lmi/trunk/my_tier.cpp
===================================================================
--- lmi/trunk/my_tier.cpp 2010-06-24 02:45:37 UTC (rev 5015)
+++ lmi/trunk/my_tier.cpp 2010-06-25 01:30:15 UTC (rev 5016)
@@ -42,9 +42,8 @@
#include "stratified_charges.hpp"
#include "data_directory.hpp"
+#include "ieee754.hpp" // infinity<>()
-#include <cfloat> // DBL_MAX
-
//============================================================================
void stratified_charges::write_proprietary_stratified_files()
{
@@ -53,7 +52,7 @@
// Example only.
foo.raw_entity(e_curr_sepacct_load_tiered_by_assets
).values_.push_back(0.0);
- foo.raw_entity(e_curr_sepacct_load_tiered_by_assets
).limits_.push_back(DBL_MAX);
+ foo.raw_entity(e_curr_sepacct_load_tiered_by_assets
).limits_.push_back(infinity<double>());
// Not necessary for 'sample' product only, because it's built in.
// foo.write(AddDataDir("sample.strata"));
Modified: lmi/trunk/tier_document.cpp
===================================================================
--- lmi/trunk/tier_document.cpp 2010-06-24 02:45:37 UTC (rev 5015)
+++ lmi/trunk/tier_document.cpp 2010-06-25 01:30:15 UTC (rev 5016)
@@ -28,6 +28,8 @@
#include "tier_document.hpp"
+#include "ieee754.hpp" // infinity<>()
+
// EVGENIY !! Doesn't it seem strange that this wx header appears
// to be needed here? I don't see it included in similar files.
// I tried omitting it, but wasn't able to figure out what the
@@ -35,7 +37,6 @@
#include <wx/defs.h>
-#include <cfloat> // DBL_MAX
#include <vector>
IMPLEMENT_DYNAMIC_CLASS(TierDocument, ProductEditorDocument)
@@ -54,8 +55,8 @@
void TierDocument::initialize_charges()
{
static stratified_entity const dummy_entity
- (std::vector<double>(1, DBL_MAX) // limits
- ,std::vector<double>(1, 0) // values
+ (std::vector<double>(1, infinity<double>()) // limits
+ ,std::vector<double>(1, 0.0) // values
);
std::vector<std::string> const& v = charges_.member_names();
typedef std::vector<std::string>::const_iterator svci;
Modified: lmi/trunk/tier_view_editor.cpp
===================================================================
--- lmi/trunk/tier_view_editor.cpp 2010-06-24 02:45:37 UTC (rev 5015)
+++ lmi/trunk/tier_view_editor.cpp 2010-06-25 01:30:15 UTC (rev 5016)
@@ -24,12 +24,11 @@
#include "tier_view_editor.hpp"
#include "assert_lmi.hpp"
+#include "ieee754.hpp" // infinity<>()
#include "multidimgrid_safe.tpp"
#include "stratified_charges.hpp"
#include "value_cast.hpp"
-#include <cfloat> // DBL_MAX
-
void tier_entity_adapter::ensure_not_void() const
{
LMI_ASSERT(!is_void());
@@ -75,12 +74,11 @@
return;
}
- static double const max_double = std::numeric_limits<double>::max();
-
if(limits().empty())
{
- limits().push_back(max_double);
- values().push_back(0);
+ // This is conjectured to be unreachable.
+ limits().push_back(infinity<double>());
+ values().push_back(0.0);
}
unsigned int const size = limits().size();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5016] Fix defect introduced 20100623T0053Z: cannot load valid file in GUI,
Greg Chicares <=