00001 #include "eleve/src/typing0.hpp"
00002 #include "eleve/src/typing3.hpp"
00003 #include "eleve/src/typing1.hpp"
00004
00005 #include "csv2.hpp"
00006
00007 #include <iostream>
00008 #include <stdexcept>
00009
00010 namespace eepgwde { namespace detail {
00011
00012 typedef boost::multi_array<boost::any, 2> ma_any_t;
00013
00014
00015
00016
00017 Matrix0::operator QuantLib::Matrix () const throw(std::exception) {
00018 QuantLib::Matrix result(frame.shape()[0], frame.shape()[1]);
00019
00020 for (ma_any_t::size_type a = 0; a < frame.shape()[0]; ++a) {
00021 for (ma_any_t::size_type b = 0; b < frame.shape()[1]; ++b) {
00022 double & r = result[a][b];
00023 if (!as<double>(&r, frame[a][b]))
00024 throw std::domain_error("bad matrix");
00025 }
00026 }
00027 return result;
00028 }
00029
00030 }}
00031