New Upstream Snapshot - r-cran-nloptr

Ready changes

Summary

Merged new upstream version: 2.0.3+git20221223.1.8426ada (was: 2.0.3).

Resulting package

Built on 2023-01-04T06:52 (took 7m5s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots r-cran-nloptr-dbgsymapt install -t fresh-snapshots r-cran-nloptr

Diff

diff --git a/DESCRIPTION b/DESCRIPTION
index 1272f5d..e85a836 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
 Package: nloptr
 Type: Package
 Title: R Interface to NLopt
-Version: 2.0.3
+Version: 2.0.3.9000
 Authors@R: c(person("Jelmer", "Ypma", role = "aut",
                     email = "uctpjyy@ucl.ac.uk"),
              person(c("Steven", "G."), "Johnson", role = "aut",
@@ -43,6 +43,7 @@ SystemRequirements: cmake (>= 3.2.0) which is used only on Linux or
         found.
 Biarch: true
 Encoding: UTF-8
+Roxygen: list(markdown = TRUE)
 RoxygenNote: 7.2.0
 LinkingTo: testthat
 Suggests: knitr, rmarkdown, xml2, testthat (>= 3.0.0), covr
@@ -52,7 +53,7 @@ URL: https://astamm.github.io/nloptr/index.html,
         https://github.com/astamm/nloptr
 BugReports: https://github.com/astamm/nloptr/issues
 NeedsCompilation: yes
-Packaged: 2022-05-26 14:40:24 UTC; stamm-a
+Packaged: 2023-01-04 06:50:36 UTC; root
 Author: Jelmer Ypma [aut],
   Steven G. Johnson [aut] (author of the NLopt C library),
   Hans W. Borchers [ctb],
@@ -66,5 +67,3 @@ Author: Jelmer Ypma [aut],
   Aymeric Stamm [ctb, cre] (<https://orcid.org/0000-0002-8725-3654>),
   Jeroen Ooms [ctb]
 Maintainer: Aymeric Stamm <aymeric.stamm@math.cnrs.fr>
-Repository: CRAN
-Date/Publication: 2022-05-26 15:40:02 UTC
diff --git a/MD5 b/MD5
deleted file mode 100644
index fd31455..0000000
--- a/MD5
+++ /dev/null
@@ -1,98 +0,0 @@
-ac6c9ebde8dc6f0e263ec5234357240e *DESCRIPTION
-be48e9fa0b8b1abf0e1f056a6acc4897 *NAMESPACE
-e591593d8f3f923db806766f921d9ece *NEWS.md
-9f9c64ce7426755648d13920c7be8016 *R/auglag.R
-5e3ed98c6d49e80090fbaa171f3d9519 *R/catch-routine-registration.R
-d4073e3a0a61fa6d19bb7730468fd1f9 *R/ccsaq.R
-4c84dc90a0176288be6fbb1886f0306e *R/check.derivatives.R
-c9cb46511b9541e77f6ec5401403c647 *R/cobyla.R
-28734803a9e44247faae80a8cd0051b0 *R/direct.R
-dbf282d13f1b7d6013f6620cef2b65b9 *R/finite.diff.R
-246c852ce7e38ea0015cbdb63e07e36e *R/global.R
-4ef55efcb36e0c998a81407760faee16 *R/gradients.R
-c263a6e948d89ad3d3c3efc8454c1b59 *R/is.nloptr.R
-21b4897ed960cb174c1232f72d1ce1e7 *R/lbfgs.R
-eaf6a9e647dc10d2b707005b00cf3a25 *R/mlsl.R
-0ad1e8029a2f4080bb1050503ba94ed2 *R/mma.R
-bdff130737159419f533c52a6e0bd5d8 *R/nloptions.R
-dcd993a80d69e92e8ac11fca39cf380f *R/nloptr-package.R
-b86d946d8cc3f51faa4556aeb209c105 *R/nloptr.R
-f676ae75715bb07df93a02b90bd8f767 *R/nloptr.add.default.options.R
-1eb5725295c429f3aeb9961873d6b721 *R/nloptr.get.default.options.R
-07c8515f67370ba2615005be11dc8761 *R/nloptr.print.options.R
-f0208a26d2bb3084c6cf0a5d11bc9ed1 *R/nm.R
-4c658b2f5f37e42ac204fd210ffa0946 *R/print.nloptr.R
-c1dd5ff868df520f0e153a63a8b13c87 *R/slsqp.R
-a29b8a04e5329071c08281d28256b313 *R/tnewton.R
-96e6f0589e6b5cd1e690d26c530c49e6 *R/varmetric.R
-7393af449aca2479a40304ea72987eca *R/zzz.R
-8feb599f31d8716e017658bcf8aa8662 *README.md
-f6485893f632cf986ed31e93bc14134e *build/vignette.rds
-41b24a7410fc707ea978acd5073dc371 *cleanup
-88d2e07eb4d1d112ccac8a205e2dc9de *configure
-91b535fa365c497602f8923cbe338a62 *configure.ac
-1a58668226404dc404de4f2cad195c25 *inst/CITATION
-3eeb5d3f28654b357f487e3a08f495c4 *inst/doc/nloptr.R
-7ee5ccda2bac7b383362a446fdb010af *inst/doc/nloptr.Rmd
-02a9310044de75e00892f1521704f571 *inst/doc/nloptr.html
-43c93d3a0ca355cc16a0f64117216cba *inst/include/nlopt.f
-e3e3187995f39f8b9ef632a82a8013a9 *inst/include/nlopt.h
-b6613ad3b69f214e64cbdefb4d4c80ff *inst/include/nlopt.hpp
-8ff1729153f0592dcaa284f4471b228d *inst/include/nloptrAPI.h
-eeb67ca871af36b510f59dd97a9514df *man/auglag.Rd
-1041107e1c12264f995db8d4f5f180cf *man/bobyqa.Rd
-f7c0de12413e406d5fe49ef472148c85 *man/ccsaq.Rd
-ea96e2dedbc761020c21230c86ee87cd *man/check.derivatives.Rd
-9a6fb6427306bea15140b523927ba4ec *man/cobyla.Rd
-6f55e3a195d7e84e4dd0bf28bfb175fd *man/crs2lm.Rd
-9f89dccc44f67b770c0868d73590e3d3 *man/direct.Rd
-123679eb319498c0be11dbe28628bb58 *man/figures/logo.png
-5a891bdeb9abfabfd687355e7a4f2c06 *man/is.nloptr.Rd
-0f39c84d9aa3d2210e6e8cd1cd53d143 *man/isres.Rd
-b675fa70215d93bb39c1c9d4cf26e3b9 *man/lbfgs.Rd
-651caa3492b272bc6ae0e0dcc1b5e9b6 *man/mlsl.Rd
-a3653f91b27e19fa419999b5457e7ff4 *man/mma.Rd
-2a921e93e033e85030b31e7837b4be45 *man/neldermead.Rd
-445cbd1bca6e021a42845097fb0e8ee4 *man/newuoa.Rd
-192a32e61a31d3d758e06b671226ef1d *man/nl.grad.Rd
-b0e622c84af36c9bc7b6addbba5bdd16 *man/nl.opts.Rd
-e82449bc507c283b5e68b5e27b0ce141 *man/nloptr-package.Rd
-b940f09383e5ee761ab2a0723d97b184 *man/nloptr.Rd
-ee1e5366588c505e06b6d586f3985d37 *man/nloptr.get.default.options.Rd
-56c5ae518d79fa194395ff32443fd3e3 *man/nloptr.print.options.Rd
-003fcedd0363f020719bc43a20683d3c *man/print.nloptr.Rd
-110ae0cbb46f506712c36be614ec613a *man/sbplx.Rd
-7c0438d0d953d4454fc1d6c72370fd71 *man/slsqp.Rd
-2ad85aaf9dfd419184d6328bab79c41f *man/stogo.Rd
-414463d78d5c2c05c38d507c103b57cb *man/tnewton.Rd
-1e802d3df895689f8be1ef805a034f11 *man/varmetric.Rd
-9bf8a8797d678f04828f2c2f7928ba7b *src/Makevars.in
-92570059fadbb65617ac547b0655c139 *src/Makevars.ucrt
-d89c8598683bdbc4184169d1432db9d7 *src/Makevars.win
-89eeb946ea3c73663fbc062b417d3f53 *src/init_nloptr.c
-8fb4dca31069c62bad33d7e0062625a9 *src/nlopt-src.tar.gz
-cad1acafb68d545432099791aa0b26f1 *src/nloptr.c
-867bc65d88b222ba5c42e0337359ff12 *src/nloptr.h
-a58996e86f011b1556327750466bcba1 *src/scripts/cmake_config.sh
-53ed6c22d808fde48f2eca0d83fc5a15 *src/scripts/nlopt_cleanup.sh
-9792b873cb51bce028346abb20bacf89 *src/scripts/nlopt_download.sh
-3fd0eb363669e71650dfe0834fb09258 *src/scripts/r_config.sh
-f0f7a417b7a0929cd63ebbbc07f9dacf *src/test-C-API.cpp
-47e11cfb6e87798c519cd2b22d77d038 *src/test-C-API.h
-c2cb0c30e10da611f9fbe56aea52f7a9 *src/test-runner.cpp
-14fd9cf9fbc99e70b8536f1e7d2f46b4 *tests/testthat.R
-4499b82165bee846fa5f47a9c82ad4bb *tests/testthat/test-banana-global.R
-bf906becef16bf0471b21594e00b25a3 *tests/testthat/test-banana.R
-fec1ce0f60281ca400d902d713f1faeb *tests/testthat/test-cpp.R
-cd2a5e68a1a0580421a2c4325bd5727f *tests/testthat/test-derivative-checker.R
-c311b99430aa9b7a2f25c0fe7a79a1e1 *tests/testthat/test-example.R
-f4d2f853c33b7f53cc63e76f77c51471 *tests/testthat/test-hs023.R
-043f3cf4cebed0d838b1ee68eb639e98 *tests/testthat/test-hs071.R
-5ac755d9e182c871dd2232537f693514 *tests/testthat/test-options-maxtime.R
-b53872ed46bc14794095ccd93a519ed5 *tests/testthat/test-parameters.R
-d0741adf6843a7b12f1fd87855808b5d *tests/testthat/test-simple.R
-64d6d932023594ae719aa2f05d93194a *tests/testthat/test-systemofeq.R
-3d32f40277d6c3df719b54368ae08a61 *tools/cmake_call.sh
-0e377c2bef61f13be9df61bcfb9b9d8c *tools/winlibs.R
-7ee5ccda2bac7b383362a446fdb010af *vignettes/nloptr.Rmd
-5dd9d4e23df596afc489451e4453f6bc *vignettes/reflist.bib
diff --git a/NEWS.md b/NEWS.md
index ee4154f..8dd1c26 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,5 @@
+# nloptr 2.0.3.9000
+
 # nloptr 2.0.3
 
 * Improved compatibility on RHEL/CentOS by first searching for a `cmake3` binary
diff --git a/R/is.nloptr.R b/R/is.nloptr.R
index eb389b7..d1a34be 100644
--- a/R/is.nloptr.R
+++ b/R/is.nloptr.R
@@ -95,7 +95,7 @@ is.nloptr <- function( x ) {
         }
 
     } else {
-        if ( is.na( f0 ) ) { stop('objective in x0 returns NA') }
+        if (any( is.na( f0 ) )) { stop('objective in x0 returns NA') }
 
         # check whether algorihtm needs a derivative
         if ( x$options$algorithm %in% list_algorithmsD ) {
diff --git a/R/nloptions.R b/R/nloptions.R
index 4f138f9..879e115 100644
--- a/R/nloptions.R
+++ b/R/nloptions.R
@@ -35,36 +35,31 @@
 #'
 #' nl.opts(list(xtol_rel = 1e-8, maxeval = 2000))
 #'
-nl.opts <-
-    function(optlist = NULL)
-    {
-        opts <- list(stopval = -Inf,        # stop minimization at this value
-                     xtol_rel = 1e-6,       # stop on small optimization step
-                 maxeval = 1000,        # stop on this many function evaluations
-                 ftol_rel = 0.0,        # stop on change times function value
-                 ftol_abs = 0.0,        # stop on small change of function value
-                 check_derivatives = FALSE,
-                 algorithm = NULL       # will be filled by each single function
-                )
+nl.opts <- function(optlist = NULL) {
+  opts <- list(
+    stopval = -Inf,            # stop minimization at this value
+    xtol_rel = 1e-6,           # stop on small optimization step
+    maxeval = 1000,            # stop on this many function evaluations
+    ftol_rel = 0.0,            # stop on change times function value
+    ftol_abs = 0.0,            # stop on small change of function value
+    check_derivatives = FALSE,
+    algorithm = NULL           # will be filled by each single function
+  )
 
-    if (is.null(optlist))
-        return(opts)
+  if (is.null(optlist)) return(opts)
 
-    if (!is.list(optlist) || "" %in% names(optlist))
-        stop("Argument 'optlist' must be a list of named (character) objects.")
+  if (!is.list(optlist) || "" %in% names(optlist))
+    stop("Argument `optlist` must be a named list.")
 
-    namc <- match.arg(names(optlist), choices=names(opts), several.ok=TRUE)
-    if (!all(names(optlist) %in% names(opts)))
-        warning("Unknown names in control: ",
-                names(optlist)[!(names(optlist) %in% names(opts))])
+  for (option_name in names(optlist))
+    opts[[option_name]] <- optlist[[option_name]]
 
-    if (!is.null(namc))
-        opts[namc] <- optlist[namc]
+  if (!is.null(opts[["algorithm"]])) {
+    warning(
+      "Option `algorithm` cannot be set here. It will be overwritten."
+    )
+    opts[["algorithm"]] <- NULL
+  }
 
-    if ("algorithm" %in% namc) {
-        warning("Option 'algorithm can not be set here; will be overwritten.")
-        opts["algorithm"] <- NULL
-    }
-
-    return(opts)
+  opts
 }
diff --git a/R/nloptr.get.default.options.R b/R/nloptr.get.default.options.R
index e36742e..5054bec 100644
--- a/R/nloptr.get.default.options.R
+++ b/R/nloptr.get.default.options.R
@@ -149,6 +149,12 @@ nloptr.get.default.options <-
 		  "0",
 		  FALSE,
 		  "Several of the stochastic search algorithms (e.g., CRS, MLSL, and ISRES) start by generating some initial population of random points x. By default, this initial population size is chosen heuristically in some algorithm-specific way, but the initial population can by changed by setting a positive integer value for population. A population of zero implies that the heuristic default will be used."),
+		c("vector_storage",
+		  "integer",
+		  "vector_storage is a positive integer",
+		  "20",
+		  FALSE,
+		  "Number of gradients to remember from previous optimization steps."),
 		c("ranseed",
 		  "integer",
 		  "ranseed is a positive integer",
diff --git a/build/vignette.rds b/build/vignette.rds
index ff9b906..8429790 100644
Binary files a/build/vignette.rds and b/build/vignette.rds differ
diff --git a/debian/changelog b/debian/changelog
index 0672c31..4449395 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+r-cran-nloptr (2.0.3+git20221223.1.8426ada-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Wed, 04 Jan 2023 06:50:41 -0000
+
 r-cran-nloptr (2.0.3-1) unstable; urgency=medium
 
   * New upstream release
diff --git a/inst/doc/nloptr.html b/inst/doc/nloptr.html
index 427ad54..022510c 100644
--- a/inst/doc/nloptr.html
+++ b/inst/doc/nloptr.html
@@ -12,7 +12,7 @@
 
 <meta name="author" content="Jelmer Ypma" />
 
-<meta name="date" content="2022-05-26" />
+<meta name="date" content="2023-01-04" />
 
 <title>Introduction to nloptr: an R interface to NLopt</title>
 
@@ -88,7 +88,7 @@ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
 code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
 code span.at { color: #7d9029; } /* Attribute */
 code span.bn { color: #40a070; } /* BaseN */
-code span.bu { } /* BuiltIn */
+code span.bu { color: #008000; } /* BuiltIn */
 code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
 code span.ch { color: #4070a0; } /* Char */
 code span.cn { color: #880000; } /* Constant */
@@ -101,7 +101,7 @@ code span.er { color: #ff0000; font-weight: bold; } /* Error */
 code span.ex { } /* Extension */
 code span.fl { color: #40a070; } /* Float */
 code span.fu { color: #06287e; } /* Function */
-code span.im { } /* Import */
+code span.im { color: #008000; font-weight: bold; } /* Import */
 code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
 code span.kw { color: #007020; font-weight: bold; } /* Keyword */
 code span.op { color: #666666; } /* Operator */
@@ -122,13 +122,20 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
   for (var i = 0; i < sheets.length; i++) {
     if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
     try { var rules = sheets[i].cssRules; } catch (e) { continue; }
-    for (var j = 0; j < rules.length; j++) {
+    var j = 0;
+    while (j < rules.length) {
       var rule = rules[j];
       // check if there is a div.sourceCode rule
-      if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") continue;
+      if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") {
+        j++;
+        continue;
+      }
       var style = rule.style.cssText;
       // check if color or background-color is set
-      if (rule.style.color === '' && rule.style.backgroundColor === '') continue;
+      if (rule.style.color === '' && rule.style.backgroundColor === '') {
+        j++;
+        continue;
+      }
       // replace div.sourceCode by a pre.sourceCode rule
       sheets[i].deleteRule(j);
       sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
@@ -357,7 +364,7 @@ code > span.er { color: #a61717; background-color: #e3d2d2; }
 <h1 class="title toc-ignore">Introduction to <code>nloptr</code>: an R
 interface to NLopt<a href="#fn1" class="footnote-ref" id="fnref1"><sup>1</sup></a></h1>
 <h4 class="author">Jelmer Ypma</h4>
-<h4 class="date">2022-05-26</h4>
+<h4 class="date">2023-01-04</h4>
 
 
 
@@ -1047,6 +1054,12 @@ problem.</p>
 ##  changed by setting a positive integer value for population. A
 ##  population of zero implies that the heuristic default will be used.
 ## 
+## vector_storage
+##  possible values: vector_storage is a positive integer
+##  default value:   20
+## 
+##  Number of gradients to remember from previous optimization steps.
+## 
 ## ranseed
 ##  possible values: ranseed is a positive integer
 ##  default value:   0
diff --git a/inst/include/nlopt.f b/inst/include/nlopt.f
deleted file mode 100644
index 556454a..0000000
--- a/inst/include/nlopt.f
+++ /dev/null
@@ -1,110 +0,0 @@
-      integer NLOPT_GN_DIRECT
-      parameter (NLOPT_GN_DIRECT=0)
-      integer NLOPT_GN_DIRECT_L
-      parameter (NLOPT_GN_DIRECT_L=1)
-      integer NLOPT_GN_DIRECT_L_RAND
-      parameter (NLOPT_GN_DIRECT_L_RAND=2)
-      integer NLOPT_GN_DIRECT_NOSCAL
-      parameter (NLOPT_GN_DIRECT_NOSCAL=3)
-      integer NLOPT_GN_DIRECT_L_NOSCAL
-      parameter (NLOPT_GN_DIRECT_L_NOSCAL=4)
-      integer NLOPT_GN_DIRECT_L_RAND_NOSCAL
-      parameter (NLOPT_GN_DIRECT_L_RAND_NOSCAL=5)
-      integer NLOPT_GN_ORIG_DIRECT
-      parameter (NLOPT_GN_ORIG_DIRECT=6)
-      integer NLOPT_GN_ORIG_DIRECT_L
-      parameter (NLOPT_GN_ORIG_DIRECT_L=7)
-      integer NLOPT_GD_STOGO
-      parameter (NLOPT_GD_STOGO=8)
-      integer NLOPT_GD_STOGO_RAND
-      parameter (NLOPT_GD_STOGO_RAND=9)
-      integer NLOPT_LD_LBFGS_NOCEDAL
-      parameter (NLOPT_LD_LBFGS_NOCEDAL=10)
-      integer NLOPT_LD_LBFGS
-      parameter (NLOPT_LD_LBFGS=11)
-      integer NLOPT_LN_PRAXIS
-      parameter (NLOPT_LN_PRAXIS=12)
-      integer NLOPT_LD_VAR1
-      parameter (NLOPT_LD_VAR1=13)
-      integer NLOPT_LD_VAR2
-      parameter (NLOPT_LD_VAR2=14)
-      integer NLOPT_LD_TNEWTON
-      parameter (NLOPT_LD_TNEWTON=15)
-      integer NLOPT_LD_TNEWTON_RESTART
-      parameter (NLOPT_LD_TNEWTON_RESTART=16)
-      integer NLOPT_LD_TNEWTON_PRECOND
-      parameter (NLOPT_LD_TNEWTON_PRECOND=17)
-      integer NLOPT_LD_TNEWTON_PRECOND_RESTART
-      parameter (NLOPT_LD_TNEWTON_PRECOND_RESTART=18)
-      integer NLOPT_GN_CRS2_LM
-      parameter (NLOPT_GN_CRS2_LM=19)
-      integer NLOPT_GN_MLSL
-      parameter (NLOPT_GN_MLSL=20)
-      integer NLOPT_GD_MLSL
-      parameter (NLOPT_GD_MLSL=21)
-      integer NLOPT_GN_MLSL_LDS
-      parameter (NLOPT_GN_MLSL_LDS=22)
-      integer NLOPT_GD_MLSL_LDS
-      parameter (NLOPT_GD_MLSL_LDS=23)
-      integer NLOPT_LD_MMA
-      parameter (NLOPT_LD_MMA=24)
-      integer NLOPT_LN_COBYLA
-      parameter (NLOPT_LN_COBYLA=25)
-      integer NLOPT_LN_NEWUOA
-      parameter (NLOPT_LN_NEWUOA=26)
-      integer NLOPT_LN_NEWUOA_BOUND
-      parameter (NLOPT_LN_NEWUOA_BOUND=27)
-      integer NLOPT_LN_NELDERMEAD
-      parameter (NLOPT_LN_NELDERMEAD=28)
-      integer NLOPT_LN_SBPLX
-      parameter (NLOPT_LN_SBPLX=29)
-      integer NLOPT_LN_AUGLAG
-      parameter (NLOPT_LN_AUGLAG=30)
-      integer NLOPT_LD_AUGLAG
-      parameter (NLOPT_LD_AUGLAG=31)
-      integer NLOPT_LN_AUGLAG_EQ
-      parameter (NLOPT_LN_AUGLAG_EQ=32)
-      integer NLOPT_LD_AUGLAG_EQ
-      parameter (NLOPT_LD_AUGLAG_EQ=33)
-      integer NLOPT_LN_BOBYQA
-      parameter (NLOPT_LN_BOBYQA=34)
-      integer NLOPT_GN_ISRES
-      parameter (NLOPT_GN_ISRES=35)
-      integer NLOPT_AUGLAG
-      parameter (NLOPT_AUGLAG=36)
-      integer NLOPT_AUGLAG_EQ
-      parameter (NLOPT_AUGLAG_EQ=37)
-      integer NLOPT_G_MLSL
-      parameter (NLOPT_G_MLSL=38)
-      integer NLOPT_G_MLSL_LDS
-      parameter (NLOPT_G_MLSL_LDS=39)
-      integer NLOPT_LD_SLSQP
-      parameter (NLOPT_LD_SLSQP=40)
-      integer NLOPT_LD_CCSAQ
-      parameter (NLOPT_LD_CCSAQ=41)
-      integer NLOPT_GN_ESCH
-      parameter (NLOPT_GN_ESCH=42)
-      integer NLOPT_GN_AGS
-      parameter (NLOPT_GN_AGS=43)
-      integer NLOPT_FAILURE
-      parameter (NLOPT_FAILURE=-1)
-      integer NLOPT_INVALID_ARGS
-      parameter (NLOPT_INVALID_ARGS=-2)
-      integer NLOPT_OUT_OF_MEMORY
-      parameter (NLOPT_OUT_OF_MEMORY=-3)
-      integer NLOPT_ROUNDOFF_LIMITED
-      parameter (NLOPT_ROUNDOFF_LIMITED=-4)
-      integer NLOPT_FORCED_STOP
-      parameter (NLOPT_FORCED_STOP=-5)
-      integer NLOPT_SUCCESS
-      parameter (NLOPT_SUCCESS=1)
-      integer NLOPT_STOPVAL_REACHED
-      parameter (NLOPT_STOPVAL_REACHED=2)
-      integer NLOPT_FTOL_REACHED
-      parameter (NLOPT_FTOL_REACHED=3)
-      integer NLOPT_XTOL_REACHED
-      parameter (NLOPT_XTOL_REACHED=4)
-      integer NLOPT_MAXEVAL_REACHED
-      parameter (NLOPT_MAXEVAL_REACHED=5)
-      integer NLOPT_MAXTIME_REACHED
-      parameter (NLOPT_MAXTIME_REACHED=6)
diff --git a/inst/include/nlopt.h b/inst/include/nlopt.h
deleted file mode 100644
index 4f6fb14..0000000
--- a/inst/include/nlopt.h
+++ /dev/null
@@ -1,350 +0,0 @@
-/* Copyright (c) 2007-2014 Massachusetts Institute of Technology
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef NLOPT_H
-#define NLOPT_H
-
-#include <stddef.h>             /* for ptrdiff_t and size_t */
-
-/* Change 0 to 1 to use stdcall convention under Win32 */
-#if 0 && (defined(_WIN32) || defined(__WIN32__))
-#  if defined(__GNUC__)
-#    define NLOPT_STDCALL __attribute__((stdcall))
-#  elif defined(_MSC_VER) || defined(_ICC) || defined(_STDCALL_SUPPORTED)
-#    define NLOPT_STDCALL __stdcall
-#  else
-#    define NLOPT_STDCALL
-#  endif
-#else
-#  define NLOPT_STDCALL
-#endif
-
-/* for Windows compilers, you should add a line
-           #define NLOPT_DLL
-   when using NLopt from a DLL, in order to do the proper
-   Windows importing nonsense. */
-#if defined(NLOPT_DLL) && (defined(_WIN32) || defined(__WIN32__)) && !defined(__LCC__)
-/* annoying Windows syntax for calling functions in a DLL */
-#  if defined(NLOPT_DLL_EXPORT)
-#    define NLOPT_EXTERN(T) extern __declspec(dllexport) T NLOPT_STDCALL
-#  else
-#    define NLOPT_EXTERN(T) extern __declspec(dllimport) T NLOPT_STDCALL
-#  endif
-#else
-#  define NLOPT_EXTERN(T) extern T NLOPT_STDCALL
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-typedef double (*nlopt_func) (unsigned n, const double *x,
-                              double *gradient, /* NULL if not needed */
-                              void *func_data);
-
-typedef void (*nlopt_mfunc) (unsigned m, double *result, unsigned n, const double *x,
-                             double *gradient, /* NULL if not needed */
-                             void *func_data);
-
-/* A preconditioner, which preconditions v at x to return vpre.
-   (The meaning of "preconditioning" is algorithm-dependent.) */
-typedef void (*nlopt_precond) (unsigned n, const double *x, const double *v, double *vpre, void *data);
-
-typedef enum {
-    /* Naming conventions:
-
-       NLOPT_{G/L}{D/N}_*
-       = global/local derivative/no-derivative optimization,
-       respectively
-
-       *_RAND algorithms involve some randomization.
-
-       *_NOSCAL algorithms are *not* scaled to a unit hypercube
-       (i.e. they are sensitive to the units of x)
-     */
-
-    NLOPT_GN_DIRECT = 0,
-    NLOPT_GN_DIRECT_L,
-    NLOPT_GN_DIRECT_L_RAND,
-    NLOPT_GN_DIRECT_NOSCAL,
-    NLOPT_GN_DIRECT_L_NOSCAL,
-    NLOPT_GN_DIRECT_L_RAND_NOSCAL,
-
-    NLOPT_GN_ORIG_DIRECT,
-    NLOPT_GN_ORIG_DIRECT_L,
-
-    NLOPT_GD_STOGO,
-    NLOPT_GD_STOGO_RAND,
-
-    NLOPT_LD_LBFGS_NOCEDAL,
-
-    NLOPT_LD_LBFGS,
-
-    NLOPT_LN_PRAXIS,
-
-    NLOPT_LD_VAR1,
-    NLOPT_LD_VAR2,
-
-    NLOPT_LD_TNEWTON,
-    NLOPT_LD_TNEWTON_RESTART,
-    NLOPT_LD_TNEWTON_PRECOND,
-    NLOPT_LD_TNEWTON_PRECOND_RESTART,
-
-    NLOPT_GN_CRS2_LM,
-
-    NLOPT_GN_MLSL,
-    NLOPT_GD_MLSL,
-    NLOPT_GN_MLSL_LDS,
-    NLOPT_GD_MLSL_LDS,
-
-    NLOPT_LD_MMA,
-
-    NLOPT_LN_COBYLA,
-
-    NLOPT_LN_NEWUOA,
-    NLOPT_LN_NEWUOA_BOUND,
-
-    NLOPT_LN_NELDERMEAD,
-    NLOPT_LN_SBPLX,
-
-    NLOPT_LN_AUGLAG,
-    NLOPT_LD_AUGLAG,
-    NLOPT_LN_AUGLAG_EQ,
-    NLOPT_LD_AUGLAG_EQ,
-
-    NLOPT_LN_BOBYQA,
-
-    NLOPT_GN_ISRES,
-
-    /* new variants that require local_optimizer to be set,
-       not with older constants for backwards compatibility */
-    NLOPT_AUGLAG,
-    NLOPT_AUGLAG_EQ,
-    NLOPT_G_MLSL,
-    NLOPT_G_MLSL_LDS,
-
-    NLOPT_LD_SLSQP,
-
-    NLOPT_LD_CCSAQ,
-
-    NLOPT_GN_ESCH,
-
-    NLOPT_GN_AGS,
-
-    NLOPT_NUM_ALGORITHMS        /* not an algorithm, just the number of them */
-} nlopt_algorithm;
-
-NLOPT_EXTERN(const char *) nlopt_algorithm_name(nlopt_algorithm a);
-
-/* nlopt_algorithm enum <-> string conversion */
-NLOPT_EXTERN(const char *) nlopt_algorithm_to_string(nlopt_algorithm algorithm);
-NLOPT_EXTERN(nlopt_algorithm) nlopt_algorithm_from_string(const char *name);
-
-typedef enum {
-    NLOPT_FAILURE = -1,         /* generic failure code */
-    NLOPT_INVALID_ARGS = -2,
-    NLOPT_OUT_OF_MEMORY = -3,
-    NLOPT_ROUNDOFF_LIMITED = -4,
-    NLOPT_FORCED_STOP = -5,
-    NLOPT_NUM_FAILURES = -6,    /* not a result, just the number of possible failures */
-    NLOPT_SUCCESS = 1,          /* generic success code */
-    NLOPT_STOPVAL_REACHED = 2,
-    NLOPT_FTOL_REACHED = 3,
-    NLOPT_XTOL_REACHED = 4,
-    NLOPT_MAXEVAL_REACHED = 5,
-    NLOPT_MAXTIME_REACHED = 6,
-    NLOPT_NUM_RESULTS           /* not a result, just the number of possible successes */
-} nlopt_result;
-
-/* nlopt_result enum <-> string conversion */
-NLOPT_EXTERN(const char *) nlopt_result_to_string(nlopt_result algorithm);
-NLOPT_EXTERN(nlopt_result) nlopt_result_from_string(const char *name);
-
-#define NLOPT_MINF_MAX_REACHED NLOPT_STOPVAL_REACHED
-
-NLOPT_EXTERN(void) nlopt_srand(unsigned long seed);
-NLOPT_EXTERN(void) nlopt_srand_time(void);
-
-NLOPT_EXTERN(void) nlopt_version(int *major, int *minor, int *bugfix);
-
-/*************************** OBJECT-ORIENTED API **************************/
-/* The style here is that we create an nlopt_opt "object" (an opaque pointer),
-   then set various optimization parameters, and then execute the
-   algorithm.  In this way, we can add more and more optimization parameters
-   (including algorithm-specific ones) without breaking backwards
-   compatibility, having functions with zillions of parameters, or
-   relying non-reentrantly on global variables.*/
-
-struct nlopt_opt_s;             /* opaque structure, defined internally */
-typedef struct nlopt_opt_s *nlopt_opt;
-
-/* the only immutable parameters of an optimization are the algorithm and
-   the dimension n of the problem, since changing either of these could
-   have side-effects on lots of other parameters */
-NLOPT_EXTERN(nlopt_opt) nlopt_create(nlopt_algorithm algorithm, unsigned n);
-NLOPT_EXTERN(void) nlopt_destroy(nlopt_opt opt);
-NLOPT_EXTERN(nlopt_opt) nlopt_copy(const nlopt_opt opt);
-
-NLOPT_EXTERN(nlopt_result) nlopt_optimize(nlopt_opt opt, double *x, double *opt_f);
-
-NLOPT_EXTERN(nlopt_result) nlopt_set_min_objective(nlopt_opt opt, nlopt_func f, void *f_data);
-NLOPT_EXTERN(nlopt_result) nlopt_set_max_objective(nlopt_opt opt, nlopt_func f, void *f_data);
-
-NLOPT_EXTERN(nlopt_result) nlopt_set_precond_min_objective(nlopt_opt opt, nlopt_func f, nlopt_precond pre, void *f_data);
-NLOPT_EXTERN(nlopt_result) nlopt_set_precond_max_objective(nlopt_opt opt, nlopt_func f, nlopt_precond pre, void *f_data);
-
-NLOPT_EXTERN(nlopt_algorithm) nlopt_get_algorithm(const nlopt_opt opt);
-NLOPT_EXTERN(unsigned) nlopt_get_dimension(const nlopt_opt opt);
-
-NLOPT_EXTERN(const char *) nlopt_get_errmsg(nlopt_opt opt);
-
-/* generic algorithm parameters: */
-NLOPT_EXTERN(nlopt_result) nlopt_set_param(nlopt_opt opt, const char *name, double val);
-NLOPT_EXTERN(double) nlopt_get_param(const nlopt_opt opt, const char *name, double defaultval);
-NLOPT_EXTERN(int) nlopt_has_param(const nlopt_opt opt, const char *name);
-NLOPT_EXTERN(unsigned) nlopt_num_params(const nlopt_opt opt);
-NLOPT_EXTERN(const char *) nlopt_nth_param(const nlopt_opt opt, unsigned n);
-
-/* constraints: */
-
-NLOPT_EXTERN(nlopt_result) nlopt_set_lower_bounds(nlopt_opt opt, const double *lb);
-NLOPT_EXTERN(nlopt_result) nlopt_set_lower_bounds1(nlopt_opt opt, double lb);
-NLOPT_EXTERN(nlopt_result) nlopt_set_lower_bound(nlopt_opt opt, int i, double lb);
-NLOPT_EXTERN(nlopt_result) nlopt_get_lower_bounds(const nlopt_opt opt, double *lb);
-NLOPT_EXTERN(nlopt_result) nlopt_set_upper_bounds(nlopt_opt opt, const double *ub);
-NLOPT_EXTERN(nlopt_result) nlopt_set_upper_bounds1(nlopt_opt opt, double ub);
-NLOPT_EXTERN(nlopt_result) nlopt_set_upper_bound(nlopt_opt opt, int i, double ub);
-NLOPT_EXTERN(nlopt_result) nlopt_get_upper_bounds(const nlopt_opt opt, double *ub);
-
-NLOPT_EXTERN(nlopt_result) nlopt_remove_inequality_constraints(nlopt_opt opt);
-NLOPT_EXTERN(nlopt_result) nlopt_add_inequality_constraint(nlopt_opt opt, nlopt_func fc, void *fc_data, double tol);
-NLOPT_EXTERN(nlopt_result) nlopt_add_precond_inequality_constraint(nlopt_opt opt, nlopt_func fc, nlopt_precond pre, void *fc_data, double tol);
-NLOPT_EXTERN(nlopt_result) nlopt_add_inequality_mconstraint(nlopt_opt opt, unsigned m, nlopt_mfunc fc, void *fc_data, const double *tol);
-
-NLOPT_EXTERN(nlopt_result) nlopt_remove_equality_constraints(nlopt_opt opt);
-NLOPT_EXTERN(nlopt_result) nlopt_add_equality_constraint(nlopt_opt opt, nlopt_func h, void *h_data, double tol);
-NLOPT_EXTERN(nlopt_result) nlopt_add_precond_equality_constraint(nlopt_opt opt, nlopt_func h, nlopt_precond pre, void *h_data, double tol);
-NLOPT_EXTERN(nlopt_result) nlopt_add_equality_mconstraint(nlopt_opt opt, unsigned m, nlopt_mfunc h, void *h_data, const double *tol);
-
-/* stopping criteria: */
-
-NLOPT_EXTERN(nlopt_result) nlopt_set_stopval(nlopt_opt opt, double stopval);
-NLOPT_EXTERN(double) nlopt_get_stopval(const nlopt_opt opt);
-
-NLOPT_EXTERN(nlopt_result) nlopt_set_ftol_rel(nlopt_opt opt, double tol);
-NLOPT_EXTERN(double) nlopt_get_ftol_rel(const nlopt_opt opt);
-NLOPT_EXTERN(nlopt_result) nlopt_set_ftol_abs(nlopt_opt opt, double tol);
-NLOPT_EXTERN(double) nlopt_get_ftol_abs(const nlopt_opt opt);
-
-NLOPT_EXTERN(nlopt_result) nlopt_set_xtol_rel(nlopt_opt opt, double tol);
-NLOPT_EXTERN(double) nlopt_get_xtol_rel(const nlopt_opt opt);
-NLOPT_EXTERN(nlopt_result) nlopt_set_xtol_abs1(nlopt_opt opt, double tol);
-NLOPT_EXTERN(nlopt_result) nlopt_set_xtol_abs(nlopt_opt opt, const double *tol);
-NLOPT_EXTERN(nlopt_result) nlopt_get_xtol_abs(const nlopt_opt opt, double *tol);
-NLOPT_EXTERN(nlopt_result) nlopt_set_x_weights1(nlopt_opt opt, double w);
-NLOPT_EXTERN(nlopt_result) nlopt_set_x_weights(nlopt_opt opt, const double *w);
-NLOPT_EXTERN(nlopt_result) nlopt_get_x_weights(const nlopt_opt opt, double *w);
-
-NLOPT_EXTERN(nlopt_result) nlopt_set_maxeval(nlopt_opt opt, int maxeval);
-NLOPT_EXTERN(int) nlopt_get_maxeval(const nlopt_opt opt);
-
-NLOPT_EXTERN(int) nlopt_get_numevals(const nlopt_opt opt);
-
-NLOPT_EXTERN(nlopt_result) nlopt_set_maxtime(nlopt_opt opt, double maxtime);
-NLOPT_EXTERN(double) nlopt_get_maxtime(const nlopt_opt opt);
-
-NLOPT_EXTERN(nlopt_result) nlopt_force_stop(nlopt_opt opt);
-NLOPT_EXTERN(nlopt_result) nlopt_set_force_stop(nlopt_opt opt, int val);
-NLOPT_EXTERN(int) nlopt_get_force_stop(const nlopt_opt opt);
-
-/* more algorithm-specific parameters */
-
-NLOPT_EXTERN(nlopt_result) nlopt_set_local_optimizer(nlopt_opt opt, const nlopt_opt local_opt);
-
-NLOPT_EXTERN(nlopt_result) nlopt_set_population(nlopt_opt opt, unsigned pop);
-NLOPT_EXTERN(unsigned) nlopt_get_population(const nlopt_opt opt);
-
-NLOPT_EXTERN(nlopt_result) nlopt_set_vector_storage(nlopt_opt opt, unsigned dim);
-NLOPT_EXTERN(unsigned) nlopt_get_vector_storage(const nlopt_opt opt);
-
-NLOPT_EXTERN(nlopt_result) nlopt_set_default_initial_step(nlopt_opt opt, const double *x);
-NLOPT_EXTERN(nlopt_result) nlopt_set_initial_step(nlopt_opt opt, const double *dx);
-NLOPT_EXTERN(nlopt_result) nlopt_set_initial_step1(nlopt_opt opt, double dx);
-NLOPT_EXTERN(nlopt_result) nlopt_get_initial_step(const nlopt_opt opt, const double *x, double *dx);
-
-/* the following are functions mainly designed to be used internally
-   by the Fortran and SWIG wrappers, allow us to tel nlopt_destroy and
-   nlopt_copy to do something to the f_data pointers (e.g. free or
-   duplicate them, respectively) */
-typedef void *(*nlopt_munge) (void *p);
-NLOPT_EXTERN(void) nlopt_set_munge(nlopt_opt opt, nlopt_munge munge_on_destroy, nlopt_munge munge_on_copy);
-typedef void *(*nlopt_munge2) (void *p, void *data);
-NLOPT_EXTERN(void) nlopt_munge_data(nlopt_opt opt, nlopt_munge2 munge, void *data);
-
-/*************************** DEPRECATED API **************************/
-/* The new "object-oriented" API is preferred, since it allows us to
-   gracefully add new features and algorithm-specific options in a
-   re-entrant way, and we can automatically assume reasonable defaults
-   for unspecified parameters. */
-
-/* Where possible (e.g. for gcc >= 3.1), enable a compiler warning
-   for code that uses a deprecated function */
-#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__==3 && __GNUC_MINOR__ > 0))
-#  define NLOPT_DEPRECATED __attribute__((deprecated))
-#else
-#  define NLOPT_DEPRECATED
-#endif
-
-typedef double (*nlopt_func_old) (int n, const double *x, double *gradient,     /* NULL if not needed */
-                                  void *func_data);
-
-NLOPT_EXTERN(nlopt_result) nlopt_minimize(nlopt_algorithm algorithm, int n, nlopt_func_old f, void *f_data,
-                                          const double *lb, const double *ub, /* bounds */
-                                          double *x,    /* in: initial guess, out: minimizer */
-                                          double *minf, /* out: minimum */
-                                          double minf_max, double ftol_rel, double ftol_abs, double xtol_rel, const double *xtol_abs, int maxeval, double maxtime) NLOPT_DEPRECATED;
-
-NLOPT_EXTERN(nlopt_result) nlopt_minimize_constrained(nlopt_algorithm algorithm, int n, nlopt_func_old f, void *f_data, int m, nlopt_func_old fc, void *fc_data, ptrdiff_t fc_datum_size,
-                                                      const double *lb, const double *ub,   /* bounds */
-                                                      double *x,        /* in: initial guess, out: minimizer */
-                                                      double *minf,     /* out: minimum */
-                                                      double minf_max, double ftol_rel, double ftol_abs, double xtol_rel, const double *xtol_abs, int maxeval, double maxtime) NLOPT_DEPRECATED;
-
-NLOPT_EXTERN(nlopt_result) nlopt_minimize_econstrained(nlopt_algorithm algorithm, int n, nlopt_func_old f, void *f_data, int m, nlopt_func_old fc, void *fc_data, ptrdiff_t fc_datum_size, int p, nlopt_func_old h, void *h_data, ptrdiff_t h_datum_size,
-                                                       const double *lb, const double *ub,   /* bounds */
-                                                       double *x,       /* in: initial guess, out: minimizer */
-                                                       double *minf,    /* out: minimum */
-                                                       double minf_max, double ftol_rel, double ftol_abs,
-                                                       double xtol_rel, const double *xtol_abs, double htol_rel, double htol_abs, int maxeval, double maxtime) NLOPT_DEPRECATED;
-
-NLOPT_EXTERN(void) nlopt_get_local_search_algorithm(nlopt_algorithm * deriv, nlopt_algorithm * nonderiv, int *maxeval) NLOPT_DEPRECATED;
-NLOPT_EXTERN(void) nlopt_set_local_search_algorithm(nlopt_algorithm deriv, nlopt_algorithm nonderiv, int maxeval) NLOPT_DEPRECATED;
-
-NLOPT_EXTERN(int) nlopt_get_stochastic_population(void) NLOPT_DEPRECATED;
-NLOPT_EXTERN(void) nlopt_set_stochastic_population(int pop) NLOPT_DEPRECATED;
-
-/*********************************************************************/
-
-#ifdef __cplusplus
-}  /* extern "C" */
-#endif /* __cplusplus */
-#endif
diff --git a/inst/include/nlopt.hpp b/inst/include/nlopt.hpp
deleted file mode 100644
index a41c21c..0000000
--- a/inst/include/nlopt.hpp
+++ /dev/null
@@ -1,575 +0,0 @@
-/* Copyright (c) 2007-2011 Massachusetts Institute of Technology
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-// C++ style wrapper around NLopt API
-// nlopt.hpp is AUTOMATICALLY GENERATED from nlopt-in.hpp - edit the latter!
-#ifndef NLOPT_HPP
-#define NLOPT_HPP
-#include <nlopt.h>
-#include <vector>
-#include <stdexcept>
-#include <new>
-#include <cstdlib>
-#include <cstring>
-#include <cmath>
-// convenience overloading for below (not in nlopt:: since has nlopt_ prefix)
-inline nlopt_result nlopt_get_initial_step(const nlopt_opt opt, double *dx) {
-      return nlopt_get_initial_step(opt, (const double *) NULL, dx);
-}
-namespace nlopt {
-  //////////////////////////////////////////////////////////////////////
-  // nlopt::* namespace versions of the C enumerated types
-  //          AUTOMATICALLY GENERATED, DO NOT EDIT
-  // GEN_ENUMS_HERE
-  enum algorithm {
-    GN_DIRECT = 0,
-    GN_DIRECT_L,
-    GN_DIRECT_L_RAND,
-    GN_DIRECT_NOSCAL,
-    GN_DIRECT_L_NOSCAL,
-    GN_DIRECT_L_RAND_NOSCAL,
-    GN_ORIG_DIRECT,
-    GN_ORIG_DIRECT_L,
-    GD_STOGO,
-    GD_STOGO_RAND,
-    LD_LBFGS_NOCEDAL,
-    LD_LBFGS,
-    LN_PRAXIS,
-    LD_VAR1,
-    LD_VAR2,
-    LD_TNEWTON,
-    LD_TNEWTON_RESTART,
-    LD_TNEWTON_PRECOND,
-    LD_TNEWTON_PRECOND_RESTART,
-    GN_CRS2_LM,
-    GN_MLSL,
-    GD_MLSL,
-    GN_MLSL_LDS,
-    GD_MLSL_LDS,
-    LD_MMA,
-    LN_COBYLA,
-    LN_NEWUOA,
-    LN_NEWUOA_BOUND,
-    LN_NELDERMEAD,
-    LN_SBPLX,
-    LN_AUGLAG,
-    LD_AUGLAG,
-    LN_AUGLAG_EQ,
-    LD_AUGLAG_EQ,
-    LN_BOBYQA,
-    GN_ISRES,
-    AUGLAG,
-    AUGLAG_EQ,
-    G_MLSL,
-    G_MLSL_LDS,
-    LD_SLSQP,
-    LD_CCSAQ,
-    GN_ESCH,
-    GN_AGS,
-    NUM_ALGORITHMS        /* not an algorithm, just the number of them */
-  };
-  enum result {
-    FAILURE = -1,         /* generic failure code */
-    INVALID_ARGS = -2,
-    OUT_OF_MEMORY = -3,
-    ROUNDOFF_LIMITED = -4,
-    FORCED_STOP = -5,
-    NUM_FAILURES = -6,    /* not a result, just the number of possible failures */
-    SUCCESS = 1,          /* generic success code */
-    STOPVAL_REACHED = 2,
-    FTOL_REACHED = 3,
-    XTOL_REACHED = 4,
-    MAXEVAL_REACHED = 5,
-    MAXTIME_REACHED = 6,
-    NUM_RESULTS           /* not a result, just the number of possible successes */
-  };
-  //////////////////////////////////////////////////////////////////////
-  typedef nlopt_func func; // nlopt::func synoynm
-  typedef nlopt_mfunc mfunc; // nlopt::mfunc synoynm
-  // alternative to nlopt_func that takes std::vector<double>
-  // ... unfortunately requires a data copy
-  typedef double (*vfunc)(const std::vector<double> &x,
-			  std::vector<double> &grad, void *data);
-  //////////////////////////////////////////////////////////////////////
-  // NLopt-specific exceptions (corresponding to error codes):
-  class roundoff_limited : public std::runtime_error {
-  public:
-    roundoff_limited() : std::runtime_error("nlopt roundoff-limited") {}
-  };
-  class forced_stop : public std::runtime_error {
-  public:
-    forced_stop() : std::runtime_error("nlopt forced stop") {}
-  };
-  //////////////////////////////////////////////////////////////////////
-  class opt {
-  private:
-    nlopt_opt o;
-    void mythrow(nlopt_result ret) const {
-      switch (ret) {
-      case NLOPT_FAILURE: throw std::runtime_error(get_errmsg() ? get_errmsg() : "nlopt failure");
-      case NLOPT_OUT_OF_MEMORY: throw std::bad_alloc();
-      case NLOPT_INVALID_ARGS: throw std::invalid_argument(get_errmsg() ? get_errmsg() : "nlopt invalid argument");
-      case NLOPT_ROUNDOFF_LIMITED: throw roundoff_limited();
-      case NLOPT_FORCED_STOP: throw forced_stop();
-      default: break;
-      }
-    }
-    typedef struct {
-      opt *o;
-      mfunc mf; func f; void *f_data;
-      vfunc vf;
-      nlopt_munge munge_destroy, munge_copy; // non-NULL for SWIG wrappers
-    } myfunc_data;
-    // free/destroy f_data in nlopt_destroy and nlopt_copy, respectively
-    static void *free_myfunc_data(void *p) {
-      myfunc_data *d = (myfunc_data *) p;
-      if (d) {
-	if (d->f_data && d->munge_destroy) d->munge_destroy(d->f_data);
-	delete d;
-      }
-      return NULL;
-    }
-    static void *dup_myfunc_data(void *p) {
-      myfunc_data *d = (myfunc_data *) p;
-      if (d) {
-	void *f_data;
-	if (d->f_data && d->munge_copy) {
-	  f_data = d->munge_copy(d->f_data);
-	  if (!f_data) return NULL;
-	}
-	else
-	  f_data = d->f_data;
-	myfunc_data *dnew = new myfunc_data;
-	if (dnew) {
-	  *dnew = *d;
-	  dnew->f_data = f_data;
-	}
-	return (void*) dnew;
-      }
-      else return NULL;
-    }
-    // nlopt_func wrapper that catches exceptions
-    static double myfunc(unsigned n, const double *x, double *grad, void *d_) {
-      myfunc_data *d = reinterpret_cast<myfunc_data*>(d_);
-      try {
-	return d->f(n, x, grad, d->f_data);
-      }
-      catch (std::bad_alloc&)
-	{ d->o->forced_stop_reason = NLOPT_OUT_OF_MEMORY; }
-      catch (std::invalid_argument&)
-	{ d->o->forced_stop_reason = NLOPT_INVALID_ARGS; }
-      catch (roundoff_limited&)
-	{ d->o->forced_stop_reason = NLOPT_ROUNDOFF_LIMITED; }
-      catch (forced_stop&)
-	{ d->o->forced_stop_reason = NLOPT_FORCED_STOP; }
-      catch (...)
-	{ d->o->forced_stop_reason = NLOPT_FAILURE; }
-      d->o->force_stop(); // stop gracefully, opt::optimize will re-throw
-      return HUGE_VAL;
-    }
-    // nlopt_mfunc wrapper that catches exceptions
-    static void mymfunc(unsigned m, double *result,
-			unsigned n, const double *x, double *grad, void *d_) {
-      myfunc_data *d = reinterpret_cast<myfunc_data*>(d_);
-      try {
-	d->mf(m, result, n, x, grad, d->f_data);
-	return;
-      }
-      catch (std::bad_alloc&)
-	{ d->o->forced_stop_reason = NLOPT_OUT_OF_MEMORY; }
-      catch (std::invalid_argument&)
-	{ d->o->forced_stop_reason = NLOPT_INVALID_ARGS; }
-      catch (roundoff_limited&)
-	{ d->o->forced_stop_reason = NLOPT_ROUNDOFF_LIMITED; }
-      catch (forced_stop&)
-	{ d->o->forced_stop_reason = NLOPT_FORCED_STOP; }
-      catch (...)
-	{ d->o->forced_stop_reason = NLOPT_FAILURE; }
-      d->o->force_stop(); // stop gracefully, opt::optimize will re-throw
-      for (unsigned i = 0; i < m; ++i) result[i] = HUGE_VAL;
-    }
-    std::vector<double> xtmp, gradtmp, gradtmp0; // scratch for myvfunc
-    // nlopt_func wrapper, using std::vector<double>
-    static double myvfunc(unsigned n, const double *x, double *grad, void *d_){
-      myfunc_data *d = reinterpret_cast<myfunc_data*>(d_);
-      try {
-	std::vector<double> &xv = d->o->xtmp;
-	if (n) std::memcpy(&xv[0], x, n * sizeof(double));
-	double val=d->vf(xv, grad ? d->o->gradtmp : d->o->gradtmp0, d->f_data);
-	if (grad && n) {
-	  std::vector<double> &gradv = d->o->gradtmp;
-	  std::memcpy(grad, &gradv[0], n * sizeof(double));
-	}
-	return val;
-      }
-      catch (std::bad_alloc&)
-	{ d->o->forced_stop_reason = NLOPT_OUT_OF_MEMORY; }
-      catch (std::invalid_argument&)
-	{ d->o->forced_stop_reason = NLOPT_INVALID_ARGS; }
-      catch (roundoff_limited&)
-	{ d->o->forced_stop_reason = NLOPT_ROUNDOFF_LIMITED; }
-      catch (forced_stop&)
-	{ d->o->forced_stop_reason = NLOPT_FORCED_STOP; }
-      catch (...)
-	{ d->o->forced_stop_reason = NLOPT_FAILURE; }
-      d->o->force_stop(); // stop gracefully, opt::optimize will re-throw
-      return HUGE_VAL;
-    }
-    void alloc_tmp() {
-      if (xtmp.size() != nlopt_get_dimension(o)) {
-	xtmp = std::vector<double>(nlopt_get_dimension(o));
-	gradtmp = std::vector<double>(nlopt_get_dimension(o));
-      }
-    }
-    result last_result;
-    double last_optf;
-    nlopt_result forced_stop_reason;
-  public:
-    // Constructors etc.
-    opt() : o(NULL), xtmp(0), gradtmp(0), gradtmp0(0),
-	    last_result(nlopt::FAILURE), last_optf(HUGE_VAL),
-	    forced_stop_reason(NLOPT_FORCED_STOP) {}
-    ~opt() { nlopt_destroy(o); }
-    opt(algorithm a, unsigned n) :
-      o(nlopt_create(nlopt_algorithm(a), n)),
-      xtmp(0), gradtmp(0), gradtmp0(0),
-      last_result(nlopt::FAILURE), last_optf(HUGE_VAL),
-      forced_stop_reason(NLOPT_FORCED_STOP) {
-      if (!o) throw std::bad_alloc();
-      nlopt_set_munge(o, free_myfunc_data, dup_myfunc_data);
-    }
-    opt(const char * algo_str, unsigned n) :
-      o(NULL), xtmp(0), gradtmp(0), gradtmp0(0),
-      last_result(nlopt::FAILURE), last_optf(HUGE_VAL),
-      forced_stop_reason(NLOPT_FORCED_STOP) {
-      const nlopt_algorithm a = nlopt_algorithm_from_string(algo_str);
-      if (a < 0)
-        throw std::invalid_argument("wrong algorithm string");
-      o = nlopt_create(a, n);
-      if (!o) throw std::bad_alloc();
-      nlopt_set_munge(o, free_myfunc_data, dup_myfunc_data);
-    }
-    opt(const opt& f) : o(nlopt_copy(f.o)),
-			xtmp(f.xtmp), gradtmp(f.gradtmp), gradtmp0(0),
-			last_result(f.last_result), last_optf(f.last_optf),
-			forced_stop_reason(f.forced_stop_reason) {
-      if (f.o && !o) throw std::bad_alloc();
-    }
-    opt& operator=(opt const& f) {
-      if (this == &f) return *this; // self-assignment
-      nlopt_destroy(o);
-      o = nlopt_copy(f.o);
-      if (f.o && !o) throw std::bad_alloc();
-      xtmp = f.xtmp; gradtmp = f.gradtmp;
-      last_result = f.last_result; last_optf = f.last_optf;
-      forced_stop_reason = f.forced_stop_reason;
-      return *this;
-    }
-    // Do the optimization:
-    result optimize(std::vector<double> &x, double &opt_f) {
-      if (o && nlopt_get_dimension(o) != x.size())
-        throw std::invalid_argument("dimension mismatch");
-      forced_stop_reason = NLOPT_FORCED_STOP;
-      nlopt_result ret = nlopt_optimize(o, x.empty() ? NULL : &x[0], &opt_f);
-      last_result = result(ret);
-      last_optf = opt_f;
-      if (ret == NLOPT_FORCED_STOP)
-	mythrow(forced_stop_reason);
-      mythrow(ret);
-      return last_result;
-    }
-    // variant mainly useful for SWIG wrappers:
-    std::vector<double> optimize(const std::vector<double> &x0) {
-      std::vector<double> x(x0);
-      last_result = optimize(x, last_optf);
-      return x;
-    }
-    result last_optimize_result() const { return last_result; }
-    double last_optimum_value() const { return last_optf; }
-    // accessors:
-    algorithm get_algorithm() const {
-      if (!o) throw std::runtime_error("uninitialized nlopt::opt");
-      return algorithm(nlopt_get_algorithm(o));
-    }
-    const char *get_algorithm_name() const {
-      if (!o) throw std::runtime_error("uninitialized nlopt::opt");
-      return nlopt_algorithm_name(nlopt_get_algorithm(o));
-    }
-    unsigned get_dimension() const {
-      if (!o) throw std::runtime_error("uninitialized nlopt::opt");
-      return nlopt_get_dimension(o);
-    }
-    // Set the objective function
-    void set_min_objective(func f, void *f_data) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->f = f; d->f_data = f_data; d->mf = NULL; d->vf = NULL;
-      d->munge_destroy = d->munge_copy = NULL;
-      mythrow(nlopt_set_min_objective(o, myfunc, d)); // d freed via o
-    }
-    void set_min_objective(vfunc vf, void *f_data) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->f = NULL; d->f_data = f_data; d->mf = NULL; d->vf = vf;
-      d->munge_destroy = d->munge_copy = NULL;
-      mythrow(nlopt_set_min_objective(o, myvfunc, d)); // d freed via o
-      alloc_tmp();
-    }
-    void set_max_objective(func f, void *f_data) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->f = f; d->f_data = f_data; d->mf = NULL; d->vf = NULL;
-      d->munge_destroy = d->munge_copy = NULL;
-      mythrow(nlopt_set_max_objective(o, myfunc, d)); // d freed via o
-    }
-    void set_max_objective(vfunc vf, void *f_data) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->f = NULL; d->f_data = f_data; d->mf = NULL; d->vf = vf;
-      d->munge_destroy = d->munge_copy = NULL;
-      mythrow(nlopt_set_max_objective(o, myvfunc, d)); // d freed via o
-      alloc_tmp();
-    }
-    // for internal use in SWIG wrappers -- variant that
-    // takes ownership of f_data, with munging for destroy/copy
-    void set_min_objective(func f, void *f_data,
-			   nlopt_munge md, nlopt_munge mc) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->f = f; d->f_data = f_data; d->mf = NULL; d->vf = NULL;
-      d->munge_destroy = md; d->munge_copy = mc;
-      mythrow(nlopt_set_min_objective(o, myfunc, d)); // d freed via o
-    }
-    void set_max_objective(func f, void *f_data,
-			   nlopt_munge md, nlopt_munge mc) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->f = f; d->f_data = f_data; d->mf = NULL; d->vf = NULL;
-      d->munge_destroy = md; d->munge_copy = mc;
-      mythrow(nlopt_set_max_objective(o, myfunc, d)); // d freed via o
-    }
-    // Nonlinear constraints:
-    void remove_inequality_constraints() {
-      nlopt_result ret = nlopt_remove_inequality_constraints(o);
-      mythrow(ret);
-    }
-    void add_inequality_constraint(func f, void *f_data, double tol=0) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->f = f; d->f_data = f_data; d->mf = NULL; d->vf = NULL;
-      d->munge_destroy = d->munge_copy = NULL;
-      mythrow(nlopt_add_inequality_constraint(o, myfunc, d, tol));
-    }
-    void add_inequality_constraint(vfunc vf, void *f_data, double tol=0) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->f = NULL; d->f_data = f_data; d->mf = NULL; d->vf = vf;
-      d->munge_destroy = d->munge_copy = NULL;
-      mythrow(nlopt_add_inequality_constraint(o, myvfunc, d, tol));
-      alloc_tmp();
-    }
-    void add_inequality_mconstraint(mfunc mf, void *f_data,
-				    const std::vector<double> &tol) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->mf = mf; d->f_data = f_data; d->f = NULL; d->vf = NULL;
-      d->munge_destroy = d->munge_copy = NULL;
-      mythrow(nlopt_add_inequality_mconstraint(o, tol.size(), mymfunc, d,
-					       tol.empty() ? NULL : &tol[0]));
-    }
-    void remove_equality_constraints() {
-      nlopt_result ret = nlopt_remove_equality_constraints(o);
-      mythrow(ret);
-    }
-    void add_equality_constraint(func f, void *f_data, double tol=0) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->f = f; d->f_data = f_data; d->mf = NULL; d->vf = NULL;
-      d->munge_destroy = d->munge_copy = NULL;
-      mythrow(nlopt_add_equality_constraint(o, myfunc, d, tol));
-    }
-    void add_equality_constraint(vfunc vf, void *f_data, double tol=0) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->f = NULL; d->f_data = f_data; d->mf = NULL; d->vf = vf;
-      d->munge_destroy = d->munge_copy = NULL;
-      mythrow(nlopt_add_equality_constraint(o, myvfunc, d, tol));
-      alloc_tmp();
-    }
-    void add_equality_mconstraint(mfunc mf, void *f_data,
-				  const std::vector<double> &tol) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->mf = mf; d->f_data = f_data; d->f = NULL; d->vf = NULL;
-      d->munge_destroy = d->munge_copy = NULL;
-      mythrow(nlopt_add_equality_mconstraint(o, tol.size(), mymfunc, d,
-					     tol.empty() ? NULL : &tol[0]));
-    }
-    // For internal use in SWIG wrappers (see also above)
-    void add_inequality_constraint(func f, void *f_data,
-				   nlopt_munge md, nlopt_munge mc,
-				   double tol=0) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->f = f; d->f_data = f_data; d->mf = NULL; d->vf = NULL;
-      d->munge_destroy = md; d->munge_copy = mc;
-      mythrow(nlopt_add_inequality_constraint(o, myfunc, d, tol));
-    }
-    void add_equality_constraint(func f, void *f_data,
-				 nlopt_munge md, nlopt_munge mc,
-				 double tol=0) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->f = f; d->f_data = f_data; d->mf = NULL; d->vf = NULL;
-      d->munge_destroy = md; d->munge_copy = mc;
-      mythrow(nlopt_add_equality_constraint(o, myfunc, d, tol));
-    }
-    void add_inequality_mconstraint(mfunc mf, void *f_data,
-				    nlopt_munge md, nlopt_munge mc,
-				    const std::vector<double> &tol) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->mf = mf; d->f_data = f_data; d->f = NULL; d->vf = NULL;
-      d->munge_destroy = md; d->munge_copy = mc;
-      mythrow(nlopt_add_inequality_mconstraint(o, tol.size(), mymfunc, d,
-					       tol.empty() ? NULL : &tol[0]));
-    }
-    void add_equality_mconstraint(mfunc mf, void *f_data,
-				  nlopt_munge md, nlopt_munge mc,
-				  const std::vector<double> &tol) {
-      myfunc_data *d = new myfunc_data;
-      if (!d) throw std::bad_alloc();
-      d->o = this; d->mf = mf; d->f_data = f_data; d->f = NULL; d->vf = NULL;
-      d->munge_destroy = md; d->munge_copy = mc;
-      mythrow(nlopt_add_equality_mconstraint(o, tol.size(), mymfunc, d,
-					     tol.empty() ? NULL : &tol[0]));
-    }
-    void set_param(const char *name, double val) { mythrow(nlopt_set_param(o, name, val)); }
-    double get_param(const char *name, double defaultval) const { return nlopt_get_param(o, name, defaultval); }
-    bool has_param(const char *name) const { return bool(nlopt_has_param(o, name)); }
-    const char *nth_param(unsigned n) const { return nlopt_nth_param(o, n); }
-    unsigned num_params() const { return nlopt_num_params(o); }
-#define NLOPT_GETSET_VEC(name)						 \
-    void set_##name(double val) {					 \
-      mythrow(nlopt_set_##name##1(o, val)); \
-    }									 \
-    void get_##name(std::vector<double> &v) const {			 \
-      if (o && nlopt_get_dimension(o) != v.size())			 \
-        throw std::invalid_argument("dimension mismatch"); \
-      mythrow(nlopt_get_##name(o, v.empty() ? NULL : &v[0])); \
-    }									 \
-    std::vector<double> get_##name() const {			 \
-      if (!o) throw std::runtime_error("uninitialized nlopt::opt"); \
-      std::vector<double> v(nlopt_get_dimension(o)); \
-      get_##name(v); \
-      return v; \
-    }			 						 \
-    void set_##name(const std::vector<double> &v) {			 \
-      if (o && nlopt_get_dimension(o) != v.size())			 \
-        throw std::invalid_argument("dimension mismatch"); \
-      mythrow(nlopt_set_##name(o, v.empty() ? NULL : &v[0])); \
-    }
-    NLOPT_GETSET_VEC(lower_bounds)
-    NLOPT_GETSET_VEC(upper_bounds)
-    // stopping criteria:
-#define NLOPT_GETSET(T, name)						 \
-    T get_##name() const {						 \
-      if (!o) throw std::runtime_error("uninitialized nlopt::opt"); \
-      return nlopt_get_##name(o); \
-    }									 \
-    void set_##name(T name) {						 \
-      mythrow(nlopt_set_##name(o, name)); \
-    }
-    NLOPT_GETSET(double, stopval)
-    NLOPT_GETSET(double, ftol_rel)
-    NLOPT_GETSET(double, ftol_abs)
-    NLOPT_GETSET(double, xtol_rel)
-    NLOPT_GETSET_VEC(xtol_abs)
-    NLOPT_GETSET_VEC(x_weights)
-    NLOPT_GETSET(int, maxeval)
-    int get_numevals() const {
-      if (!o) throw std::runtime_error("uninitialized nlopt::opt");
-      return nlopt_get_numevals(o);
-    }
-    NLOPT_GETSET(double, maxtime)
-    NLOPT_GETSET(int, force_stop)
-    void force_stop() { set_force_stop(1); }
-    const char *get_errmsg() const {
-        if (!o) throw std::runtime_error("uninitialized nlopt::opt");
-        return nlopt_get_errmsg(o);
-    }
-    // algorithm-specific parameters:
-    void set_local_optimizer(const opt &lo) {
-      nlopt_result ret = nlopt_set_local_optimizer(o, lo.o);
-      mythrow(ret);
-    }
-    NLOPT_GETSET(unsigned, population)
-    NLOPT_GETSET(unsigned, vector_storage)
-    NLOPT_GETSET_VEC(initial_step)
-    void set_default_initial_step(const std::vector<double> &x) {
-      nlopt_result ret
-	= nlopt_set_default_initial_step(o, x.empty() ? NULL : &x[0]);
-      mythrow(ret);
-    }
-    void get_initial_step(const std::vector<double> &x, std::vector<double> &dx) const {
-      if (o && (nlopt_get_dimension(o) != x.size()
-		|| nlopt_get_dimension(o) != dx.size()))
-        throw std::invalid_argument("dimension mismatch");
-      nlopt_result ret = nlopt_get_initial_step(o, x.empty() ? NULL : &x[0],
-						dx.empty() ? NULL : &dx[0]);
-      mythrow(ret);
-    }
-    std::vector<double> get_initial_step_(const std::vector<double> &x) const {
-      if (!o) throw std::runtime_error("uninitialized nlopt::opt");
-      std::vector<double> v(nlopt_get_dimension(o));
-      get_initial_step(x, v);
-      return v;
-    }
-  };
-#undef NLOPT_GETSET
-#undef NLOPT_GETSET_VEC
-  //////////////////////////////////////////////////////////////////////
-  inline void srand(unsigned long seed) { nlopt_srand(seed); }
-  inline void srand_time() { nlopt_srand_time(); }
-  inline void version(int &major, int &minor, int &bugfix) {
-    nlopt_version(&major, &minor, &bugfix);
-  }
-  inline int version_major() {
-    int major, minor, bugfix;
-    nlopt_version(&major, &minor, &bugfix);
-    return major;
-  }
-  inline int version_minor() {
-    int major, minor, bugfix;
-    nlopt_version(&major, &minor, &bugfix);
-    return minor;
-  }
-  inline int version_bugfix() {
-    int major, minor, bugfix;
-    nlopt_version(&major, &minor, &bugfix);
-    return bugfix;
-  }
-  inline const char *algorithm_name(algorithm a) {
-    return nlopt_algorithm_name(nlopt_algorithm(a));
-  }
-  //////////////////////////////////////////////////////////////////////
-} // namespace nlopt
-#endif /* NLOPT_HPP */
diff --git a/src/nloptr.c b/src/nloptr.c
index adc2faa..b6c634c 100644
--- a/src/nloptr.c
+++ b/src/nloptr.c
@@ -629,6 +629,15 @@ nlopt_opt getOptions( SEXP R_options, int num_controls, int *flag_encountered_er
         Rprintf("Error: nlopt_set_population returned NLOPT_INVALID_ARGS.\n");
     }
 
+    SEXP R_opts_vector_storage;
+    PROTECT( R_opts_vector_storage = AS_INTEGER( getListElement( R_options, "vector_storage" ) ) );
+    unsigned int vector_storage = INTEGER( R_opts_vector_storage )[0];
+    res = nlopt_set_vector_storage(opts, vector_storage);
+    if ( res == NLOPT_INVALID_ARGS ) {
+      *flag_encountered_error = 1;
+      Rprintf("Error: nlopt_set_vector_storage returned NLOPT_INVALID_ARGS.\n");
+    }
+
     SEXP R_opts_ranseed;
     PROTECT( R_opts_ranseed = AS_INTEGER( getListElement( R_options, "ranseed" ) ) );
     unsigned long ranseed = INTEGER( R_opts_ranseed )[0];
@@ -637,7 +646,8 @@ nlopt_opt getOptions( SEXP R_options, int num_controls, int *flag_encountered_er
     if ( ranseed > 0 ) {
         nlopt_srand(ranseed);
     }
-    UNPROTECT( 11 );
+
+    UNPROTECT( 12 );
 
     return opts;
 }

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/lib/debug/.build-id/90/8989f8db0dba4126a7bb344a1c2b3218f541e4.debug

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/lib/R/site-library/nloptr/include/nlopt.f
-rw-r--r--  root/root   /usr/lib/R/site-library/nloptr/include/nlopt.h
-rw-r--r--  root/root   /usr/lib/R/site-library/nloptr/include/nlopt.hpp
-rw-r--r--  root/root   /usr/lib/debug/.build-id/fb/2976afe2214b7f2c79d2e1ba4bcfbd372327ab.debug

Control files of package r-cran-nloptr: lines which differ (wdiff format)

  • Depends: libc6 (>= 2.14), libgcc-s1 (>= 3.0), libnlopt0 (>= 2.3), libstdc++6 (>= 11), r-base-core (>= 4.2.1-2), 4.2.2.20221110-1), r-api-4.0, r-cran-testthat

Control files of package r-cran-nloptr-dbgsym: lines which differ (wdiff format)

  • Build-Ids: fb2976afe2214b7f2c79d2e1ba4bcfbd372327ab 908989f8db0dba4126a7bb344a1c2b3218f541e4

More details

Full run details