00001
00010 #ifndef CSV6_0
00011 #define CSV6_0
00012
00013 #include "pivot1.hpp"
00014
00015 namespace eepgwde { namespace detail {
00016
00017 const std::string StrikeMaturity::maturity0("maturity");
00018 const std::string StrikeMaturity::strike0("strike");
00019 const std::string StrikeMaturity::price0("price");
00020
00022
00024 Pivotter::operator DataFrame::ma_any_t () const {
00025 DataFrame::ma_any_t result;
00026 boost::array<DataFrame::ma_any_t::index, 2>
00027 shape ={{ rs.size(), cs.size() }};
00028 result.resize(shape);
00029
00030 std::list<boost::any> data;
00031 failures=0;
00032 for(std::vector<double>::const_iterator it0=rs.begin();
00033 it0 != rs.end(); ++it0) {
00034 for(std::vector<double>::const_iterator it1=cs.begin();
00035 it1 != cs.end(); ++it1) {
00036
00037 std::pair<Prices::iterator, Prices::iterator> p =
00038 px.equal_range(boost::make_tuple(*it0, *it1));
00039
00040 Prices::iterator p0 = p.first;
00041
00042 if (p0->strike_ == *it0 && p0->maturity_ == *it1) {
00043 double number = p0->price_;
00044 data.push_back(boost::any(number));
00045 continue;
00046 }
00047 failures++;
00048 data.push_back(boost::any());
00049 }
00050 }
00051 result.assign(data.begin(), data.end());
00052 return result;
00053 }
00054
00055 }}
00056
00057 #endif