interpolated discount와 forward curves의 코드를 보면 interpolated zero-yield curve와 많이 비슷하다는 것을 알 수 있을 것이다. 자연스럽게 의문점이 생각날 것이다: 공통 코드를 추상화하는 것이 가능하지 않을까? 혹은 하나의 클래스 템플릿이 가능하지 않을까?
대답은 각각 yes 와 no이다. 어떤 코드는 template 클래스로 추상화 될수 있다. 그러나 curves는 반드시 세개의 abstract 함수를 구현해야만 한다(discountImpl, forwardImpl, zeroYieldImpl). 그래서 우리는 여전히 공통 코드와 세개의 모든 클래스가 필요하다.

'quantlib > Implementation' 카테고리의 다른 글

Aside: a friend in need  (0) 2011.06.20
TTP: Template template parameter  (0) 2011.06.20
Aside: symmetry break  (0) 2011.06.19
Aside: evaluation date tricks  (0) 2011.06.18
3. Term structure - the shape of things to come  (0) 2011.06.16
Posted by karlsen

블로그 이미지
Pricing, hedging, risk-managing a complex derivative product
karlsen

태그목록

공지사항

Yesterday
Today
Total

달력

 « |  » 2025.4
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함