def _sample_chain(args):
n, idx = args       <EOL>center = sampler.center<EOL>np.random.seed((sampler._seed + idx) % np.iinfo(np.int32).max)<EOL>pi = np.random.randint(sampler.n_warmup)<EOL>prev = sampler.warmup[pi, ]<EOL>prev = step(sampler, center, prev - center, <NUM_LIT>)<EOL>n_samples = max(sampler.n_samples, <NUM_LIT:1>)<EOL>samples = np.zeros((n, center.shape[<NUM_LIT:0>]))<EOL>for i in range(<NUM_LIT:1>, sampler.thinning * n + <NUM_LIT:1>):<EOL><INDENT>pi = np.random.randint(sampler.n_warmup)<EOL>delta = sampler.warmup[pi, ] - center<EOL>prev = step(sampler, prev, delta)<EOL>if sampler.problem.homogeneous and (<EOL>n_samples * sampler.thinning % sampler.nproj == <NUM_LIT:0>):<EOL><INDENT>prev = sampler._reproject(prev)<EOL>center = sampler._reproject(center)<EOL><DEDENT>if i % sampler.thinning == <NUM_LIT:0>:<EOL><INDENT>samples[i//sampler.thinning - <NUM_LIT:1>, ] = prev<EOL><DEDENT>center = ((n_samples * center) / (n_samples + <NUM_LIT:1>) +<EOL>prev / (n_samples + <NUM_LIT:1>))<EOL>n_samples += <NUM_LIT:1><EOL><DEDENT>return (sampler.retries, samples)<EOL>
Sample a single chain for OptGPSampler.

    center and n_samples are updated locally and forgotten afterwards.