Login  Register

Question on new implementation of Lattice class

Posted by Luca Berardi on Feb 25, 2005; 2:56am
URL: http://quantlib.414.s1.nabble.com/Possible-problem-on-bermuda-swaptions-2-tp3621p3625.html


Hi

I have a question on the new Lattice implementation, regarding the
rollback method:

- in QuantLib 0.3.7 in the implementation of the rollAlmostBack()
  method we have the following lines of code:

00082         for (Integer i=iFrom-1; i>=iTo; i--) {
00083             Array newValues(size(i));
00084             stepback(i, asset->values(), newValues);
00085             asset->time() = t_[i];
00086             asset->values() = newValues;
00087             // skip the very last post-adjustment
00088             if (i != iTo)
00089                 asset->adjustValues();
00090             else
00091                 asset->preAdjustValues();
00092         }
00093     }

- in QuantLib 0.3.8, in the implementation of partialRollBack() -which
  replaces rollAlmostBack- we have the following lines of code:

00077         for (Integer i=iFrom-1; i>=iTo; i--) {
00078             Array newValues(size(i));
00079             stepback(i, asset.values(), newValues);
00080             asset.time() = t_[i];
00081             asset.values() = newValues;
00082             // skip the very last adjustment
00083             if (i != iTo)
00084                 asset.adjustValues();
00085         }
00086     }

It seems that the 'else' section of code has been thrown away, while
the implementation of the rollBack() method has remained the same
between the two releases.

Is there any particular reason for this? Shouldn't it be a source of
mismatch between the two QuantLib releases?

Ciao,
Luca



__________________________________________________________________
Tiscali Adsl 3 Mega Flat, 3 MESI GRATIS!
Con Tiscali Adsl 3 Mega Flat navighi in Rete alla supervelocita'
a soli 29.95 euro al mese senza limiti di tempo. Attivati entro
il 28 Febbraio 2005, 3 MESI sono GRATIS
Scopri come http://abbonati.tiscali.it/adsl/sa/2flat_tc/