提交 dd5c1f09 编写于 作者: S stevenj

allow NULL to be passed to sobol routines to fall back on pseudo-random

darcs-hash:20070906015046-c8de0-6a3da0b8e0b19d904995ceae6c5d798568a3c301.gz
上级 0c70c0ad
......@@ -230,7 +230,7 @@ extern void nlopt_sobol_destroy(nlopt_sobol s)
/* next vector x[sdim] in Sobol sequence, with each x[i] in (0,1) */
void nlopt_sobol_next01(nlopt_sobol s, double *x)
{
if (!sobol_gen(s, x)) {
if (!s || !sobol_gen(s, x)) {
/* fall back on pseudo random numbers in the unlikely event
that we exceed 2^32-1 points */
unsigned i;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册