private Sample <IPath> next(bool antithetic)
{
Sample <List <double> > sequence_ =
antithetic
? generator_.lastSequence()
: generator_.nextSequence();
if (brownianBridge_)
{
bb_.transform(sequence_.value, temp_);
}
else
{
temp_ = new List <double>(sequence_.value);
}
next_.weight = sequence_.weight;
Path path = (Path)next_.value;
path.setFront(process_.x0());
for (int i = 1; i < path.length(); i++)
{
double t = timeGrid_[i - 1];
double dt = timeGrid_.dt(i - 1);
path[i] = process_.evolve(t, path[i - 1], dt,
antithetic
? -temp_[i - 1]
: temp_[i - 1]);
}
return(next_);
}