00001
00015 #include <iostream>
00016 #include <stack>
00017 #include <algorithm>
00018 #include <vector>
00019
00020 #include <algorithm>
00021 #include <typeinfo>
00022
00023 #include <boost/bind.hpp>
00024 #include <boost/foreach.hpp>
00025 #include <boost/multi_array.hpp>
00026
00027 #include <boost/regex.hpp>
00028
00029 #include <ql/utilities/tracing.hpp>
00030
00031 #include <boost/algorithm/string/trim.hpp>
00032 #include <boost/tokenizer.hpp>
00033
00034 #define BOOST_TEST_NO_MAIN
00035 #include <boost/test/unit_test.hpp>
00036
00037 #include "eleve/src/typing3.hpp"
00038 #include "eleve/src/typing1.hpp"
00039
00040 #include "eleve/src0/csv1.hpp"
00041 #include "pivot1.hpp"
00042 #include "eleve/src0/csv2.hpp"
00043 #include "eleve/src0/csv4.hpp"
00044
00045 #include "acsvt0.hpp"
00046
00047 BOOST_AUTO_TEST_SUITE(misc)
00048
00049 BOOST_AUTO_TEST_CASE(e0)
00050 {
00051 using namespace eepgwde::detail;
00052
00053 BOOST_TEST_MESSAGE("QuantLib::misc::e0");
00054
00055 std::string service0(fname0);
00056 service0 = service0.erase(service0.find("."));
00057
00058
00059 Filter0 f0(service0, frame);
00060
00061
00062 DataFrame * df0 = f0;
00063
00064
00065 Typing t0;
00066 Typing::mappings_t mappings0 = t0.mappings();
00067 mappings0["PX"] = std::string("name");
00068
00069
00070 DataFrame::headar h0(df0, mappings0);
00071 DataFrame::attr_pos_t h1 = h0;
00072
00073 df0->header = h1;
00074
00075 std::cerr << df0->header.left << std::endl;
00076
00077 DataFrame * df1 = f0;
00078
00079 std::cerr << df1->header.left << std::endl;
00080
00081 }
00082
00083 BOOST_AUTO_TEST_SUITE_END()
00084
00085 BOOST_AUTO_TEST_SUITE (mi3)
00086
00087 BOOST_AUTO_TEST_CASE(e0)
00088 {
00089 using namespace eepgwde::detail;
00090
00091 BOOST_TEST_MESSAGE("QuantLib::mi3::e0");
00092
00093 std::string service0(fname0);
00094 service0 = service0.erase(service0.find("."));
00095
00096
00097 Filter0 f0(service0, frame);
00098
00099
00100 DataFrame * df0 = f0;
00101
00102
00103 DataFrame::payloader payload0(*df0);
00104 std::vector<Attr0> attr0 = payload0;
00105
00106
00107 std::string key("X0");
00108 for_each(attr0.begin(), attr0.end(),
00109 boost::bind(&Attr0::attributes,_1,key) );
00110
00111
00112 f0.add(attr0);
00113 DataFrame * df1 = f0;
00114 df1->render();
00115
00116
00117 Typing t0;
00118 Typing::mappings_t mappings0 = t0.mappings();
00119 mappings0["PX"] = std::string("name");
00120
00121
00122 DataFrame::headar h0(df1, mappings0);
00123 DataFrame::attr_pos_t h1 = h0;
00124
00125 df1->header = h1;
00126
00127 std::cerr << df1->header.left << std::endl;
00128
00129 {
00130
00131 boost::regex e("[A-Z]+ISC[^ ]+ Cu.+");
00132 QPXisc comparor(e);
00133
00134 DataFrame::ma_any_t caps0 = f0.partition(comparor);
00135
00136 results["caps0"] = boost::any(new DataFrame::ma_any_t(caps0));
00137
00138 std::cerr << caps0 << std::endl;
00139 }
00140
00141 {
00142
00143 boost::regex e("[A-Z]+ISF[^ ]+ Cu.+");
00144 QPXisc comparor(e);
00145
00146 DataFrame::ma_any_t floors0 = f0.partition(comparor);
00147
00148 results["floors0"] = boost::any(new DataFrame::ma_any_t(floors0));
00149
00150 std::cerr << floors0 << std::endl;
00151 }
00152
00153 }
00154
00155 BOOST_AUTO_TEST_CASE(e1)
00156 {
00157 using namespace eepgwde::detail;
00158
00159 BOOST_TEST_MESSAGE("QuantLib::mi3::e1");
00160
00161 std::string w;
00162
00163 w = "caps0";
00164
00165 {
00166 boost::any c0 = results[w];
00167
00168 DataFrame::ma_any_t & r =
00169 * boost::any_cast<DataFrame::ma_any_t *>(c0);
00170
00171 std::cerr << r << std::endl;
00172 }
00173
00174 w = "floors0";
00175
00176 {
00177 boost::any c0 = results[w];
00178
00179 DataFrame::ma_any_t & r =
00180 * boost::any_cast<DataFrame::ma_any_t *>(c0);
00181
00182 std::cerr << r << std::endl;
00183 }
00184
00185 }
00186
00187 BOOST_AUTO_TEST_SUITE_END()
00188
00189
00190
00191