Assembla home | Assembla project page
 

Changeset 229

Show
Ignore:
Timestamp:
08/07/08 05:49:52 (4 months ago)
Author:
snovik
Message:

Change: QL 15341

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/QLNet/QLNet/Termstructures/Iterativebootstrap.cs

    r228 r229  
    8080                ts_.data_ = new InitializedList<double>(n + 1); 
    8181                ts_.data_[0] = ts_.initialValue(ts_); 
     82                for (i=0; i<n; ++i) 
     83                    ts_.data_[i+1] = ts_.initialGuess(); 
    8284            } 
    8385 
     
    116118                            ts_.interpolation_ = ts_.interpolator_.interpolate(ts_.times_, i + 1, ts_.data_); 
    117119                        } catch { 
    118                             // if the target interpolation is not usable yet 
     120                            if (!ts_.interpolator_.global) 
     121                                throw; // no chance to fix it in a later iteration 
     122 
     123                            // otherwise, if the target interpolation is not usable yet 
    119124                           ts_.interpolation_ = new Linear().interpolate(ts_.times_, i + 1, ts_.data_); 
    120125                        }