PathGenerator: Question relating to PathGenerator Test Case

Posted by thusitha liyanage on
URL: http://quantlib.414.s1.nabble.com/PathGenerator-Question-relating-to-PathGenerator-Test-Case-tp12466.html

Hi
Could some one please tell me the purpose of the ------for loop ------------ in the code below.

The code is in the test-suite of quantlib. The cpp file is pathgenerator.cpp.

------------------------------------------
        for (i=0; i<100; i++)
            generator.next();

        sample_type sample = generator.next();
        Real calculated = sample.value.back();
        Real error = std::fabs(calculated-expected);

--------------------------------------------
What I don't understand is why does it generate hundred samples, and then do the calculation of the variable ---Calculated---. Does it do some kind of averaging of all these paths?

Thanks a lot.

Thusi