Swap의 생성자는
handle로서 discount curve를 그리고
simple shared pointers로서 cash flows를 수용했는지 궁금할 것이다.

이것은 handle의 linkTo 함수를 호출함으로서 다른 curve로 교체할때 유용할 것이다.
반면, cash flows는 swap 정의의 일부분이므로 immutable하다. 

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

class template & Function Template  (0) 2011.06.15
Aside: impure virtual methods  (0) 2011.06.15
Aside: Const or not const?  (0) 2011.06.09
2. Financial instruments and pricing engines  (0) 2011.06.06
1. Introduction  (0) 2011.06.06
Posted by karlsen

'interesting blog' 카테고리의 다른 글

clkao  (0) 2011.07.05
Esper Basics  (0) 2011.07.05
IAmA  (0) 2011.07.04
the basics - 시간의 성과  (0) 2011.06.07
듀프레인  (0) 2011.06.07
Posted by karlsen
NPV_는 mutable로 선언되었다.
이것은 caches나 lazy calculations를 구현하는데 이슈가 된다. 
쟁점은 NPV 함수가 논리적으로 const하다는 것이다.
instrument의 가치를 계산하는데 있어 값을 변경하면 안되기 때문이다.
그러므로 이러한 함수를 const instance로 만든다. 
즉, NPV의 constness는 우리가 calculate나 performCalculations를 const로 선언하게 한다.
그러나 결과를 lazily하게 계산하고 그것들을 저장하는데 있어 사용자는 필수적으로 하나 이상의 멤버에 값을 할당하게 된다.
이것은 cached 변수를 mutable로 선언하므로써 해결할 수 있다.
이는 개발자 혹은 파생된 클래스에서 두가지 조건을 모두 만족시킨다.
명목상 NPV는 constness를 갖게 되며, 데이터 멤버에 lazy assignment를 할수 있게 된다. 

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

class template & Function Template  (0) 2011.06.15
Aside: impure virtual methods  (0) 2011.06.15
Aside: handles and shared pointers  (0) 2011.06.11
2. Financial instruments and pricing engines  (0) 2011.06.06
1. Introduction  (0) 2011.06.06
Posted by karlsen

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

태그목록

공지사항

Yesterday
Today
Total

달력

 « |  » 2024.9
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

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함