From: stevenj Date: Wed, 2 Jun 2010 03:50:21 +0000 (-0400) Subject: added fortran wrapper for nlopt_copy X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=54c41b01b414c55f338a99df4efc87beda7275b3;p=nlopt.git added fortran wrapper for nlopt_copy darcs-hash:20100602035021-c8de0-d1fabb203b45275b539e487a4868933cf9551be9.gz --- diff --git a/api/f77funcs_.h b/api/f77funcs_.h index 61e29df..bac7e82 100644 --- a/api/f77funcs_.h +++ b/api/f77funcs_.h @@ -40,6 +40,15 @@ void F77_(nlo_create,NLO_CREATE)(nlopt_opt *opt, int *alg, int *n) } } +void F77_(nlo_copy,NLO_COPY)(nlopt_opt *nopt, nlopt_opt *opt) +{ + *nopt = nlopt_copy(*opt); + if (*nopt && nlopt_dup_f_data(*nopt, sizeof(f77_func_data)) < 0) { + nlopt_destroy(*nopt); + *nopt = NULL; + } +} + void F77_(nlo_destroy,NLO_DESTROY)(nlopt_opt *opt) { nlopt_destroy(*opt);