[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5471] Compile table-migration tools; fix compiler diagnos
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5471] Compile table-migration tools; fix compiler diagnostics |
Date: |
Sun, 27 May 2012 16:53:34 +0000 |
Revision: 5471
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5471
Author: chicares
Date: 2012-05-27 16:53:33 +0000 (Sun, 27 May 2012)
Log Message:
-----------
Compile table-migration tools; fix compiler diagnostics
Modified Paths:
--------------
lmi/trunk/ChangeLog
lmi/trunk/objects.make
lmi/trunk/soa2xml.cpp
lmi/trunk/soa_helpers.hpp
lmi/trunk/soa_stress_test.cpp
Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2012-05-27 16:36:25 UTC (rev 5470)
+++ lmi/trunk/ChangeLog 2012-05-27 16:53:33 UTC (rev 5471)
@@ -30106,3 +30106,41 @@
virtual dtor to the base class. See:
http://lists.nongnu.org/archive/html/lmi/2012-05/msg00008.html
+20120527T1604Z <address@hidden> [578]
+
+ actuarial_table.cpp
+ actuarial_table.hpp
+ actuarial_table_test.cpp
+ objects.make
+Experimentally implement loading of xml tables (VS). See:
+ http://lists.nongnu.org/archive/html/lmi/2012-05/msg00009.html
+
+20120527T1615Z <address@hidden> [578]
+
+ soa2xml.cpp [new file]
+ soa_helpers.hpp [new file]
+Add binary-to-xml migration tool. See:
+ http://lists.nongnu.org/archive/html/lmi/2012-05/msg00010.html
+
+20120527T1616Z <address@hidden> [578]
+
+ soa_stress_test.cpp [new file]
+Add binary-versus-xml test tool. See:
+ http://lists.nongnu.org/archive/html/lmi/2012-05/msg00011.html
+
+20120527T1636Z <address@hidden> [578]
+
+ soa2xml.cpp
+ soa_helpers.hpp
+ soa_stress_test.cpp
+Fix 'make check_concinnity' issues in files just added.
+
+20120527T1653Z <address@hidden> [578]
+
+ objects.make
+ soa2xml.cpp
+ soa_helpers.hpp
+ soa_stress_test.cpp
+Compile table-migration tools; fix compiler diagnostics. See, e.g.:
+ http://lists.nongnu.org/archive/html/lmi/2012-05/msg00013.html
+
Modified: lmi/trunk/objects.make
===================================================================
--- lmi/trunk/objects.make 2012-05-27 16:36:25 UTC (rev 5470)
+++ lmi/trunk/objects.make 2012-05-27 16:53:33 UTC (rev 5471)
@@ -1036,6 +1036,27 @@
system_command.o \
system_command_non_wx.o \
+# Temporary tools for migration from binary to xml actuarial tables.
+# SOA !! Expunge after migration.
+
+soa2xml$(EXEEXT): \
+ $(boost_filesystem_objects) \
+ $(xmlwrapp_objects) \
+ actuarial_table.o \
+ alert.o \
+ alert_cli.o \
+ soa2xml.o \
+ xml_lmi.o \
+
+soa_stress_test$(EXEEXT): \
+ $(boost_filesystem_objects) \
+ $(xmlwrapp_objects) \
+ actuarial_table.o \
+ alert.o \
+ alert_cli.o \
+ soa_stress_test.o \
+ xml_lmi.o \
+
################################################################################
# Product files.
Modified: lmi/trunk/soa2xml.cpp
===================================================================
--- lmi/trunk/soa2xml.cpp 2012-05-27 16:36:25 UTC (rev 5470)
+++ lmi/trunk/soa2xml.cpp 2012-05-27 16:53:33 UTC (rev 5471)
@@ -36,7 +36,9 @@
#include <xmlwrapp/node.h>
#include <ios>
+#include <iostream>
#include <istream>
+#include <ostream>
/************************************************************************
misc helpers
@@ -61,7 +63,7 @@
std::vector<double> const values =
t.values(t.min_age(), t.max_age() - t.min_age() + 1);
- for(int i = 0; i < values.size(); i++)
+ for(unsigned int i = 0; i < values.size(); i++)
{
xml::node v("value", as_str(values[i]));
v.get_attributes().insert("age", as_str(t.min_age() + i));
@@ -78,7 +80,7 @@
std::vector<double> const values =
t.values(t.min_age(), t.max_age() - t.min_age() + 1);
- for(int i = 0; i < values.size(); i++)
+ for(unsigned int i = 0; i < values.size(); i++)
{
xml::node v("value", as_str(values[i]));
n.insert(v);
Modified: lmi/trunk/soa_helpers.hpp
===================================================================
--- lmi/trunk/soa_helpers.hpp 2012-05-27 16:36:25 UTC (rev 5470)
+++ lmi/trunk/soa_helpers.hpp 2012-05-27 16:53:33 UTC (rev 5471)
@@ -38,6 +38,9 @@
#include <boost/static_assert.hpp>
#include <climits> // CHAR_BIT
+#include <exception>
+#include <string>
+#include <vector>
/************************************************************************
misc helpers
@@ -67,7 +70,7 @@
fs::ifstream index_ifs(index_path, ios_in_binary());
if(!index_ifs)
{
- error(boost::format("File '%1%' is required but could not be found.")
% index_path);
+ error(boost::format("File '%1%' is required but could not be found.")
% index_path.string());
}
// Index records have fixed length:
@@ -96,7 +99,7 @@
break;
error(
boost::format("Table index file file '%1%': attempted to read
%2% bytes, but got %3% bytes instead.")
- % index_path
+ % index_path.string()
% index_record_length
% index_ifs
);
Modified: lmi/trunk/soa_stress_test.cpp
===================================================================
--- lmi/trunk/soa_stress_test.cpp 2012-05-27 16:36:25 UTC (rev 5470)
+++ lmi/trunk/soa_stress_test.cpp 2012-05-27 16:53:33 UTC (rev 5471)
@@ -33,7 +33,9 @@
#include <cmath>
#include <ios>
+#include <iostream>
#include <istream>
+#include <ostream>
inline bool almost_equal_doubles(double a, double b)
{
@@ -67,7 +69,7 @@
<< std::endl;
std::cerr << boost::format(" \t%|10|\t%|10|") % "xml" % "soa" <<
std::endl;
- for(int i = 0; i < data_xml.size(); i++)
+ for(unsigned int i = 0; i < data_xml.size(); i++)
{
if(!almost_equal_doubles(data_xml[i], data_soa[i]))
{
@@ -106,8 +108,8 @@
{
std::vector<double> result_xml = xml.values(start, length);
std::vector<double> result_soa = soa.values(start, length);
- LMI_ASSERT(result_xml.size() == length);
- LMI_ASSERT(result_soa.size() == length);
+ LMI_ASSERT(result_xml.size() == static_cast<unsigned int>(length));
+ LMI_ASSERT(result_soa.size() == static_cast<unsigned int>(length));
if(!almost_equal_doubles(result_xml, result_soa))
report_vector_difference(start, result_xml, result_soa);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5471] Compile table-migration tools; fix compiler diagnostics,
Greg Chicares <=