tests/testthat/test-240319.R

test_that("test HW adagio", {
  if (requireNamespace("adagio", quietly = TRUE)) {

    n <- 10
    fn <- adagio::fnRosenbrock
    gr <- adagio::grRosenbrock
    lb <- c(rep(-2.5, n)); ub = -lb
    x0 <- rep(0.5, n)

    sol1 <- lbfgsb3c(x0, fn, gr = gr, lower = lb, upper = ub)


    expect_true(sol1$value < 1e-4)

  }
})

Try the lbfgsb3c package in your browser

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

lbfgsb3c documentation built on Sept. 18, 2024, 1:06 a.m.