R/RcppExports.R

Defines functions bobyqa_rosen_x1e bobyqa_rosen_x1

Documented in bobyqa_rosen_x1 bobyqa_rosen_x1e

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#'@title Example 1a: Minimize Rosenbrock function using bobyqa
#'@description Minimize Rosenbrock function using bobyqa and
#'             expect a normal exit from bobyqa.
#'@return No return value, called for side effects.
#'@examples
#'fr <- function(x) {   ## Rosenbrock Banana function
#'  x1 <- x[1]
#'  x2 <- x[2]
#'  100 * (x2 - x1 * x1)^2 + (1 - x1)^2
#'}
#'(x1 <- minqa::bobyqa(c(1, 2), fr, lower = c(0, 0), upper = c(4, 4)))
#'## => optimum at c(1, 1) with fval = 0
#'str(x1) # see that the error code and msg are returned
#'
#'## corresponding C++ implementation:
#'bobyqa_rosen_x1()
#'@export
bobyqa_rosen_x1 <- function() {
    invisible(.Call('_rminqa_bobyqa_rosen_x1', PACKAGE = 'rminqa'))
}

#'@title Example 1b: Minimize Rosenbrock function using bobyqa
#'@description Minimize Rosenbrock function using bobyqa and
#'             expect a normal exit from bobyqa.
#'@return No return value, called for side effects.
#'@examples
#'fr <- function(x) {   ## Rosenbrock Banana function
#'  x1 <- x[1]
#'  x2 <- x[2]
#'  100 * (x2 - x1 * x1)^2 + (1 - x1)^2
#'}
#'# check the error exits
#'# too many iterations
#'x1e <- minqa::bobyqa(c(1, 2), fr, lower = c(0, 0), upper = c(4, 4), control = list(maxfun=50))
#'str(x1e)
#'
#'## corresponding C++ implementation:
#'bobyqa_rosen_x1e()
#'@export
bobyqa_rosen_x1e <- function() {
    invisible(.Call('_rminqa_bobyqa_rosen_x1e', PACKAGE = 'rminqa'))
}

Try the rminqa package in your browser

Any scripts or data that you put into this service are public.

rminqa documentation built on Jan. 9, 2023, 1:20 a.m.