QuantLib 라이브러리에서 QuantLib :: TimeSeries 클래스를 사용하여 대략적인 작업을 수행하고 있습니다. 내 문제는 QuantLib과 그 복잡함과 관련이 없지만 좀 더 일반적인 C++ 클래스에서는 생각합니다.C++ : 클래스 및 생성자 사용
QuantLib :: TimeSeries는 here으로 표시됩니다. 내 코드에서 (지금은 절대적으로 아무것도 반환하지 않음), std :: vector에 일련의 날짜와 std :: vector에 들어있는 일련의 가격을 제공합니다. QuantLib :: TimeSeries 오브젝트는 날짜와 가격을 연결합니다.
#include<ql\quantlib.hpp>
int main()
{
std::vector<QuantLib::Date> dates;
std::vector<std::double> quotes;
dates.push_back(Date(12,Nov, 2012));
dates.push_back(Date(13,Nov, 2012));
dates.push_back(Date(14,Nov, 2012));
quotes.push_back(40.05);
quotes.push_back(40.84);
quotes.push_back(41.03);
// Below is the line I am stuck at
QuantLib::TimeSeries<std::vector<QuantLib::Date>, std::vector<double>> series(dates.begin(), dates.end(), quotes.begin());
// Now do something with all the stuff above
// ... ...
return 0;
}
누군가이 안내서를 제공해 주셔서 감사드립니다.
감사합니다. double
및 귀하의 경우
template<class T, class Container = std::map<Date, T>>
class QuantLib::TimeSeries< T, Container >;
첫 번째 매개 변수는 저장 유형이있다 :
QuantLib::TimeSeries<double> series(dates.begin(), dates.end(), quotes.begin());
당신이 링크 된 문서에서 :
여기에 질문이 무엇입니까? –
또한 '닫는 것'은 무엇입니까? –
'closes.begin()'은 대신'quotes.begin()'이되어야할까요? –