Login  Register

Bug in MCAmericanBasketEngine class

Posted by Joseph Wang on Oct 09, 2005; 10:13am
URL: http://quantlib.414.s1.nabble.com/Bug-in-MCAmericanBasketEngine-class-tp4110.html

Can you add the following lines and see if it fixes things....

If it works I'll write a regression test case for it, and check it into CVS.

        std::vector<MultiPath> multipaths(N);
        for (i=0; i<N/2; i++) {
            multipaths[i] = multipathGenerator->next().value;
            multipaths[N/2+i] = multipathGenerator->antithetic().value;
        }
        // Add an extra path if N is odd
        if (N % 2 == 1) {
            multipaths[N-1] = multipathGenerator->next().value;
        }