| 126 | | // recheck |
|---|
| 127 | | calculate(); |
|---|
| 128 | | |
|---|
| 129 | | // if (!turnOfYearEffect_.empty() && t > turnOfYear_) { |
|---|
| 130 | | // if (!turnOfYearEffect_.link.isValid()) |
|---|
| 131 | | // throw new ArgumentException("invalid turnOfYearEffect quote"); |
|---|
| 132 | | // double turnOfYearEffect = turnOfYearEffect_.link.value(); |
|---|
| 133 | | // if (!(turnOfYearEffect > 0.0 && turnOfYearEffect <= 1.0)) |
|---|
| 134 | | // throw new ArgumentException("invalid turnOfYearEffect value: " + turnOfYearEffect); |
|---|
| 135 | | // return turnOfYearEffect; |
|---|
| 136 | | // } |
|---|
| 137 | | //} |
|---|
| | 126 | calculate(); |
|---|
| | 127 | |
|---|
| | 128 | if (jumps_.Count != 0) { |
|---|
| | 129 | double jumpEffect = 1.0; |
|---|
| | 130 | for (int i=0; i<nJumps_ && jumpTimes_[i]<t; ++i) { |
|---|
| | 131 | if (!(jumps_[i].link.isValid())) |
|---|
| | 132 | throw new ApplicationException("invalid " + (i+1) + " jump quote"); |
|---|
| | 133 | double thisJump = jumps_[i].link.value(); |
|---|
| | 134 | if (!(thisJump > 0.0 && thisJump <= 1.0)) |
|---|
| | 135 | throw new ApplicationException("invalid " + (i+1) + " jump value: " + thisJump); |
|---|
| | 136 | jumpEffect *= thisJump; |
|---|
| | 137 | } |
|---|
| | 138 | return jumpEffect * traits_.discountImpl(interpolation_, t); |
|---|
| | 139 | } |
|---|